Author |
Message
|
elvis_gn |
Posted: Fri Oct 08, 2004 6:25 am Post subject: What is the Error....Cant figure it out |
|
|
 Padawan
Joined: 08 Oct 2004 Posts: 1905 Location: Dubai
|
I am getting warnings on the marked lines...I have a table with name VISA and its column is VISASTATUS,VISAID,EXPIRYDATE....
CREATE PROCEDURE Visa_DetailsMessage() BEGIN
DECLARE MyDate date CURRENT_DATE;
DECLARE I INTEGER 0;
[b]IF InputBody.Accept = 1 THEN[/b]
[b]UPDATE Database.VISA SET VISASTATUS = 'ACCEPT' WHERE VISA.VISAID = 0;[/b]
SET OutputRoot.XML.Visa_Details.Update = 1;
SET OutputRoot.XML.Visa_Details.New_Visa.Visa_Id = I+1;
[b]UPDATE Database.VISA SET VISA.VISAID = I;[/b]
[b]UPDATE Database.APPFORM SET VISAID = I;[/b]
SET OutputRoot.XML.Visa_Details.New_Visa.Issued_Date = MyDate;
[b]UPDATE Database.VISA SET ISSUEDATE = MyDate WHERE VISA.VISAID = 0;[/b]
[b]UPDATE Database.VISA SET EXPIRYDATE = MyDate WHERE VISA.VISAID = 0;[/b]
ELSEIF InputBody.Reject = 1 THEN
[b]UPDATE Database.VISA SET VISASTATUS = 'REJECT' WHERE VISA.VISAID = 0;[/b]
ELSE
UPDATE Database.VISA SET VISASTATUS = 'CANCEL';
END IF;
END; |
|
Back to top |
|
 |
elvis_gn |
Posted: Fri Oct 08, 2004 6:35 am Post subject: |
|
|
 Padawan
Joined: 08 Oct 2004 Posts: 1905 Location: Dubai
|
Sorry forgot to mention that the input is an XML file
<Visa_Result>
<Accept>1</Accept>
<Reject>0</Reject>
<Cancel>0</Cancel>
</Visa_Result> |
|
Back to top |
|
 |
waugh |
Posted: Fri Oct 08, 2004 6:54 am Post subject: |
|
|
 Master
Joined: 19 Feb 2004 Posts: 225
|
i think
UPDATE Database.VISA
needs to be
UPDATE Database.yourschemaname.VISA
or
you can directly say
UPDATE yourschemaname.VISA...
If you still see the warnings, ignore and run in debug and post your exception here. |
|
Back to top |
|
 |
elvis_gn |
Posted: Fri Oct 08, 2004 7:05 am Post subject: |
|
|
 Padawan
Joined: 08 Oct 2004 Posts: 1905 Location: Dubai
|
I tried it,it did not work.
I tried putting the SET commands before the IF loop and they work.
So could someone tell me why its not passing the loop statement ???? |
|
Back to top |
|
 |
jefflowrey |
Posted: Fri Oct 08, 2004 7:07 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
The syntax of your UPDATE statement is not correct.
You always need to use an AS clause when using SELECT, INSERT, or UPDATE in ESQL. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
JT |
Posted: Fri Oct 08, 2004 7:17 am Post subject: |
|
|
Padawan
Joined: 27 Mar 2003 Posts: 1564 Location: Hartford, CT.
|
Also the following statement is coded incorrectly:
Code: |
IF InputBody.Accept = 1 THEN |
should be:
Code: |
IF InputBody.Visa_Result.Accept = '1' THEN |
Quote: |
I am getting warnings on the marked lines |
Provide the details of the warnings. |
|
Back to top |
|
 |
waugh |
Posted: Fri Oct 08, 2004 7:17 am Post subject: |
|
|
 Master
Joined: 19 Feb 2004 Posts: 225
|
InputBody.Accept
try
InputRoot.XML.Visa_Result.Accept
or
InputBody.Visa_Result.Accept
instead |
|
Back to top |
|
 |
kirani |
Posted: Fri Oct 08, 2004 10:50 pm Post subject: |
|
|
Jedi Knight
Joined: 05 Sep 2001 Posts: 3779 Location: Torrance, CA, USA
|
jefflowrey wrote: |
You always need to use an AS clause when using SELECT, INSERT, or UPDATE in ESQL. |
It's not necessary to use AS clause. You can prefix the field names with table names. For example,
Code: |
SET Environment.Variables.MyRows[] = (SELECT myTable.Field1 from Database.MySchema.myTable );
|
_________________ Kiran
IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries
|
|
Back to top |
|
 |
|