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

The USER_SOURCE view contains the source code for stored objects owned by the current user. The TEXT column specifically holds the code text. Option A correctly filters by name and selects the text column. Option B retrieves all columns but still works. Option C queries USER_OBJECTS which only contains metadata about objects, not their source code. Option D queries USER_PROCEDURES which is also a metadata view. Option E incorrectly adds an OWNER filter to USER_SOURCE, but this view only shows objects owned by the current user.