using text variables in spl routines
Posted in 2001
Topics: Stored Procedures & SPL
hi,
I've got some problem when using text variable in SPl routines :
example:
create table_test (
txt1 text
) ;
create procedure test ( test char(1) )
DEFINE my_text references text;
.....
.....
LET my_text = ' test ';
insert into table_test ( txt1 )
values ( my_text ) ;
END PROCEDURE
This will abort because of data casting problem .....
Does someone have a solution ........ ??
hubert imhoff
Imhoff Hubert wrote:
> I've got some problem when using text variable in SPl routines :
> example:
>
> create table_test (
> txt1 text
> ) ;
>
> create procedure test ( test char(1) )>
> DEFINE my_text references text;
>
> .....
> .....
>
> LET my_text = ' test ';
>
> insert into table_test ( txt1 )
> values ( my_text ) ;>
> END PROCEDURE
>
> This will abort because of data casting problem .....
>
> Does someone have a solution ........ ??
There isn't a solution I know of, short of writing more UDRs to provide
the conversion from LVARCHAR to TEXT. There is very, very little you
can usefully do with a BYTE or TEXT reference inside SPL. Actually, I
am struggling to think of *anything* you can do other than accept values
and insert them into the database or collect them from the database and
return them to the caller.
--
Yours,
Jonathan Leffler (Jonathan.Leffler@Informix.com) #include <disclaimer.h>
Guardian of DBD::Informix v1.00.PC1 -- http://www.perl.com/CPAN
"I don't suffer from insanity; I enjoy every minute of it!"