Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Assigning the value to VARCHAR variable with special characters

Naveed_CGJun 21 2012 — edited Jun 22 2012
Hi Gurus,


In declare section I have

sql_text VARCHAR2(500);

in procedure body

I have to assign the variable sql_text =' SELECT TO_CHAR (MAX (A.START_DATE_TIME), 'MMYY')
FROM
JTF_IH_ACTIVITIES A, JTF_IH_INTERACTIONS B WHERE A.INTERACTION_ID =
B.INTERACTION_ID AND B.PARTY_ID = :B1 AND A.ACTION_ITEM_ID = (SELECT
ACTION_ITEM_ID FROM JTF.JTF_IH_ACTION_ITEMS_TL WHERE UPPER (ACTION_ITEM) =
'LETTER') AND A.ACTION_ID = (SELECT ACTION_ID FROM JTF.JTF_IH_ACTIONS_TL
WHERE UPPER (ACTION) = 'SENT')'


the due to the special character like ( , ' = : ) I am not able to assign the above sql to the sql_text variable. Can someone please help how I can pass above SQL statement as varchar variable.


Thanks
Naveed
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 20 2012
Added on Jun 21 2012
12 comments
3,418 views