Complete the code to execute a dynamic SQL query stored in the variable.
EXECUTE [1];The EXECUTE command runs the SQL command stored in the variable query_string. You do not put quotes around the variable name.
Complete the code to build a dynamic SQL query that selects all columns from a table named in the variable.
query_string := 'SELECT * FROM ' || [1] || ';';
To build the query, concatenate the variable table_name without quotes so the table name is inserted dynamically.
Fix the error in the dynamic SQL execution by completing the code.
EXECUTE [1] USING user_id;The variable query_string should be passed directly to EXECUTE. The query string itself should already contain the placeholder $1 for the parameter.
Fill both blanks to create a dynamic SQL query that selects a column and table dynamically.
query_string := 'SELECT ' || [1] || ' FROM ' || [2] || ';';
Use the variables column_name and table_name directly to build the query dynamically without quotes.
Fill all three blanks to build and execute a dynamic SQL query with a parameter.
query_string := 'SELECT * FROM ' || [1] || ' WHERE ' || [2] || ' = $1'; EXECUTE [3] USING param_value;
Use the variables table_name and column_name to build the query string, then execute the query_string with the parameter param_value.