|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
my question is PASSTHRU.could you please help me |
« View previous topic :: View next topic » |
Author |
Message
|
Dombs |
Posted: Sat Nov 24, 2018 5:55 am Post subject: my question is PASSTHRU.could you please help me |
|
|
Newbie
Joined: 29 Mar 2018 Posts: 5
|
i am doing at a time two operations using Database node.
if the record is already exist in the table we can update the ID column.other wise the record should be inserted.i tried to assign passthru value to var variable.it is throwing an error.could y
so my code below
Code: |
DECLARE var CHARACTER;
DECLARE value INTEGER;
DECLARE r1 CHARACTER;
DECLARE r2 CHARACTER;
DECLARE r3 CHARACTER;
SET r1 = Root.XMLNSC.record.name;
SET r2 = Root.XMLNSC.record.age;
SET r3 = Root.XMLNSC.record.address;
SET value = Root.XMLNSC.record.id;
ET var= PASSTHRU('SELECT R FROM Database.emp_details AS R WHERE R.ID = value');
IF var = Root.XMLNSC.record.id THEN
PASSTHRU('update Database.emp_details set emp_details.NAME =Root.XMLNSC.record.name ,emp_details.AGE = Root.XMLNSC.record.age , emp_details.ADDRESS = Root.XMLNSC.record.address where emp_details.id = var');
ELSE
PASSTHRU('INSERT INTO Database.emp_details (ID,NAME,AGE,ADDRESS) VALUES (Root.XMLNSC.record.id,Root.XMLNSC.record.name,
Root.XMLNSC.record.age,Root.XMLNSC.record.address)');
END IF;
|
 |
|
Back to top |
|
 |
abhi_thri |
Posted: Mon Nov 26, 2018 1:01 am Post subject: |
|
|
 Knight
Joined: 17 Jul 2017 Posts: 516 Location: UK
|
hi...what is the error you are getting?
Quote: |
ET var= PASSTHRU('SELECT R FROM Database.emp_details AS R WHERE R.ID = value'); |
By default the Passthru function/statement will return a resultset only, so you need to declare a row variable and use it...eg:- SET var[] = ... where var is of ROW type |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|