How to delete last char in string?
Posted in 1995
Here is an SQL puzzle for everyone: We need to trim the last character from a variable length parameter that is passed into an SPL stored procedure. We have tried setting a variable len as: let len = length(v_parm_name) - 1; let v_short_parm_name = v_parm_name[1, len]; On the second line we get a syntax error on len. I have run into the same problem with a regular SQL statement such as: select col1[1, LENGTH(col2)] from table1; Any ideas on how to solve this problem? If you can think of any way to do, please send your ideas. We could write this in SQL, SPL, 4GL, etc. or if we had to, call a C program. Thanks in advance, John Powell ________________________________________________________________________ | John Powell | | Hewlett-Packard Company Phone: 503-715-8389 | | Inkjet Supplies Business Unit Fax: 503-715-2283 | | 1040 NE Circle Blvd. E-mail: jpowell@cv.hp.com | | Corvallis, OR 97330-4200 | | MS: 633A | ------------------------------------------------------------------------