NYCPHP Meetup

NYPHP.org

[nycphp-talk] PEAR::DB and Oracle insert error

Chris Hubbard chubbard at next-online.net
Mon Mar 29 12:28:27 EST 2004


All,
I've run into something I'm not sure how to fix.

Trying to insert some values into a table in Oracle using PEAR::DB.

Here's the error I'm getting:
[nativecode=ORA-00911: invalid character]

Here's the SQL:
INSERT INTO EVENT (
			"APPLICATION",
			"COMPANYNUMBER",
			"DATELASTMODIFIED",
			"DATERECORDADDED",
			"EVENTINFO",
			"LOGINNAME",
			"OFFICENUMBER",
			"OID",
			"OIDEVENTTYPE",
			"PAGENAME",
			"SESSIONID"
			) VALUES (
			'AccessPointAP_VERSION',
			'',
			TO_DATE ('3/26/2004','MM/DD/YYYY'),
			TO_DATE ('3/26/2004','MM/DD/YYYY'),
			'this is the message',
			'',
			'',
			HEXTORAW ('323037323036363233373632'),
			HEXTORAW ('EF532CBE3C925A7F3FEC77F3'),
			'',
			''
			);

Here's the describe on the table:
  Name                                            Null?    Type
  ----------------------------------------- -------- 
----------------------------
  APPLICATION                                         VARCHAR2(32)
  COMPANYNUMBER                             NUMBER
  DATELASTMODIFIED               NOT NULL DATE
  DATERECORDADDED            NOT NULL DATE
  EVENTINFO                                            VARCHAR2(255)
  LOGINNAME                                           VARCHAR2(60)
  OFFICENUMBER                                   NUMBER
  OID                                                NOT NULL RAW(12)
  OIDEVENTTYPE                        NOT NULL RAW(12)
  PAGENAME                                            VARCHAR2(48)
  SESSIONID                                             VARCHAR2(48)

And finally here's the code:
putenv("ORACLE_HOME=/usr/local/share/oracli");
require_once ("DB.php");
$dsn = "oci8://user:pass at inst";
$this->db = DB::connect($dsn);
$sql = "INSERT INTO EVENT ( ... )";
$rs = $this->db->query($sql);

Any suggestions?
I've tried all kinds of things in the SQL.  Obviously missing something 
important.  BTW I don't know from Oracle.
Thanks in advance.

Chris Hubbard
chubbard at next-online.net
425 563 4153
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: text/enriched
Size: 3447 bytes
Desc: not available
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20040329/dff095e5/attachment.bin>


More information about the talk mailing list