Special characters in SQL insert & select stmt. [message #375168] |
Thu, 02 August 2001 02:13 |
mohan
Messages: 16 Registered: August 2001
|
Junior Member |
|
|
Hi,
I need to insert special characters like ( ' & % ) into a varchar2 field. I also need to search for the field to consist of these special characters (using the like clause of the select statement). Please do help me.
Thank you for your time, effort and knowledge.
|
|
|
|
Re: Special characters in SQL insert & select stmt. [message #375182 is a reply to message #375168] |
Thu, 02 August 2001 15:49 |
andrew again
Messages: 2577 Registered: March 2000
|
Senior Member |
|
|
select column_name from cols
where column_name like '%\_%' escape '\';
SQL> set escape '/'
SQL> insert into t1(col1) values('valuewith/&')
SQL> select * from t1;
COL1
------
valuewith&
OR
set scan off
OR
change the variable substitution character to something else e.g.
set scan on
set define '~'
-- % = chr(37)
-- _ = chr(95)
SELECT * FROM table_name
WHERE INSTR(column_name,CHR(37)) > 0;
SELECT * FROM table_name
WHERE INSTR(column_name,CHR(95) > 0;
|
|
|