can we use "IF exists " statement and create state

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
deesh
Participant
Posts: 193
Joined: Mon Oct 08, 2007 2:57 am

can we use "IF exists " statement and create state

Post 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
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
deesh
Participant
Posts: 193
Joined: Mon Oct 08, 2007 2:57 am

Post 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.
Post Reply