Page 1 of 1

can we use "IF exists " statement and create state

Posted: Wed Sep 11, 2019 6:18 am
by deesh
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

Posted: Sat Sep 14, 2019 9:30 am
by chulett
Don't like to see posts sitting without any replies, but that's the nature of a peer-to-peer site like this. Hopefully in the interim you've either solved this or gotten some official support help. For the latter, please update your post so others with the same question have a solution. :wink:

I don't have direct experience but searching tells me that this might help. If it doesn't then I would see if support can help as it could be something PostgreSQL specific with Yellowbrick.

Posted: Sat Sep 21, 2019 11:07 am
by deesh
" if exists " not working for yellow bricks we modified the job logic, instead of one job, splitted the job and impleted the ifexist logic.