Hi All! I'm hoping someone can answer this quickly. I have a stored procedure defined like so:
PROCEDURE get_esleuth_user (
user_id_in IN esleuth_user.user_id%TYPE,
password_out OUT shared_user.password%TYPE,
email_address_out OUT esleuth_user.email_address%TYPE,
email_type_out OUT esleuth_user.email_type%TYPE,
first_name_out OUT shared_user.first_name%TYPE,
last_name_out OUT shared_user.last_name%TYPE,
street_addr_out OUT shared_user.street_addr%TYPE,
city_out OUT shared_user.city%TYPE,
state_out OUT shared_user.state%TYPE,
zip_out OUT shared_user.zip%TYPE,
country_out OUT shared_user.country%TYPE,
user_status_out OUT esleuth_user.user_status%TYPE,
fav_category_out OUT esleuth_user.fav_category%TYPE,
mail_days_out OUT esleuth_user.mail_days%TYPE,
brand_id_out OUT esleuth_user.brand_id%TYPE)
IS
EN_USER_NOT_FOUND CONSTANT NUMBER DEFAULT -20011;
BEGIN
SELECT password, email_address, email_type, first_name, last_name,
street_addr, city, state, zip, country, user_statu
s, fav_category, mail_days, brand_id
INTO password_out, email_address_out, email_type_out, first_name_out,
last_name_out, street_addr_out, city_out, state
_out, zip_out, country_out, user_status_out, fav_category_out,
mail_days_out, brand_id_out
FROM shared_user su, esleuth_user esu
WHERE su.user_id = UPPER(user_id_in) AND su.user_id = esu.user_id;
EXCEPTION
WHEN NO_DATA_FOUND THEN
RAISE_APPLICATION_ERROR(EN_USER_NOT_FOUND, NULL);
END;
My test code that I use to try and execute this is :
$dbConn = ocilogon("!!!","!!!", "!!!");
$userId = 'DDD23';
$sth = OCIParse ( $dbConn,
"begin get_esleuth_user(:user_id_in);end;" );
OCIBindByName ( $sth, ":user_id_in", $userId, 10 );
OCIExecute ( $sth );
ocifetchinto($sth,&$result, OCI_NUM + OCI_RETURN_NULLS + OCI_ASSOC);
print($result["PASSWORD_OUT"]);
print($result["EMAIL_ADDRESS_OUT"]);
print($result["EMAIL_TYPE_OUT"]);
....the rest of the out columns ,free statement, ocilogoff, etc...
I get the following message when I try to execute it:
Warning: OCIStmtExecute: ORA-06550: line 1, column 7: PLS-00306: wrong number or types of arguments in call to 'GET_ESLEUTH_USER' ORA-06550: line 1, column 7: PL/SQL: Statement ignored in c:\phpdev\www\linuxsleuth\engine\dbtest.php on line 20
Warning: OCIFetchInto: ORA-24374: define not done before fetch or execute and fetch in c:\phpdev\www\linuxsleuth\engine\dbtest.php on line 22
I am converting an asp application to php. The asp version of this code only sends one param, the user's id. This procedure works because it's already beeing used in the current asp application.
Now why am I getting an error stating too few params? I've also checked the type and it's a varchar for the userId. So what's wrong?
I tried setting a cursor and all the changes like someone mentioned in the mesage list but my stored procedure does not have a ref cursor.
I appreciate the help in advance,
Thanks!😕