SQL

HI EXPERTS
select 'iamtechnical & good Morning' from dual

if i execute the above line sql server or toad, a window is popping up for &, to input value.
how to get read of & and : in toad, if it is in a string

iamtechnicalAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
HainKurtConnect With a Mentor Sr. System AnalystCommented:
or this

set define ':';
select 'iamtechnical & good Morning' from dual where 1=:x;

it will ask for :x but not &good
0
 
HainKurtSr. System AnalystCommented:
set scan off;
select 'iamtechnical & good Morning' from dual;

and run as script
0
 
HainKurtSr. System AnalystCommented:
in toad options, "execute/Compile" there is an option
"Prompt for substitution variables" uncheck that one and run with F9
0
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

 
iamtechnicalAuthor Commented:
@hainkurt

if i run set scan off, i would not be able to call variables when ever necessary

and if i uncheck the box, it will entirely take out the option of SCANNING variables, which i dont want

select 'iamtechnical & good Morning' from dual
where :in_date <= sysdate

in the above line i get two promts
1 for &
1 for :

but i need the : promt not the &

0
 
HainKurtSr. System AnalystCommented:
try

set define on;
set esc '\';
select 'iamtechnical \& good Morning' from dual;
0
 
HainKurtSr. System AnalystCommented:
or what about this


select 'iamtechnical '|| '&' || ' good Morning' from dual where 1=:x;

it will ask for :x but no other prompt...
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.