Author |
Message
|
sebastian |
Posted: Tue Oct 18, 2005 7:01 am Post subject: Accessing database data from a message flow |
|
|
 Centurion
Joined: 12 Nov 2003 Posts: 110 Location: Philadelphia
|
I am trying to access a database from a message flow. I thought the database node would be the correct node to use for this but I do not see any area to configure the specific database, schema etc...
Has anyone done this before? I simply need to check a value in a table and if it meets a particular criteria, continue to process the message. Otherwise, the message should not continue to process.
Any help is appreciated,
Sebastian  _________________ sebastian signature |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Oct 18, 2005 7:07 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
|
Back to top |
|
 |
sebastian |
Posted: Tue Oct 18, 2005 8:17 am Post subject: |
|
|
 Centurion
Joined: 12 Nov 2003 Posts: 110 Location: Philadelphia
|
Would you have any ESQL code examples of how to access the database? I'm sure after setting up the connection, it would just be a series of SQL statements but I'm not sure where to start with the ESQL.
thanks,
Seb _________________ sebastian signature |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Oct 18, 2005 8:20 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
sebastian wrote: |
Would you have any ESQL code examples of how to access the database? I'm sure after setting up the connection, it would just be a series of SQL statements but I'm not sure where to start with the ESQL. |
Have you considered getting training on this product? These are *basic* questions, and this is not a product that is easily learned on one's own.
You can use SELECT, INSERT, UPDATE, and DELETE as standard ESQL statements. The documentation provides full descriptions of which clauses the ESQL version of these statements supports, and which it doesn't, and provides simple and more complex examples of using them. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
Prithvi |
Posted: Tue Oct 18, 2005 9:36 am Post subject: |
|
|
 Apprentice
Joined: 20 Dec 2004 Posts: 34
|
Sebastian,
you cannot change the message body in the database node, though you can decide whether or not to propagate the message further.
You might consider using something along the lines of:
SET Environment.Variables.temp[] = (SELECT T.Colunmn_Name FROM Database.Table_name AS T WHERE (condition));
IF Environment.Variables.temp.Column_Name = (desired_value) THEN
RETURN TRUE;
ELSE
RETURN FALSE;
END IF;
If you return false the message is not propagated. If you wish to record the message for auiting perposes, you could throw an user exception and connect the failure terminal to the audit_message queue.
Rgds _________________ Prithvi |
|
Back to top |
|
 |
sebastian |
Posted: Tue Oct 18, 2005 9:39 am Post subject: |
|
|
 Centurion
Joined: 12 Nov 2003 Posts: 110 Location: Philadelphia
|
Thank you for your response. I am now hunting for ESQL examples of accessing a database.
Sebastian _________________ sebastian signature |
|
Back to top |
|
 |
JT |
Posted: Tue Oct 18, 2005 2:16 pm Post subject: |
|
|
Padawan
Joined: 27 Mar 2003 Posts: 1564 Location: Hartford, CT.
|
|
Back to top |
|
 |
elvis_gn |
Posted: Tue Oct 18, 2005 8:27 pm Post subject: |
|
|
 Padawan
Joined: 08 Oct 2004 Posts: 1905 Location: Dubai
|
Or better, take up the ESQL.pdf......it is available through this site or at the IBM redbooks site too....
The pdf is more than enough to get u started and get you through, through some complex database commands.... |
|
Back to top |
|
 |
sebastian |
Posted: Wed Oct 19, 2005 3:18 am Post subject: |
|
|
 Centurion
Joined: 12 Nov 2003 Posts: 110 Location: Philadelphia
|
Thanks for the tips guys. I really appreciate it.
take care,
Seb _________________ sebastian signature |
|
Back to top |
|
 |
|