RE: LENGTH() in stored procedure
Posted in 1997
I think the problem is that you can't use variable indexes in the substring operator [ ]. As someone else has replied yet, you better use the TRIM() function here. Frido ------------------------------------------------------------------------ - Frido van Orden FAA Partners BV Planetenbaan 117 3606 AK Maarssen The Netherlands Phone: +31-346-587076 Fax: +31-346-587086 Email: fridoo@faapartners.com ------------------------------------------------------------------------ - } -----Original Message----- } From: Nagesh Daliparthy [SMTP:nagesh.daliparthy@prudential.com] } Sent: Wednesday, December 17, 1997 11:31 PM } To: informix-list@rmy.emory.edu } Subject: LENGTH() in stored procedure } } } } I want to retrieve some data from a table , convert all into string, } concatinate with a delimiter and return only one CHAR variable c_2000 } of } declared size of 2000. } } I new when I store one character the c_2000 will be padded with spaces } upto } 2000. So I tried as follows } } LET c_2000 = c_2000[1, LENGTH(c_2000)] || "|" || "some text" ; } } AND } } LET p_len = LENGTH(c_2000); } LET c_2000 = c_2000[1, p_len] || "|" || "some text" ; } } AND } } SELECT c_2000[1, LENGTH(c_2000)] || "|" || "some text" } FROM systables } WHERE tabname = "tabname" } } While creating the procedure I got error 201 at character position } pointing } to LENGTH or p_len as the case may be. } } Can any one explain why the error 201 is coming? } } Thank you, } } Nagesh } }