Re: TEXT to VARCHAR stored procedure
Posted in 1998
Topics: Stored Procedures & SPL, Server Administration, Data Types & Schema Design
actually that doesn't work either because it's the close bracket )
on the CREATE PROCEDURE line (ie. after t TEXT NOT NULL) that
causes the syntax error. If I change from TEXT to any other type
then things are fine - except I need to convert a TEXT field
and hence need to pass it in.
I've tried it using both the SQL Editor and dbaccess.
In article <34F22196.9951A4A1@sprintmail.com>,
Martin Mburu <mmburu@sprintmail.com> wrote:
>
> Perhaps you could substitute VARCHAR with CHAR, and use the TRIM to get
> rid of any trailing blanks.
>
> CREATE PROCEDURE text2varchar(t TEXT NOT NULL) RETURNING CHAR(255);> DEFINE my_ret CHAR(255);
> DEFINE my_ret2 CHAR(255);
>
> LET my_ret = t;
> LET my_ret2 = TRIM(my_ret)
> RETURN my_ret2;
> END PROCEDURE;
>
>
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading