Answers

Question and Answer:

  Home  SQL

⟩ Read the following code 2

CREATE OR REPLACE FUNCTION get_budget(v_studio_id IN NUMBER)

RETURN number IS

v_yearly_budget NUMBER;

BEGIN

SELECT yearly_budget

INTO v_yearly_budget

FROM studio

WHERE id = v_studio_id;

RETURN v_yearly_budget;

END;

Which set of statements will successfully invoke this function within SQL*Plus?

1. VARIABLE g_yearly_budget NUMBER

EXECUTE g_yearly_budget := GET_BUDGET(11);

2. VARIABLE g_yearly_budget NUMBER

EXECUTE :g_yearly_budget := GET_BUDGET(11);

3. VARIABLE :g_yearly_budget NUMBER

EXECUTE :g_yearly_budget := GET_BUDGET(11);

4. VARIABLE g_yearly_budget NUMBER

31. CREATE OR REPLACE PROCEDURE update_theater

32. (v_name IN VARCHAR v_theater_id IN NUMBER) IS

33. BEGIN

34. UPDATE theater

35. SET name = v_name

36. WHERE id = v_theater_id;

37. END update_theater;

 145 views

More Questions for you: