У меня есть процедура, определенная как:
PROCEDURE Import_Invoice
( as_Directory_Name_Invoice_Data in varchar2,
as_File_Name_Invoice_Data in varchar2,
as_Directory_Name_Invoice_Log in varchar2,
al_processid out number,
al_errnum out number,
as_errstr out varchar2 ) IS
begin
al_processid := 123;
al_errnum := 2;
as_errstr := 'sfs';
end;
когда я выполняю процедуру из сценария оболочки как:
#! /bin/ksh
::::::::::::
OUTVAL=`sqlplus -s usr/passwd@ora_instance <<EOF
264 whenever sqlerror exit failure rollback
265 set pagesize 0
266 set feed off
267 set echo off
268 set serveroutput on
269 DECLARE
270 var al_errnum number,
271 var as_errstr varchar2,
272 var al_processid number,
273 BEGIN
274 execute Import_Invoice('INVOICE_INBOUND_DAT_DIR','INVOICE_apvend_daily.dat','INVOICE_INBOUND_LOG_DIR', al_processid, al_errnum, as_errstr );
275 END
276 /
277 EOF`
::::::
OUTVAL возвращается как:
OUTVAL=var al_errnum number, CAMS_INVOICE_20180802_120830.DAT INVOICE_apvend_daily.dat ERROR at line 2: ORA-06550: line 2, column 15: PLS-00103: Encountered the symbol "NUMBER" when expecting one of the following: := . ( @ % ; not null range default character
Я не могу найти, что не так.
Спасибо за ваши предложения.
Обновление:
как предложил @dandarc, я изменяю код вызова на:
OUTVAL=`sqlplus -s usr/passwd@ora_instance <<EOF
whenever sqlerror exit failure rollback
set pagesize 0
set feed off
set echo off
set serveroutput on
var al_errnum number
var as_errstr varchar2(1000)
var al_processid number
BEGIN
execute Import_Invoice('INVOICE_INBOUND_DAT_DIR','INVOICE_apvend_daily.dat','INVOICE_INBOUND_LOG_DIR', :al_processid, :al_errnum, :as_errstr );
END
/
EOF`
Я получаю эту ошибку:
OUTVAL=execute Import_Invoice('INVOICE_INBOUND_DAT_DIR','INVOICE_apvend_daily.dat','INVOICE_INBOUND_LOG_DIR', :al_processid, :al_errnum, :as_errstr ); CAMS_INVOICE_20180802_120830.DAT INVOICE_apvend_daily.dat ERROR at line 2: ORA-06550: line 2, column 9: PLS-00103: Encountered the symbol "IMPORT_INVOICE" when expecting one of the following: := . ( @ % ; immediate The symbol ":=" was substituted for "IMPORT_INVOICE" to continue. ORA-06550: line 3, column 3: PLS-00103: Encountered the symbol "end-of-file" when expecting one of the following: ; <an identifier> <a double-quoted delimited-identifier> The symbol ";" was substituted for "end-of-file" to continue.
Пожалуйста, помогите.