If guess D is a trap. If you use DEFINE and you're not using the variable, it'll never be displayed with SET VERIFY ON.
Example :
set verify on
DEFINE dummy_char = 'X'
SELECT * FROM dual
The SET VERIFY ON command will enable the display of any substitution variable used in our last executed SQL statement. When you use the DEFINE clause to create a variable, and the variable is not used in the next SQL statement then that variable will not be "shown" by the SET VERIFY command. Oh, and the command is available in all apps that allow the execution of SQL language against your database.
C,E. D is not correct because 'define' as a individual command will not trigger the prompt. Only when defined variable is used with & or && the verify on thing will take effect.
E - It works on && prefixed variables:
SQL> set verify off
SQL> select employee_id from hr.employees where employee_id =&&emp;
Immettere un valore per emp: 200
EMPLOYEE_ID
-----------
200
SQL> undefine emp
SQL> set verify on
SQL> select employee_id from hr.employees where employee_id =&&emp;
Immettere un valore per emp: 200
vecchio 1: select employee_id from hr.employees where employee_id =&&emp
nuovo 1: select employee_id from hr.employees where employee_id =200
EMPLOYEE_ID
-----------
200
So, either there are 3 answers instead of (and different from) the 2 suggested, or I'm seriously missing something here.
Simone, you are missing something here! SET VERIFY does not display values for variables created by the DEFINE command, it shows the corresponding values of the variables we are currently using. If you don't use the create by define variable, you won't be able to see the value of DEFINE.
D - It works for variables created via DEFINE:
SQL> set verify off
SQL> define emp = 200;
SQL> select employee_id from hr.employees where employee_id = &emp;
EMPLOYEE_ID
-----------
200
SQL> set verify on
SQL> select employee_id from hr.employees where employee_id = &emp;
vecchio 1: select employee_id from hr.employees where employee_id = &emp
nuovo 1: select employee_id from hr.employees where employee_id = 200
EMPLOYEE_ID
-----------
200
Answer: C + ¿D or E?
SQL> set verify on
SQL> select &&x from dual;
Enter value for x: dummy
old 1: select &&x from dual
new 1: select dummy from dual
D
-
X
SQL> set verify on
SQL> define y='dummy';
SQL> select &y from dual;
old 1: select &y from dual
new 1: select dummy from dual
D
-
X
i agree, E is working:
SQL> set verify off
SQL> select &&var from dual;
Geben Sie einen Wert fur var ein: sysdate
SYSDATE
--------
04.08.20
SQL> set verify on
SQL> select &&var from dual;
alt 1: select &&var from dual
neu 1: select sysdate from dual
SYSDATE
--------
04.08.20
why not E?
SET VERIFY ON
UNDEFINE dummy_number;
SELECT employee_id, job_id FROM employees where EMPLOYEE_ID = &&dummy_number;
-- working, he just asks for an input (like 206)
i agree with C, but unsure between D and E
E is wrong… look at below example, the variable was disaplyed even without using set verify on!
SQL> SELECT owner , TABLE_NAME FROM DBA_TABLES where table_name = '&&dummy_number';
Geben Sie einen Wert fur dummy_number ein: DUAL
alt 1: SELECT owner , TABLE_NAME FROM DBA_TABLES where table_name = '&&dummy_number'
neu 1: SELECT owner , TABLE_NAME FROM DBA_TABLES where table_name = 'DUAL'
OWNER
--------------------------------------------------------------------------------
TABLE_NAME
--------------------------------------------------------------------------------
SYS
DUAL
that's because SET VERIFY ON is the default. If you don't specify SET VERIFY OFF it will use SET VERIFY ON
upvoted 3 times
...
...
...
Log in to ExamTopics
Sign in:
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
danito
Highly Voted 4 years agoelbelgounetos
3 years, 3 months agoantonica
2 months, 3 weeks agoFranky_T
Highly Voted 2 years, 2 months agoAbdullejr
Most Recent 4 days, 15 hours agoRaNik69
1 year, 1 month agoJ4vi
1 year, 1 month agoivanadj
1 year, 3 months ago[Removed]
1 year, 5 months agoryuah
2 years, 5 months agoyukclam9
3 years, 2 months agoSimoneF
3 years, 6 months agoSimoneF
3 years, 6 months agoGuhborges
2 years, 7 months agoSimoneF
3 years, 6 months agoSimoneF
3 years, 6 months agoesarregui
3 years, 7 months agoChansi
3 years, 10 months agoadoptc94
3 years, 9 months agoyou1234
3 years, 10 months agoama
3 years, 10 months agoNowOrNever
3 years, 10 months agoama
3 years, 10 months agoadoptc94
3 years, 9 months ago