question

OracleApprender avatar image
OracleApprender asked

What is the significance of the & and && operators in PL SQL ?

Signficance of the operators & and && in PLSQL.? Thank you in advance.

oracletoolssqlplus
1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Christian13467 avatar image Christian13467 commented ·
There is no & and && operator in plsql. Never seen before.
0 Likes 0 ·
HillbillyToad avatar image
HillbillyToad answered

If you mean in SQL*Plus, then & and && are for substitution variables. If you use a single & then the value will be prompted for each time it's encountered. IF you use && then the original substitution value is used for the duration of the script

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

OracleApprender avatar image
OracleApprender answered

The & operator means that the PL SQL block requires user input for a variable. The && operator means that the value of this variable should be the same as inputted by the user previously for this same variable.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

KillerDBA avatar image
KillerDBA answered

It's actually part of SQL*Plus - sort of a macro thing. Take a look at this:

SQL*Plus Helps

It allows you to - sort of - define a macro that prompts for values to be searched when you execute a particular statement.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.