PHP - Load Gif image into Oracle Blob field - ORA-00972 error
868138Jun 10 2011 — edited Jun 13 2011I am receiving an " ORA-00972 - Identifier Is too Long" error message when I try to update a BLOB field with file contents from a gif file.
__GIF FILES_:_
c:\bl\x_PageLayout-4_LA.gif (15K)
c:\bl\x_PageLayout-4_Spec.gif (21k)
===================================================================================================================================
ORACLE DATABASE (STYLEELEMENTPIX TABLE):*
STYLE_ID NUMBER
SEQ_KEY NUMBER
PIX_NAME VARCHAR2(30 BYTE)
PIX BLOB
PIX_LABEL VARCHAR2(30 BYTE)
MODIFY_DATE DATE
PIX_TYPE CHAR(1 BYTE)
DEFAULTDISPLAY CHAR(1 BYTE)
PIX field currently is null
===================================================================================================================================
PHP CODE:*
$filename = 'C:\BL\\';
$filename .= $row->PIX_NAME; //filename of gif ex: c:\bl\x_PageLayout-4_LA.gif
$fp = fopen($filename, "rb"); //open gif file
$file_content = fread($fp, filesize($filename)); //read gif file
//set gif file in PIX field (PIX datatyle BLOB)
$cursor1 = oci_parse($conn, "UPDATE STYLEELEMENTPIX SET PIX = '$file_content' WHERE STYLE_ID = $row->STYLE_ID AND SEQ_KEY = $row->SEQ_KEY");
oci_execute ($cursor1);
For both records, style id will be 100 ($row->STYLE_ID), and seq_key will be 1 for the first record and 2 for the second ($row->SEQ_KEY)
===================================================================================================================================
ERROR MESSAGE:
Warning: oci_parse() [function.oci-parse]: ORA-00972: identifier is too long in C:\wamp\www\eStyleGuide\Admin\BLOB.php on line 44 ($cursor1 = ....)