DEA-C02 · Question #106
DEA-C02 Question #106: Real Exam Question with Answer & Explanation
Sign in or unlock DEA-C02 to reveal the answer and full explanation for question #106. The question stem and answer options stay visible for context.
Question
The following stored procedure has been created to load orders for a single date into a target table: create or replace procedure uspLoadOrdersByDate () returns string language javascript execute as owner as ' sqlCmd = `INSERT INTO ORDERS_BY_DATE_TGT SELECT * FROM ORDERS_BY_DATE WHERE O_ORDERDATE = $dateToProcess`; sqlStmt = snowflake.createStatement({sqlText: sqlCmd}); res = sqlStmt.execute(); res.next(); return res.GetColumnValue(1); '; Upon executing the following statements, the following error is returned: set dateToProcess = '2020-08-02'; call uspLoadOrdersByDate(); Execution error in store procedure USPLOADORDERSBYDATE: Use of session variable '$DATETOPROCESS' is not allowed in owners rights stored procedure At Statement.execute, line 4 position 14 Making what changes will allow the procedure to execute successfully? (Choose two.)
Options
- AChange the procedure to CALLER.
- BCreate a scheduled task to execute the procedure each day, and set dateToProcess =
- CModify the body of the procedure to cast $dateToProcess to DATE within the WHERE clause of
- DChange the procedure to accept $dateToProcess as an input parameter so that no session
- ERename the session variable to upper case to allow the procedure to read from it.
Unlock DEA-C02 to see the answer
You've previewed enough free DEA-C02 questions. Unlock DEA-C02 for full answers, explanations, the timed quiz mode, progress tracking, and the master PDF. Question stem and options stay visible so you can still see what's on the exam.