Author |
Message
|
sweety176 |
Posted: Thu Sep 01, 2005 9:55 am Post subject: Error:Incompatible data types |
|
|
Apprentice
Joined: 24 Aug 2005 Posts: 30
|
Following is my code
When I deployed the execution grp it gave me an error saying
Incompatible data types on either side of '=' in line 24,thats where i assign the FIELDVALUE(cursor1) to the element Value1
Could someone help me figure out the problem.
DECLARE C INTEGER;
SET C = CARDINALITY(InputRoot.*[]);
DECLARE I INTEGER;
SET I = 1;
WHILE I < C DO
SET OutputRoot.*[I] = InputRoot.*[I];
SET I=I+1;
END WHILE;
-- Enter SQL below this line. SQL above this line might be regenerated, causing any modifications to be lost.
DECLARE cursor1 REFERENCE TO InputRoot.XML.Envelope.Body.DocumentUpdRqMsg."DOCUMENT_UPDATE_REQUEST"."IMAGE"."ORIGINAL_LOAN".(XML.Attribute)*;
DECLARE cursor2 REFERENCE TO InputRoot.XML.Envelope.Body.DocumentUpdRqMsg."DOCUMENT_UPDATE_REQUEST"."IMAGE"."EMBEDDED_FILE".(XML.Attribute)*;
CREATE FIELD OutputRoot.XML."SOAP-Env:Envelope";
SET OutputRoot.XML."SOAP-Env:Envelope".(XML.Attribute)"xmlns:dqrqfn" = InputRoot.XML."SOAP-Env:Envelope".(XML.Attribute)"xmlns:durq";
SET OutputRoot.XML."SOAP-Env:Envelope".(XML.Attribute)"xmlns:hrq" = InputRoot.XML."SOAP-Env:Envelope".(XML.Attribute)"xmlns:hrq";
SET OutputRoot.XML."SOAP-Env:Envelope".(XML.Attribute)"xmlns:jpmc" = InputRoot.XML."SOAP-Env:Envelope".(XML.Attribute)"xmlns:jpmc";
SET OutputRoot.XML."SOAP-Env:Envelope".(XML.Attribute)"xmlns:SOAP-Env" = InputRoot.XML."SOAP-Env:Envelope".(XML.Attribute)"xmlns:SOAP-Env";
SET OutputRoot.XML."SOAP-Env:Envelope".(XML.Attribute)"xmlns:xsi" = InputRoot.XML."SOAP-Env:Envelope".(XML.Attribute)"xmlns:xsi";
SET OutputRoot.XML."SOAP-Env:Envelope".(XML.Attribute)"xsi:schemaLocation" = InputRoot.XML."SOAP-Env:Envelope".(XML.Attribute)"xsi:schemaLocation";
--Map input header to output header
CREATE FIELD
OutputRoot.XML."SOAP-Env:Envelope"."SOAP-Env:Body"."dqrqfn:DocumentQryRqMsg"."hrq:HdrOrigRqRmmMsgGrp" FROM InputRoot.XML."SOAP-Env:Envelope"."SOAP-Env:Body"."durq:DocumentUpdRqMsg"."hrq:HdrOrigRqRmmMsgGrp";
IF InputRoot.XML.Envelope.Body.DocumentUpdRqMsg.DOCUMENT_UPDATE_REQUEST.IMAGE.*[] ='ORIGINAL_LOAN'
THEN
SET OutputRoot.XML.Envelope.Body.DocumentQryRqMsg."DOCUMENT_QUERY_REQUEST".CRITERIA."PARAM_NAME" = 'LOS_Record_Number';
WHILE LASTMOVE(cursor1) DO
SET OutputRoot.XML.Envelope.Body.DocumentQryRqMsg."DOCUMENT_QUERY_REQUEST".CRITERIA."VALUE1" = FIELDVALUE(cursor1);
END WHILE;
END IF;
IF InputRoot.XML.Envelope.Body.DocumentUpdRqMsg.DOCUMENT_UPDATE_REQUEST.IMAGE.*[] = 'EMBEDDED_FILE'
THEN
SET OutputRoot.XML.Envelope.Body.DocumentQryRqMsg."DOCUMENT_QUERY_REQUEST".CRITERIA.PARAM_NAME = 'F_DOCNUMBER';
WHILE LASTMOVE(cursor2) DO
SET OutputRoot.XML.Envelope.Body.DocumentQryRqMsg."DOCUMENT_QUERY_REQUEST".CRITERIA."VALUE1" = FIELDVALUE(cursor2);
END WHILE;
END IF;
|
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Sep 01, 2005 9:59 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Are you not trying to assign a list to a scalar?
I do not know what FIELDVALUE will return, when passed a list - which (XML.Attribute)* will return. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
sweety176 |
Posted: Thu Sep 01, 2005 11:04 am Post subject: |
|
|
Apprentice
Joined: 24 Aug 2005 Posts: 30
|
I have an integer value in my attribute but I do not know the value so I put a *
VALUE1 which is defined in the o/p as a child of element CRITERIA,
the value of the attribute LoanOriginationSystemLoanIdentifier defined in the input XML should be placed as value of VALUE1 in O/p
the i/p XML is
<DOCUMENT_UPDATE_REQUEST>
<IMAGE>
<ORIGINAL_LOAN LoanOriginationSystemLoanIdentifier="12345"/>
<EMBEDDED_FILE jpmc:EmbeddedDocumentIdentifier="12345"/>
</IMAGE>
</DOCUMENT_UPDATE_REQUEST>
the o/p XML is
<DOCUMENT_UPDATE_REQUEST>
<CRITERIA>
<PARAM_NAME>LOS_Record_number></PARAM_NAME>
<VALUE1>abc</VALUE1>
<CRITERIA>
<CRITERIA>
<PARAM_NAME>F_DOCNUMBER></PARAM_NAME>
<VALUE1>abc</VALUE1>
<CRITERIA>
so if in the input message i get ORIGINAL_LOAN then my code should set the param name to LOS_record_Number and set value 1 to 12345.
else if i get EMBEDDED_FILE it should set param name to F_DOCNUMBER and assign its value to VALUE 1 |
|
Back to top |
|
 |
mgk |
Posted: Thu Sep 01, 2005 12:04 pm Post subject: |
|
|
 Padawan
Joined: 31 Jul 2003 Posts: 1642
|
Hi,
Am I correct in assuming that the following code you posted is not the actual code are running with?
Code: |
WHILE LASTMOVE(cursor1) DO
SET OutputRoot.XML.Envelope.Body.DocumentQryRqMsg."DOCUMENT_QUERY_REQUEST".CRITERIA."VALUE1" = FIELDVALUE(cursor1);
END WHILE; |
Because if it is, you will have an infinite lopp here as you do not ever MOVE cursor1 (assuming cursor1 is ever valid before the while loop).
Can you post the actual code, and the actual error message please. _________________ MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions. |
|
Back to top |
|
 |
sweety176 |
Posted: Thu Sep 01, 2005 12:39 pm Post subject: resolved |
|
|
Apprentice
Joined: 24 Aug 2005 Posts: 30
|
Hi
Thanks for all your immediate responses.
I resolved the issue.
I removed the WHILE loop and simply assigned the values.
It wasnt working initially as my syntax for the IF statement didnt include ( )
Hope it works now.
Regards
Sweety |
|
Back to top |
|
 |
|