Author |
Message
|
klabran |
Posted: Wed Mar 17, 2004 3:15 pm Post subject: Insert db in compute |
|
|
 Master
Joined: 19 Feb 2004 Posts: 259 Location: Flagstaff AZ
|
I am using the below code in a compute node to dump the incoming message to a database. However the sdata field is empty. How do I dump the entire message using the insert into statement?
SET OutputRoot = InputRoot;
-- Enter SQL below this line. SQL above this line might be regenerated, causing any modifications to be lost.
insert into Database.tblCitationInAudit (sdata) values(cast(InputBody.Citations as char));
Kevin |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Mar 17, 2004 6:58 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
So, you want to get a representation of your message stream AS a BITSTREAM? _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
klabran |
Posted: Thu Mar 18, 2004 6:35 am Post subject: |
|
|
 Master
Joined: 19 Feb 2004 Posts: 259 Location: Flagstaff AZ
|
I want to take the complete incoming xml message and dump it to a text / string field in a DB using the insert into statement.
After I am done processing it I will then want to take the complete outgoing xml message and dump it to a text / string field in a DB using the insert into statement.
Is this possible or do I need to do it another way?
My incoming and outgoing message are not tied to a message set so I can't use the database insert node (at least, it doesn't look like I can).
Kevin |
|
Back to top |
|
 |
Missam |
Posted: Thu Mar 18, 2004 8:08 am Post subject: |
|
|
Chevalier
Joined: 16 Oct 2003 Posts: 424
|
Quote: |
My incoming and outgoing message are not tied to a message set so I can't use the database insert node
|
Did u tried this by inserting a database node in your flow...?
How is your sdata filed defined in your database.if it is varchar..is it enough to accomodate your incoming message in it.did u see for any database errors in your log.
if you want to insert your entire message in the database its better you define sdata as BLOB and pass your entire message as BITSTREAM. |
|
Back to top |
|
 |
klabran |
Posted: Thu Mar 18, 2004 11:04 am Post subject: |
|
|
 Master
Joined: 19 Feb 2004 Posts: 259 Location: Flagstaff AZ
|
the field in the DB is defined as varchar (8000) which is big enough for my test but not for my final. My final will use ntext (1mill. chars).
I did not recieve any errors in the flow and I did not check my db logs. It inserted a row but the sData field was empty.
I was hoping to avoid BLOBs only because they are not as easy to work with as varchars, ntext, ect....
Kevin |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Mar 18, 2004 11:23 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Did you look at the function called ASBITSTREAM? _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
klabran |
Posted: Thu Mar 18, 2004 11:28 am Post subject: |
|
|
 Master
Joined: 19 Feb 2004 Posts: 259 Location: Flagstaff AZ
|
I'm not finding it in the ESQL 2.1 reference?
I am using MQSI 2.1 CSD5 |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Mar 18, 2004 11:30 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
It's in the readme or memo.ptf, not the ESQL reference. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
klabran |
Posted: Thu Mar 18, 2004 11:48 am Post subject: |
|
|
 Master
Joined: 19 Feb 2004 Posts: 259 Location: Flagstaff AZ
|
Thanks.... Found it.
It works great!!!!
Kevin |
|
Back to top |
|
 |
klabran |
Posted: Fri Apr 29, 2005 9:17 am Post subject: |
|
|
 Master
Joined: 19 Feb 2004 Posts: 259 Location: Flagstaff AZ
|
Here's the code for this....
SET OutputRoot = InputRoot;
-- Enter SQL below this line. SQL above this line might be regenerated, causing any modifications to be lost.
DECLARE INMSG CHAR;
DECLARE HBLOB BLOB;
SET INMSG = cast(asbitstream(OutputRoot.XML,,437) as CHAR CCSID 437);
SET HBLOB = cast(asbitstream(OutputRoot.MQMD) as BLOB);
PASSTHRU('insert into TableName (sMsgHeader,sdata) values(?,?)',HBLOB,INMSG); |
|
Back to top |
|
 |
mqmaniac |
Posted: Tue Jun 27, 2006 5:21 pm Post subject: |
|
|
 Master
Joined: 27 Dec 2005 Posts: 201
|
I am doing the Opposite of this Post..
I am retrieving the data from a Database using the following code and It throws an Exception..
I am using the following code to PARSE
SET OutputRoot = InputRoot;
SET OutputRoot.XML = NULL;
DECLARE myLogDta BLOB;
CREATE FIELD OutputRoot.XML.A;
SET myLogDta = InputRoot.XML.Envelope;
CREATE FIRSTCHILD OF Environment.Variables.Temp Domain('XML') PARSE(myLogDta, 0, 37, '', '', 'XML');
SET OutputRoot.XML.A = Environment.Variables.Temp.XML;
Now The Input I have given is:
<Envelope>4C939687C4A3816E4C4F6060D1D740D4969987819540C38881A2854060606E4CC595A5859396978540A7949395A27E7F88A3A3977A6161A28388859481A24BA79493A29681974B96998761A2968197618595A58593969785617F40404040A7949395A27A8386A27E7F88A3A3977A6161A28388859481A24B838881A2854B839694618386A2617F40404040A7949395A27AA7A2897E7F88A3A3977A6161A6A6A64BA6F34B96998761F2F0F0F161E7D4D3E28388859481608995A2A3819583857F40404040A7A2897AA28388859481D3968381A38996957E7F88A3A3977A6161A28388859481A24BA79493A29681974B96998761A2968197618595A5859396978561404040404040404040404040404040404040404040404040D7A3A8D781A885E49784D998E2D6C1D74BA7A2847F6E054CC88581848599616E054CC29684A86E40404040404040404C8386A27AC88499D6998987D998D99494D4A287C799976E2540404C8386A27A888499E5859940A7949395A27A8386A27E7F88A3A3977A6161A28388859481A24B838881A2854B839694618386A2617F6EF14BF1F24C618386A27A888499E585996E2540404C8386A27A888499D998C69994C381A285C7999740A7949395A27A8386A27E7F88A3A3977A6161A28388859481A24B838881A2854B839694618386A2617F6E25404040404C8386A27A888499C7A3A6A8C799976E254040404040404C8386A27A888499D49586D699876EC6C14C618386A27A888499D49586D699876E254040404040404C8386A27A888499C7A3A6A8C1979793D5946EC5F1D7C1E8C5C54C618386A27A888499C7A3A6A8C1979793D5946E254040404040404C8386A27A888499C7A3A6A8C1979793E585996EF14BF04C618386A27A888499C7A3A6A8C1979793E585996E25404040404C618386A27A888499C7A3A6A8C799976E2540404C618386A27A888499D998C69994C381A285C799976E2540404C8386A27A888499D998C69994C995A2A3C7999740A7949395A27A8386A27E7F88A3A3977A6161A28388859481A24B838881A2854B839694618386A2617F6E25404040404C8386A27A888499E394A2A394976EF2F0F0F660F0F660F1F9E3F0F67AF3F17AF2F74BF7F6F960F0F57AF0F04C618386A27A888499E394A2A394976E25404040404C8386A27A888499D99793A8E396D8A485C9846ED8D34BD9C5C3C5C9E5C54BC6D9D6D44BC3C8C1E2C54C618386A27A888499D99793A8E396D8A485C9846E25404040404C8386A27A888499D99793A8E396D8A485D48799D5946EC6C1F1D74C618386A27A888499D99793A8E396D8A485D48799D5946E25404040404C8386A27A888499C39395A3E3A8976EC94C618386A27A888499C39395A3E3A8976E25404040404C8386A27A888499D4A287C984C799976E254040404040404C8386A27A888499E4E4C9846EF4F4F9F6F882F08660F0F0F3F0F2608284F2F860F0F0F0F0F0F0F260F2F381F4F6F685F64C618386A27A888499E4E4C9846E25404040404C618386A27A888499D4A287C984C799976E2540404C618386A27A888499D998C69994C995A2A3C799976E2540404C8386A27A888499D998E396E28599A5C7999740A7949395A27A8386A27E7F88A3A3977A6161A28388859481A24B838881A2854B839694618386A2617F6E25404040404C8386A27A888499E28599A5D799A584C2A4A2C9846EC3C8C64C618386A27A888499E28599A5D799A584C2A4A2C9846E25404040404C8386A27A888499E28599A5D799A584C2A4A2E495A3C9846EE2E5C3C9D5C74C618386A27A888499E28599A5D799A584C2A4A2E495A3C9846E25404040404C8386A27A888499E28599A5D5946ED7C1E8C5C54C618386A27A888499E28599A5D5946E25404040404C8386A27A888499E28599A5C183A38996956ED7A3A8D781A885E49784D9984C618386A27A888499E28599A5C183A38996956E25404040404C8386A27A888499E28599A5E585996EF14BF04C618386A27A888499E28599A5E585996E2540404C618386A27A888499D998E396E28599A5C799976E2540404C8386A27A888499D6998987C69994E68896C7999740A7949395A27A8386A27E7F88A3A3977A6161A28388859481A24B838881A2854B839694618386A2617F6E25404040404C8386A27A888499C5A7A3C995A3D69987C995846EC5E7E34C618386A27A888499C5A7A3C995A3D69987C995846E25404040404C8386A27A888499C2A4A2E495A3C9846EC6C1E3C1E74C618386A27A888499C2A4A2E495A3C9846E25404040404C8386A27A888499C78596D987956EE3E74C618386A27A888499C78596D987956E25404040404C8386A27A888499E4A299C799976E254040404040404C8386A27A888499D7A3A8E2A8A2D39687C9846EE4F4F0D4E7C74C618386A27A888499D7A3A8E2A8A2D39687C9846E25404040404C618386A27A888499E4A299C799976E2540404C618386A27A888499D6998987C69994E68896C799976E254C618386A27AC88499D6998987D998D99494D4A287C799976E4C8386A27AD7A3A8D781A885E49784D9986E2540404C8386A27A8193A3E49784C7999740A7949395A27A8386A27E7F88A3A3977A6161A28388859481A24B838881A2854B839694618386A2617F6E25404040404C8386A27A9781A885E49784C799976E254040404040404C8386A27A8183A3C3A3936EE44C618386A27A8183A3C3A3936E254040404040404C8386A27A9285A8C799976E2540404040404040404C8386A27A9781A885E58595C9846EF1F8F0F0F2F0F0F2F54C618386A27A9781A885E58595C9846E2540404040404040404C8386A27AA2A8A2C984C799976E25404040404040404040404C8386A27A81979793E2A8A2D5946ED9C54C618386A27A81979793E2A8A2D5946E25404040404040404040404C8386A27A81979793E2A8A2C9846EF1F8F0F2F44C618386A27A81979793E2A8A2C9846E2540404040404040404C618386A27AA2A8A2C984C799976E2540404040404040404C8386A27AA2A8A2C984C799976E25404040404040404040404C8386A27A81979793E2A8A2D5946EC8D74C618386A27A81979793E2A8A2D5946E25404040404040404040404C8386A27A81979793E2A8A2C9846ED4C5C3F0F8F94C618386A27A81979793E2A8A2C9846E2540404040404040404C618386A27AA2A8A2C984C799976E254040404040404C618386A27A9285A8C799976E254040404040404C8386A27A9781A885D7A894A3E3859994A2C799976E2540404040404040404C8386A27A97A88293C4A3C799976E25404040404040404040404C8386A27A979593A3C4A36E6060F0F760F0F74C618386A27A979593A3C4A36E2540404040404040404C618386A27A97A88293C4A3C799976E2540404040404040404C8386A27A8489A283C799976E25404040404040404040404C8386A27A8489A283C4A36E6060F0F760F0F64C618386A27A8489A283C4A36E2540404040404040404C618386A27A8489A283C799976E254040404040404C618386A27A9781A885D7A894A3E3859994A2C799976E254040404040404C8386A27A9781A885D7A894A3E3859994A2C79997616E254040404040404C8386A27A9781A885D7A894A3E3859994A2C79997616E254040404040404C8386A27A9781A885D7A894A3E3859994A2C79997616E254040404040404C8386A27A9781A885D7A894A3E3859994A2C79997616E254040404040404C8386A27A9781A885D7A894A3E3859994A2C79997616E254040404040404C8386A27A9781A885D7A894A3E3859994A2C79997616E254040404040404C8386A27A9781A885D7A894A3E3859994A2C79997616E254040404040404C8386A27A9781A885D7A894A3E3859994A2C79997616E254040404040404C8386A27A9781A885D7A894A3E3859994A2C79997616E254040404040404C8386A27A9781A885D7A894A3E3859994A2C79997616E254040404040404C8386A27A9781A885D7A894A3E3859994A2C79997616E254040404040404C8386A27A9781A885C99584C799976E2540404040404040404C8386A27A9781A885D4859496C799976E25404040404040404040404C8386A27A9781A885C68585C194A36EF0F04BF0F04C618386A27A9781A885C68585C194A36E2540404040404040404C618386A27A9781A885D4859496C799976E254040404040404C618386A27A9781A885C99584C799976E254040404040404C8386A27A81979793C4A381C5838896C799976E2540404040404040404C8386A27A85838896D998C995846EE84C618386A27A85838896D998C995846E2540404040404040404C8386A27AA58595C48586C5838896C799976E25404040404040404040404C8397997A8183A3899695C396848540A7949395A27A8397997E7F88A3A3977A6161A794934B8681998589A24B83969461E28388859481618397997F6EC34C618397997A8183A3899695C39684856E25404040404040404040404C8397997A998583969984E3A8978540A7949395A27A8397997E7F88A3A3977A6161A794934B8681998589A24B83969461E28388859481618397997F6EC1D74C618397997A998583969984E3A897856E25404040404040404040404C8397997A83A4A2A3C98440A7949395A27A8397997E7F88A3A3977A6161A794934B8681998589A24B83969461E28388859481618397997F6EF0F0F8F8F8F8F04C618397997A83A4A2A3C9846E25404040404040404040404C8397997AA4A28599C98440A7949395A27A8397997E7F88A3A3977A6161A794934B8681998589A24B83969461E28388859481618397997F6EE4F4F0D4E7C74C618397997AA4A28599C9846E25404040404040404040404C8397997AA3998195A28183A3899695C98440A7949395A27A8397997E7F88A3A3977A6161A794934B8681998589A24B83969461E28388859481618397997F6EF4F0F1F6F54C618397997AA3998195A28183A3899695C9846E2540404040404040404C618386A27AA58595C48586C5838896C799976E254040404040404C618386A27A81979793C4A381C5838896C799976E25404040404C618386A27A9781A885E49784C799976E2540404C618386A27A8193A3E49784C799976E254C618386A27AD7A3A8D781A885E49784D9986E054C61C29684A86E4C61C595A585939697856E4C61939687C4A3816E</Envelope>
The Flow is throwing Parsing Exceptions saying
"Expected an Element Name"
I get an XML Parse Exception |
|
Back to top |
|
 |
|