ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » my question is PASSTHRU.could you please help me

Post new topic  Reply to topic
 my question is PASSTHRU.could you please help me « View previous topic :: View next topic » 
Author Message
Dombs
PostPosted: Sat Nov 24, 2018 5:55 am    Post subject: my question is PASSTHRU.could you please help me Reply with quote

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
View user's profile Send private message
abhi_thri
PostPosted: Mon Nov 26, 2018 1:01 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » my question is PASSTHRU.could you please help me
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.