Author |
Message
|
cvag |
Posted: Fri Jul 29, 2011 3:29 am Post subject: HttpRequest Identifier casting error |
|
|
Centurion
Joined: 17 Mar 2008 Posts: 127
|
Hi,
Can anyone please help me, in CASTING the HttpRequest Identifier to CHAR.
Am stuck with CASTING error
Am coding:
SET Environment.variable.identifier = CAST(InputLocalEnvironment.Destination.HTTP.RequestIdentifier AS CHARACTER CCSID InputRoot.Properties.CodedCharSetId ENCODING InputRoot.Properties.Encoding);
Where CCSID and ENCODING are the values of windows and taking the values from the property.
Suggest pls
Thanks in Advance |
|
Back to top |
|
 |
vmcgloin |
Posted: Fri Jul 29, 2011 4:17 am Post subject: |
|
|
Knight
Joined: 04 Apr 2002 Posts: 560 Location: Scotland
|
What error does it give you?
And, why is your requirement to cast as character? |
|
Back to top |
|
 |
cvag |
Posted: Fri Jul 29, 2011 4:54 am Post subject: |
|
|
Centurion
Joined: 17 Mar 2008 Posts: 127
|
To log the HttpRequest IdentifIer into table (Datatype is CHARACTER)
Code: |
ExceptionList
RecoverableException
File:CHARACTER:F:\build\S610_P\src\DataFlowEngine\ImbDataFlowNode.cpp
Line:INTEGER:957
Function:CHARACTER:ImbDataFlowNode::createExceptionList
Type:CHARACTER:ComIbmWSInputNode
Name:CHARACTER:Test_Http#FCMComposite_1_1
Label:CHARACTER:Test_Http.HTTP Input
Catalog:CHARACTER:BIPv610
Severity:INTEGER:3
Number:INTEGER:2230
Text:CHARACTER:Node throwing exception
RecoverableException
File:CHARACTER:F:\build\S610_P\src\DataFlowEngine\ImbComputeNode.cpp
Line:INTEGER:464
Function:CHARACTER:ImbComputeNode::evaluate
Type:CHARACTER:ComIbmComputeNode
Name:CHARACTER:Test_Http#FCMComposite_1_3
Label:CHARACTER:Test_Http.Compute
Catalog:CHARACTER:BIPv610
Severity:INTEGER:3
Number:INTEGER:2230
Text:CHARACTER:Caught exception and rethrowing
RecoverableException
File:CHARACTER:F:\build\S610_P\src\DataFlowEngine\ImbRdl\ImbRdlStatementGroup.cpp
Line:INTEGER:602
Function:CHARACTER:SqlStatementGroup::execute
Type:CHARACTER:ComIbmComputeNode
Name:CHARACTER:Test_Http#FCMComposite_1_3
Label:CHARACTER:Test_Http.Compute
Catalog:CHARACTER:BIPv610
Severity:INTEGER:3
Number:INTEGER:2488
Text:CHARACTER:Error detected, rethrowing
Insert
Type:INTEGER:5
Text:CHARACTER:.Test_Http_Compute.Main
Insert
Type:INTEGER:5
Text:CHARACTER:6.3
Insert
Type:INTEGER:5
Text:CHARACTER:SET Environment.variable.identifier = CAST(InputLocalEnvironment.Destination.HTTP.RequestIdentifier AS CHARACTER CCSID InputRoot.Properties.CodedCharSetId ENCODING InputRoot.Properties.Encoding);
RecoverableException
File:CHARACTER:F:\build\S610_P\src\DataFlowEngine\ImbRdl\ImbRdlTypeCast.cpp
Line:INTEGER:257
Function:CHARACTER:SqlTypeCast::evaluate
Type:CHARACTER:
Name:CHARACTER:
Label:CHARACTER:
Catalog:CHARACTER:BIPv610
Severity:INTEGER:3
Number:INTEGER:2521
Text:CHARACTER:Error while casting
Insert
Type:INTEGER:5
Text:CHARACTER:.Test_Http_Compute.Main
Insert
Type:INTEGER:5
Text:CHARACTER:6.42
Insert
Type:INTEGER:5
Text:CHARACTER:X'414d512042524b514d20202020202020c70d304e20064006'
Insert
Type:INTEGER:5
Text:CHARACTER:CHARACTER
RecoverableException
File:CHARACTER:F:\build\S610_P\src\CommonServices\ImbConverter.cpp
Line:INTEGER:496
Function:CHARACTER:ImbConverterCPP::internalToUnicode
Type:CHARACTER:
Name:CHARACTER:
Label:CHARACTER:
Catalog:CHARACTER:BIPv610
Severity:INTEGER:3
Number:INTEGER:2135
Text:CHARACTER:Unconvertable character
Insert
Type:INTEGER:5
Text:CHARACTER:c7
Insert
Type:INTEGER:5
Text:CHARACTER:414d512042524b514d20202020202020c70d304e20064006
Insert
Type:INTEGER:2
Text:CHARACTER:1208 |
Pls have the exceptionList[/quote] |
|
Back to top |
|
 |
mqjeff |
Posted: Fri Jul 29, 2011 5:12 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
Don't cast it as a character with a CCSID.
Cast it as a character *without* a CCSID.
This will give you "X'414d512042524b514d20202020202020c70d304e20064006' ".
Insert *that* into your database. |
|
Back to top |
|
 |
cvag |
Posted: Sun Jul 31, 2011 11:27 am Post subject: |
|
|
Centurion
Joined: 17 Mar 2008 Posts: 127
|
Thanks mqjeff..
Will try without applying CCSID. |
|
Back to top |
|
 |
lancelotlinc |
Posted: Mon Aug 01, 2011 4:23 am Post subject: |
|
|
 Jedi Knight
Joined: 22 Mar 2010 Posts: 4941 Location: Bloomington, IL USA
|
cvag wrote: |
To log the HttpRequest IdentifIer into table (Datatype is CHARACTER) |
Let's hope you are using solidDB or a Singleton to track your identifier or you will incur lots of latency waiting around for a database just for the sake of tracking your request. _________________ http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER |
|
Back to top |
|
 |
cvag |
Posted: Mon Aug 01, 2011 5:32 am Post subject: |
|
|
Centurion
Joined: 17 Mar 2008 Posts: 127
|
Hi MQJeff..
Have tried without CCSID and used just CAST to CHAR type.
Getting error with :
[IBM][CLI Driver] CLI0109E String data right truncation. SQLSTATE=22001
If i don't CAST , its allowing something to insert into table.
Where as this CCSID and ENCODING will work for MQMD MsgId, and hoping this also should work for HttpRequestIdentifier, but this is not successful.
Pls correct and suggest for my assumption.
Thanks |
|
Back to top |
|
 |
mqjeff |
Posted: Mon Aug 01, 2011 5:43 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
That means that the field is too small. You are trying to insert a hex value of the string data, which means that there are two characters for each byte in the reply identifier.
Plus the X character plus two single quote (') characters.
This is apparently more characters than your database column can have.
*You* need to *think* about this, and *determine* what you actually want to put into this column, and whether you want to put in a blob value or a character string or etc.
There are other options for doing this. But *neither* the MQMD.MsgId nor the HTTP Reply Identifier are natively *character* values, so you should *think* about how you want to store them. |
|
Back to top |
|
 |
|