×
The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.
I've created many stored procedures in SQL Server, and need to create a
read stored procedure in DB2 for use in a .NET application. I'm new to
writing stored procedures on DB2. Using iSeries Navigator to create a
new stored procedure. After entering my statements, I always get this
error:
Token ; was not valid. Valid tokens: ...
Message ID: SQL0104
Cause: A syntax error was detected at token ;....
But there are no line number references or highlighting where the error
might have occurred. Any help in diagnosing this is appreciated!
The procedure reads a DDS-defined file, whose dates are CYMD numeric
7,0. Converting the transaction "date" to a date for the .NET
application.
Here are the various tabs:
General tab
Maximum number of result sets: 1
Data access: Reads SQL data
Parameters tab
FromDate CHARACTER 10 IN
ThruDate CHARACTER 10 IN
SQL Statements tab
begin
declare workfromcymd int;
declare workthrucymd int;
declare workc int;
declare workyear char(4);
declare workmonth char(2);
declare workday char(2);
/* Convert fromdate from character format MM/DD/YYYY to CYYMMDD */
set workmonth = substring(fromdate,1,2);
set workday = substring(fromdate,4,2);
set workyear = substring(fromdate,7,4);
set workc = int(workyear)-1900;
if workc < 0 then;
set workc = 0
end;
set workfromcymd = (workc * 1000000) +
(int(workyear)*10000) +
(int(workmonth)*100) +
(int(workday));
/* Convert thrudate from character format MM/DD/YYYY to CYYMMDD */
This mailing list archive is Copyright 1997-2025 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact
[javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.