Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> insert record of type date
<HTML><HEAD></HEAD><BODY>
<form name='Date' action='testdate.php' Method='Post'>
<select name='Day' size=1>
<option value='1'>01</option>...........<option value='31'>31</option>
</select>
<select name='Month' size=1>
<option value='jan'>Januari</option>.......<option
value='dec'>December</option>
</select>
<select name='Year' size=1>
<option value='1900'>1900</option>.............<option
value='2001'>2001</option>
</select>
<input type='submit' value='Submit'>
</form></BODY></HTML>
This is the Testdate.php
<HTML><HEAD></HEAD><BODY>
insert into coxyyyzzzaaaa.test (dateoffbirth) values ('<?php echo
$Day;?>-<?php echo $Month;?>-<?php echo $Year;?>')
<?php $conn = OCILogon("coxyyyzzzaaaa", "admin" , "companyx");
$stmt = OCIParse($conn,"insert into coxyyyzzzaaaa.test (dateoffbirth) values
('<?php echo $Day;?>-<?php echo $Month;?>-<?php echo $Year;?>')");
OCIExecute($stmt);OCICommit($conn);OCIFreeStatement($stmt);OCILogoff($conn);
?>
</BODY></HTML>
OUTPUT I RECIEVED :
insert into coxyyyzzzaaaa.test (dateoffbirth) values ('1-jan-1900')
Warning: OCIStmtExecute: ORA-01858: a non-numeric character was found where
a numeric was expected in c:\program
files\apache group\apache\htdocs\examples\project\testdate.php on line 9
However the insert generated as above is working is sqlplus, I 'm recieving
the
above error. If I 'm reading this message as wel , I think the system is
handling the $Day ,$Month and $Year as text and not as number.
How can I correct this whole thing ?????
THX Gerry Received on Wed Apr 25 2001 - 11:56:47 CDT