Multiple choice technology databases

John has created a procedure named SALARY_CALC. Which SQL query allow him to view text of procedure?

  1. SELECT text FROM user_source WHERE name = 'SALARY_CALC';

  2. SELECT * FROM user_source WHERE name='SALARY_CALC';

  3. SELECT * FROM user_objects WHERE object_name='SALARY_CALC';

  4. SELECT * FROM user_procedures WHERE object_name='SALARY_CALC';

  5. SELECT text FROM user_source WHERE name='SALARY_CALC' and owner='JOHN'

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

To view the text of a stored procedure, query USER_SOURCE with the procedure name in the NAME column and select the TEXT column. USER_SOURCE stores the source code line by line. The TEXT column specifically contains the source code lines, while USER_OBJECTS and USER_PROCEDURES contain metadata but not the actual source text.