Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Datatype Conversion In SPL

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I'm having trouble converting datatypes (CHAR to INTEGER, DATE to CHAR, etc.) in SPL. I've tried using the CAST function but get the error:
SPL2001:E(L25), Undefined symbol 'CAST'.
I'm assuming this means that this function isn't supported in SPL.
Is there another way to convert datatypes?
 
Hi,
It appears there is a bug in 4.0.x Stored procedure related to Cast. here is an example program our developer gave me....

replace procedure spp (inout i int)
begin
set i= cast (9 as int);
end;


it works on the latest version 4.1.0, but fails on 4.0.2. She is looking at this to see if this is a known problem.

Another example which should work is

set c=cast(Current_date as char(6));

this internally get translasted to

sel cast(current_date as varchar(6)) into :c from rs;

or something like that. So maybe if you can write the SQL then that will help give you the correct syntax for the SPL syntax.

However unless we can find the problem in 4.0.x I can only suggest upgrading to 4.1 to allow cast to work.

I strongly suggest upgrading to 4.1 anyway, but I was the release architect for 4.1 so my opinion might be a little biased.

Like I offered above send me your SPL and I will see if there is a way to do what you want to do.

--
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top