Having problems running an "Insert" heterogeneous query in the Editor window.
The query runs with no errors from heterogeneous query, but an error is generated when running the query in the Editor using DB2 ODBC connection:
Error Message:
" Quest.Toad.Exceptions.DatabaseException: ERROR [42601] [IBM][CLI Driver][DB2/AIX64] SQL0104N An unexpected token "[my_table]" was found following "xxx".yyy,". Expected tokens may include: "<name>". SQLSTATE=42601"
Here is an example of inserting using a heterogeneous query, the general principal is this:
a heterogeneous query (as created by our Query Builder) looks something like this:
select *
from "oracle odbc connection..."."ORA_SCHEMA.ORA_TABLE" "A"
inner join
"sql server odbc connection..."."ss_schema.ss_table" [B]
on ("A".COLUMN1 = [B].[Column 2]) ;
Suppose you want to insert the output of this select into an Oracle table, from the same database as the table in the first part of the join. Send the query builder SQL statement to the editor (and manually type in the passwords required by the ODBC connection), copy the Oracle ODBC connection to the insert statement, and add the Oracle table name. For example insert into "oracle odbc connection..."."ORA_SCHEMA.ORA_DEST_TABLE"
select *
from "oracle odbc connection..."."ORA_SCHEMA.ORA_TABLE" "A"
inner join
"sql server odbc connection..."."ss_schema.ss_table" [B]
on ("A".COLUMN1 = [B].[Column 2]) ;
© 2021 Quest Software Inc. ALL RIGHTS RESERVED. Feedback Terms of Use Privacy