on 02-22-2013 6:26 AM
Dear Experts,
I want to use string functions for variables, i.e., I would have the string stored in a local nvarchar variable and this is what I would pass for string manipulations.
I tried this in the SQL editor and it gives me errors.
Select 'Hello' as str from dummy;
SELECT LEFT (:str, 1) "left" FROM DUMMY;
It says feature not supported.
Mostly, I want to use functions like :
c1 := select substr(:spl_char, 1, 1) from dummy;
select replace(:help_string, ' ', :c1) from dummy;
The idea is to use the string as an array... Is there a better way?
Please suggest.
Thanks alot for helping so far!!
Arpita
Hi Arpita,
I don't think SQL editor will identify the variable. There is no way to declare it in SQL editor. So in SQL editor LEFT / substr / replace will work on actual values.
This will work in SQL script. Secondly in SQL script you don't need to perform a SELECT from dummy. You can use the string functions directly.
Regards,
Ravi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
83 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.