Passing SQL Query as parameter issues

Hi,
I am trying to pass a SQL query as parameter which passed through servaral forms and get executed in final object say control. the reason it goes is to get modified in between based on serval conditions and finally it takes Key value and update the recore.
In the below example [v_key] identified at the end control where sql get executed…!

when I pass sql query it goes fine…

Update PCC_master set status=‘R’ where pcc_slno=[v_key]

the problem i am facing is

  1. Single quotes (’) is changed to ’ and corrupts the query
  2. The [v_key] is locally changed which is not reflected as value in the end control or form

I had found that to pass single quote the escape sequence to be used ‘’ and when i pass it is changed to ‘\’ and still found corrupted…?!

anybody has ideas

Thanks

DHana

Re: Passing SQL Query as parameter issues

If I directly echo with escape sequnese it is working fine… like
echo ‘It’s great and Neat!’

Output : It’s great and Neat!

If the same thing is passed as variable, it becomes
Output : It’s great and Neat!’

I suspect it may be Bug…?!

Regards
Dhana