php - oci_execute identifier must be declared ORA-06550 -
the procedure:
function f_exists ( p_pidm gobansr.gobansr_pidm%type, p_num gobansr.gobansr_num%type, p_rowid gb_common.internal_record_id_type default null) return varchar2 -- type queryone_ref ref cursor; lv_cursor queryone_ref; lv_tempout varchar2(1) := 'n'; begin -- -- assign cursor variable appropriate cursor -- if p_rowid not null open lv_cursor select 'y' gobansr rowid = p_rowid; else open lv_cursor select 'y' gobansr gobansr_pidm = p_pidm , gobansr_num = p_num; end if; fetch lv_cursor lv_tempout; close lv_cursor; return lv_tempout; end f_exists;
php code run/query stored procedure:
$conn = oci_connect($username, $password, $db); $sql = 'begin "gb_pin_answer"."f_exists"(:p_pidm, :p_num); end;'; $stmt = oci_parse($conn, $sql); if (!$conn) exit("db did not connect."); $p_pidm = 36706; $p_num = 1; oci_bind_by_name($stmt,':p_pidm',$p_pidm,5); oci_bind_by_name($stmt,':p_num',$p_num,1); if (!oci_execute($stmt)) exit("procedure failed."); oci_commit($conn); oci_close($conn);
i have verified dba have execute privileges stored procedure , php connects database server.
it returns error:
message: oci_execute(): ora-06550: line 1, column 8: pls-00201: identifier 'gb_pin_answer.f_exists' must declared ora-06550: line 1, column 8: pl/sql: statement ignored
update:
i able run: select gb_pin_answer.f_exists('36706','2') result dual
, returned y
now need figure out how go using stored procedure in php:
procedure p_create( p_pidm gobansr.gobansr_pidm%type, p_num gobansr.gobansr_num%type, p_gobqstn_id gobansr.gobansr_gobqstn_id%type default null, p_qstn_desc gobansr.gobansr_qstn_desc%type default null, p_ansr_desc gobansr.gobansr_ansr_desc%type, p_ansr_salt gobansr.gobansr_ansr_salt%type, p_user_id gobansr.gobansr_user_id%type default gb_common.f_sct_user, p_data_origin gobansr.gobansr_data_origin%type, p_rowid_out out gb_common.internal_record_id_type) -- lv_gobansr_rec gobansr%rowtype; error_message gb_common_strings.err_type; lv_hashed_answer gobansr.gobansr_ansr_desc%type; lv_salt gobansr.gobansr_ansr_salt%type; begin -- -- make sure record doesn't exist -- if (gb_pin_answer.f_exists(p_pidm,p_num)='y') error_message := gb_common_strings.f_append_error(error_message, gb_pin_answer_strings.f_get_error('record_exists')); end if; -- if (error_message not null) raise_application_error(gb_common_strings.err_code, error_message); end if; lv_salt := gspcrpt.f_get_salt(length(replace(p_ansr_desc,' '))); gspcrpt.p_saltedhash(lower(replace(p_ansr_desc,' ')),lv_salt,lv_hashed_answer); -- -- execute business rules -- gb_pin_answer_rules.p_validate( p_pidm => p_pidm, p_num => p_num, p_gobqstn_id => p_gobqstn_id, p_qstn_desc => p_qstn_desc, p_ansr_desc => p_ansr_desc, p_ansr_salt => lv_salt, p_user_id => p_user_id, p_data_origin => p_data_origin); -- -- local user exit call, if defined, occur. -- /* -- no local call p_pidm => p_pidm, p_num => p_num, p_gobqstn_id => p_gobqstn_id, p_qstn_desc => p_qstn_desc, p_ansr_desc => p_ansr_desc, p_ansr_salt => lv_salt, p_user_id => p_user_id, p_data_origin => p_data_origin); */ -- -- build dml record -- lv_gobansr_rec := f_build_gobansr_rec( p_pidm => p_pidm, p_num => p_num, p_gobqstn_id => p_gobqstn_id, p_qstn_desc => p_qstn_desc, p_ansr_desc => lv_hashed_answer, p_ansr_salt => lv_salt, p_user_id => p_user_id, p_data_origin => p_data_origin); -- -- set activity date -- lv_gobansr_rec.gobansr_activity_date := sysdate; -- -- delegate dml layer -- dml_gobansr.p_insert(lv_gobansr_rec, p_rowid_out); -- -- note: banner messaging support logic called after -- successful dml operation -- check if messaging enabled/licensed business entity. -- if (gb_event.f_entity_publishable(gb_event.baseline_ind, m_entity_name)) -- register business entity messaging support. gb_pin_answer_rules.p_register_entity( p_operation_type => gb_event.create_operation, p_pidm => p_pidm, p_num => p_num, p_gobqstn_id => p_gobqstn_id, p_qstn_desc => p_qstn_desc, p_ansr_desc => p_ansr_desc, p_ansr_salt => p_ansr_salt, p_user_id => p_user_id, p_data_origin => p_data_origin, p_internal_record_id => p_rowid_out); end if; end p_create;
you've defined function pl/sql you're using implies you're calling procedure.
the pl/sql should this:
$sql = 'begin :f := "gb_pin_answer"."f_exists"(:p_pidm, :p_num); end;';
Comments
Post a Comment