Author |
Message
|
edasnarik |
Posted: Wed Mar 03, 2010 1:34 am Post subject: INSERT_UPDATE |
|
|
Acolyte
Joined: 10 Mar 2009 Posts: 61
|
INSERT_UPDATE Statement available in ESQL ?
Inserts if the record isn't there and Updates if it is present. |
|
Back to top |
|
 |
Gaya3 |
Posted: Fri Mar 05, 2010 4:04 am Post subject: |
|
|
 Jedi
Joined: 12 Sep 2006 Posts: 2493 Location: Boston, US
|
why cant you use Passthru function  _________________ Regards
Gayathri
-----------------------------------------------
Do Something Before you Die |
|
Back to top |
|
 |
edasnarik |
Posted: Sun Mar 07, 2010 9:55 pm Post subject: |
|
|
Acolyte
Joined: 10 Mar 2009 Posts: 61
|
Code: |
PASSTHRU('MERGE INTO ASADE.SIMPLE TA USING ( SELECT ( SNO) FROM ASADE.SIMPLE) AC ON ( TA.SNO = SNO )WHEN MATCHED THEN UPDATE SET TA.SNAME = '||SNAME||' WHEN NOT MATCHED
THEN INSERT(SNO,SNAME) VALUES('|| SNO ||','||SNAME||')'); |
I was trying on the same lines but was not able to achieve it.
Can you help me with a sample line of code ? |
|
Back to top |
|
 |
smdavies99 |
Posted: Mon Mar 08, 2010 12:24 am Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
I'd build the SQL as a complete string and then pass it to passthru.
Then in the debugger or via user trace you can see the complete string easily and check for syntax errors. _________________ WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995
Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions. |
|
Back to top |
|
 |
edasnarik |
Posted: Mon Mar 08, 2010 12:31 am Post subject: |
|
|
Acolyte
Joined: 10 Mar 2009 Posts: 61
|
smdavies99 wrote: |
build the SQL |
Thts my problem. |
|
Back to top |
|
 |
|