Hi, I can call stored procedures no problem, but when it comes to functions, I've hit a brick wall. Can anyone help? Am I binding correctly? Is it right to declare the PL/SQL variable first? All help appreciated greatly. Code is included below.... PHP Code: // logon $conn = OCILogon ($usr, $pwd, $sid); $strSQL = "DECLARE " . "result NUMBER; " . "BEGIN " . ":result :=package_name_pkg.function1(" . "10000, '10-JUN-2001', '23-JUL-2001');" . " END;"; // parse $stmt = OCIParse($conn, $strSQL); // bind OCIBindByName($stmt, ":result", &$answer, 22); // execute OCIExecute($stmt); // result OCIResult($stmt,$answer); echo "Value returned:" . $answer; PL/SQL declaration of function (within package_name_pkg): FUNCTION function1 (myval IN NUMBER ,P_STARTDATE IN DATE ,P_ENDDATE IN DATE) RETURN NUMBER; The error I get back on screen is: Warning: OCIStmtExecute: ORA-06550: line 1, column 69: PLS-00201: identifier 'CALC.package_name_pkg' must be declared ORA-06550: line 1, column 44: PL/SQL: Statement ignored in /home/isadlve/public_html/phptesting/file.php on line 28 Laurence Veale Regards, Laurence Veale Tel: 9689 6172 Email: [EMAIL PROTECTED] -- This message is intended for the addressee named and may contain confidential information. If you are not the intended recipient, please delete it and notify the sender. Views expressed in this message are those of the individual sender, and are not necessarily the views of the Office of State Revenue. -- -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]