Exam 1z0-071 All QuestionsBrowse all questions from this exam
Question 12

Examine this query:

Which two methods should you use to prevent prompting for a hire date value when this query is executed? (Choose two.)

    Correct Answer: A, F

    To prevent prompting for a hire date value when the query is executed, you can use two methods: using the DEFINE command before executing the query or storing the query in a script and passing the substitution value to the script when executing it. The DEFINE command allows you to specify a value for the substitution variable beforehand, so the query does not prompt for it. Storing the query in a script and passing the substitution value to the script allows you to provide the value once when executing the script, preventing further prompts.

Discussion
tangerine141Options: BF

B. By replacing '&1' with '&&1' in the query, it creates a double-ampersand substitution variable which will remember the value of the variable throughout the session and will not prompt for a value every time it is used. F. By storing the query in a script and passing the substitution value to the script when executing it, you can provide a value for the variable before the query is executed. This prevents the query from prompting for a value when it is executed.

Rik92Options: AF

AF are correct. B will promt once, but question asks for no prompting at all C. UNDIFINE is not a thing D/E Verify has nothing to do with prompting

J4viOptions: AF

It's confusing, if you replace &1 with &&1 it would still be asking for the value every time you run the query, it doesn't make sense to me... but if you previously used DEFINE to define that variable, it wouldn't. That's why I think AF is more accurate

ArslanAltafOptions: AF

B cannot be an option because the question says "Prevent prompting of hire date value". && will still prompt it once.

yanoolthecoolOptions: AB

Still cant get why F is the answer, it literally says 'pass a value', doesnt that translate to prompting the user? as for B, && does an implicit DEFINE on first value entered via the prompt, but if it was already defined then it will just use the value that was already defined, I say AB.

yanoolthecool

looking this up was a bit difficult, but GPT says as I say.

winston

Why is B not correct?..and someone explain how o store a query in a script, i cant get the concept..

Lee_jong_suk

vi sql_script.sql select * from employees where employee_id = '&1'; to execute the file -> @sql_script.sql then it will prompt for value -> Enter value for 1:101 here you can enter whatever id you want. These are used to generate reports for debugging.

Orxan_H

Why not B?

ninjax_m

https://www.oreilly.com/library/view/oracle-sqlplus-the/1565925785/ch04s06.html#:~:text=The%20UNDEFINE%20command%20deletes%20a,it%20is%20no%20longer%20needed. The UNDEFINE command deletes a variable definition. If you have created a variable containing sensitive information, such as a password,...

dexdinh91Options: AF

There is no UNDEFINE keyword