To insert data from an Adaptive Server Enterprise or SQL Server database, use the LOCATION syntax of the INSERT statement.
The Sybase connectivity libraries must be installed on your system, and the load library path environment variable for your platform must point to them.
The Adaptive Server Enterprise server to which you are connecting must exist in the interfaces file on the local machine.
You must have read permission on the source ASE or Sybase IQ database, and INSERT permission on the target Sybase IQ database
INSERT INTO iq_table LOCATION 'ase_servername.ase_dbname' { SELECT col1, col2, col3,... FROM owner.ase_table }
Sybase IQ does not support the Adaptive Server Enterprise data type TEXT, but you can execute INSERT...LOCATION (Syntax 3) from both an IQ CHAR or VARCHAR column whose length is greater than 255 bytes, or a LONG VARCHAR column, and from an ASE database column of data type TEXT. ASE TEXT and IMAGE columns can be inserted into columns of other Sybase IQ data types, if Sybase IQ supports the internal conversion. Also note that INSERT...LOCATION does not support the use of variables in the SELECT statement. By default, if a remote data column contains over 2GB, Sybase IQ silently truncates the column value to 2GB.
Users must be specifically licensed to use the Unstructured Data Analytics functionality. For details, see Unstructured Data Analytics in Sybase IQ.
You may substitute curly braces {} for the single quotation marks that delimit the SELECT statement. (Note that curly braces represent the start and end of an escape sequence in the ODBC standard, and may generate errors in the context of ODBC.)
INSERT INTO lineitem (l_shipdate, l_orderkey) LOCATION 'detroit.iq11db' { SELECT l_shipdate, l_orderkey FROM lineitem }
The destination and source columns may have different names.
The order in which you specify the columns is important, because data from the first source column named is inserted into the first target column named, and so on.
You can use the predicates of the SELECT statement within the INSERT command to insert data from only certain rows in the table.
INSERT INTO lineitem (l_shipdate, l_orderkey) LOCATION 'detroit.iqdb' PACKETSIZE 512 { SELECT l_shipdate, l_orderkey FROM lineitem WHERE l_orderkey = 1 }