Hello,
I am trying to input three variables from a php script into my stored procedure but I am getting the error:
ORA-06502: PL/SQL: numeric or value error: character to number conversion error ORA-06512: at line 1
This is my php code
<?php
// Connect to Oracle
$conn = oci_connect(" "," "," ");
$compID=$_POST["compID"];
$custNo=$_POST["custNo"];
$answer=$_POST["answer"];
//assemble SQL statement
$query = "begin Enter_Competition_SP('$compID','$custNo','$answer');end;";
//parse statement
$stmt = oci_parse($conn, $query) or die ("Cannot Parse Query");
//run it
oci_execute($stmt) or die ("Cannot execute statement");
oci_free_statement($stmt);
OCIFreeCursor( $cur );
oci_close($conn);
?>
this is my SP:
create or replace PROCEDURE Enter_Competition_SP
(var_CompID IN NUMBER, var_CustID IN NUMBER, var_Answer IN VARCHAR2)
AS
BEGIN
INSERT INTO
COMPETITIONENTRIES
VALUES
(var_CompID,var_CustID,var_Answer);
END Enter_Competition_SP;
and my table looks like this:
CREATE TABLE "COMPETITIONENTRIES"
( "CompetitionID" NUMBER(8,0),
"CustomerID" NUMBER(8,0),
"Answer" VARCHAR2(30),
CONSTRAINT "PK_COMPETITIONENTRIES" PRIMARY KEY ("CompetitionID", "CustomerID") ENABLE
)
/
can anybody help me with this.
many thanks