can we use "IF exists " statement and create state
Posted: Wed Sep 11, 2019 6:18 am
Hi,
I am trying to run below query in odbc_connector(before sql statement), facing issue. Loading data from netezza to yellowbrick.
and same time create statement table in before sql and insert table is same,
failing job in this scenario also if both names are same, working fine in netezza connector.
Before_SQL=DROP TABLE stage.LEG_CURRENT_MER_TEMP_DM IF EXISTS;CREATE TABLE stage.LEG_CURRENT_MER_TEMP_DM (MER_ID INTEGER,FEE_CD CHAR(2));GRANT SELECT ON stage.LEG_CURRENT_MER_TEMP_DM TO PUBLIC;
issue: YB_Insrt: ODBC function "SQLExecDirect()" reported: SQLSTATE = 42000: Native Error Code = 6819553: Msg = [IBM(DataDirect OEM)][ODBC PostgreSQL Wire Protocol driver][PostgreSQL]ERROR: syntax error at or near "IF"(Position 42; )
YB_Insrt: Execution failed on statement DROP TABLE stage.LEG_CURRENT_MER_TEMP_DM IF EXISTS
I am trying to run below query in odbc_connector(before sql statement), facing issue. Loading data from netezza to yellowbrick.
and same time create statement table in before sql and insert table is same,
failing job in this scenario also if both names are same, working fine in netezza connector.
Before_SQL=DROP TABLE stage.LEG_CURRENT_MER_TEMP_DM IF EXISTS;CREATE TABLE stage.LEG_CURRENT_MER_TEMP_DM (MER_ID INTEGER,FEE_CD CHAR(2));GRANT SELECT ON stage.LEG_CURRENT_MER_TEMP_DM TO PUBLIC;
issue: YB_Insrt: ODBC function "SQLExecDirect()" reported: SQLSTATE = 42000: Native Error Code = 6819553: Msg = [IBM(DataDirect OEM)][ODBC PostgreSQL Wire Protocol driver][PostgreSQL]ERROR: syntax error at or near "IF"(Position 42; )
YB_Insrt: Execution failed on statement DROP TABLE stage.LEG_CURRENT_MER_TEMP_DM IF EXISTS