Hi,
I have following script which calls sql to create staging table like t1_rpt_1day_stg,t1_rpt_7day_stg
The following line has '' and causing all data in directory to show up in email notification but if I give all column names then it works,
Please let me know how to use '' instead of giving all column names.
'create table t1_rpt_<parameterized>_stg as select * from t1_rpt_tmt'
--shell script
load_data_to_oracle()
{
# truncate or create stage table first
${ORACLE_HOME}/bin/sqlplus ${ORACLE_USER}/${ORACLE_PASSWD}@${ORACLE_SID} << EOF > ${TMP_LOG_FILE} 2>&1
set serveroutput on
@${CREATE_STAGE_SQL}
COMMIT;
QUIT;
EOF
## Function Main
# variables
CREATE_STAGE_SQL=${SQL_DIR}/stage_create.sql
load_data_to_oracle
exit 0
---sql to create staging table
stage_create.sql
declare
v_sql_string varchar2(4000);
begin
# some code
execute immediate 'create table t1_rpt_<parameterized>_stg as select * from t1_rpt_tmt';
#some error checking
end;
thanks, actually requirement is to call different environment in same
shell script that is why I am giving path names here and using config file to keep all these parameter values.
---------- Post updated at 06:32 AM ---------- Previous update was at 06:28 AM ----------
thanks much, problem is after creation of stage table is successfully completed; a email generates (mail -s) and contents of that email has all the sqls from above query (which is fine) but the '*' causing list of directorties/files in folder to show up in the email content too.