sql - pls-00103 error while executing a procedure -
i trying execute procedure shell script , ending in error:
please me on this:
default_shipment_date() { log_writer "$pgm_name" "[info] $pgm_name - in default_shipment_date function" sqlplus -s $ctgauth_login/$ctgauth_pwd@$ctgauth_tnsnames <<-eof >> $log_dir/${pgm_name}_${today}.log 2> $log_dir/${pgm_name}_${today}.err set serveroutput on begin execute default_shipment_date(); end; / exit eof log_writer "$pgm_name" "[info] $pgm_name - exiting default_shipment_date function" }
the error message show below:
thu jul 2 03:24:39 edt 2015) - [info] ctg_new_prds - in default_shipment_date function execute default_shipment_date(); * error @ line 2: ora-06550: line 2, column 9: pls-00103: encountered symbol "default_shipment_date" when expecting 1 of following: := . ( @ % ; immediate symbol ":=" substituted "default_shipment_date" continue.
you not need use "execute" statement within pl/sql.
if need use pl/sql (including context switch sql) code should this:
default_shipment_date() { log_writer "$pgm_name" "[info] $pgm_name - in default_shipment_date function" sqlplus -s $ctgauth_login/$ctgauth_pwd@$ctgauth_tnsnames <<-eof >> $log_dir/${pgm_name}_${today}.log 2> $log_dir/${pgm_name}_${today}.err set serveroutput on begin default_shipment_date(); end; / exit eof log_writer "$pgm_name" "[info] $pgm_name - exiting default_shipment_date function" }
however, why switch pl/sql @ all, execute procedure sql environment:
default_shipment_date() { log_writer "$pgm_name" "[info] $pgm_name - in default_shipment_date function" sqlplus -s $ctgauth_login/$ctgauth_pwd@$ctgauth_tnsnames <<-eof >> $log_dir/${pgm_name}_${today}.log 2> $log_dir/${pgm_name}_${today}.err set serveroutput on execute default_shipment_date(); exit eof log_writer "$pgm_name" "[info] $pgm_name - exiting default_shipment_date function" }
n.b. assumes shell script correct etc.
hope helps, ollie
Comments
Post a Comment