A person is being given a assignment to create a table using template. Suggest a option which she should select after opening ms access
Answers
HEY....
HERE'S YOUR....
HIGH RATED GABRU---HARSH ♦️♦️♦️♦️♦️♦️♦️♦️♦️♦️
You need to build a valid SQL statement in the string. And if you want to add variables into that string, you do it via concatenation or replacement.
E.g. using concatenation
declare
tableName varchar2(30);
sqlCreate varchar2(1000);
begin
tableName := 'funky_foo';
sqlCreate := 'create table '||tableName||' as select * from foo@remotedb';
-- using dbms_output to enable the display of the SQL that is about to be executed
execute immediate sqlCreate;
end;
E.g. using replacement (better option as SQL syntax is more easily readable and maintainable, and allows multiple variables to be defined in the template SQL)
declare
SQL_CREATE_TEMPLATE constant varchar2(1000) :=
'select
*
from $TABLE@remotedb';
tableName varchar2(30);
sqlCreate varchar2(1000);
begin
tableName := 'funky_foo';
sqlCreate := replace( SQL_CREATE_TEMPLATE, '$TABLE', tableName );
-- using dbms_output to enable the display of the SQL that is about to be executed
execute immediate sqlCreate;
end;
♦️♦️♦️♦️♦️♦️♦️♦️♦️♦️♦️