In: Computer Science
Explain the function/purpose of the following section of the script
-- Set environment variables
SET FEEDBACK OFF
SET HEADING OFF
SET VERIFY OFF
Explain the function/purpose of the following section of the script
PROMPT ********** Create New Order **********
PROMPT
SELECT 'Date: ', TO_CHAR(SYSDATE,'MM/DD/YYYY') FROM DUAL;
PROMPT
Explain the function/purpose of the following section of the script
DEFINE v_cus_lname = 'Customer Not Found'
DEFINE v_cus_fname = 'Customer Not Found'
DEFINE v_cus_phone = 'N/A'
Explain the function/purpose of the following section of the script
ACCEPT v_cus_code NUMBER FORMAT 99999 PROMPT 'Enter Customer Code (format 99999): '
SET FEEDBACK OFF: FEEDBACK setting controls whether SQL*Plus displays the number of records returned by a select statement, deleted by a delete statement, updated by an update statement or inserted by an insert statement. we can set a threshold below which we do not get any feedback. FEEDBACK OFF means SQL*Plus won't let you know how many rows are affected by SQL statements you have issued.
SET HEADING OFF : heading setting controls printing of column heading in reports. HEADING OFF does not affect the column width display but suppressed the printing of column header.
SET VERIFY OFF : VERIFY setting controls whether to list the text of SQL statement or PL/SQL command before and after replacing substitution variables with values OFF suppresses the listing.
PROMPT: this helps to represent the text of the message you want to display. You can use this command to give information to user.
DEFINE: This command allows user to explicitly create user variables and assigns it an initial value. DEFINE also lets you list all currently defines variables with their values. Explain the function/purpose of the following section of the script.
ACCEPT v_cus_code NUMBER FORMAT 99999 PROMPT 'Enter Customer Code (format 99999): '-->To get input from the user is to explicitly prompt for values using the ACCEPT and PROMTPT commands. The ACCEPT COMMAND takes input from the user and stores it in a user variable and allows us some level of control over what the user enters. PROMPT command may be used to display messages to the user.