Skip to Main Content

Database Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

problem inserting Unicode data "ORA-01461: can bind a LONG value only ..."

445518Nov 9 2006 — edited Nov 29 2006
I am running Oracle 10g Express Edition, PHP 5.1.6 and Apache 2.0.59 on a Windows XP machine.

I have the following table:

CREATE TABLE test1
(
tid NUMBER
CONSTRAINT test1_pk PRIMARY KEY,
col1 VARCHAR2(255),
col2 NVARCHAR2(255),
col3 VARCHAR2(4000),
last_modified TIMESTAMP DEFAULT SYSTIMESTAMP
);

I can insert Unicode data into the following table WITHOUT using binding, e.g. this works:

// Program output here
QUERY = INSERT INTO test1 VALUES (test1_seq.nextval, 'ユニコードは、すべての', 'ユニコードは、すべての', 'ユニコードは、すべての', SYSTIMESTAMP)
// End program output

But when I try using bind, I get an error message as follows:

// Program output here
QUERY = INSERT INTO test1 VALUES (test1_seq.nextval, :col1, :col2, :col3, SYSTIMESTAMP)

Warning: ociexecute() [function.ociexecute]: ORA-01461: can bind a LONG value only for insert into a LONG column in C:\Program Files\Apache Group\Apache2\htdocs\form9_BIND.php on line 60
// End program output

The PHP code looks like this:

// PHP code
$query1 = "INSERT INTO test1 VALUES (test1_seq.nextval, :col1, :col2, :col3, SYSTIMESTAMP)";

echo 'QUERY = ' . $query1;


$s = OCIParse($c, $query1);
OciBindByName($s, ":col1", $col1,32);
OciBindByName($s, ":col2", $col2,32);
OciBindByName($s, ":col3", $col3,32);
OCIExecute($s, OCI_DEFAULT);
// End of PHP code

Any ideas what the problem is? The text works fine with simpler input, e.g. this works:

// Program output
INSERT INTO test1 VALUES
(test1_seq.nextval, 'Iñtërnâtiônàlizætiøn', 'Iñtërnâtiônàlizætiøn', 'Iñtërnâtiônàlizætiøn', SYSTIMESTAMP)
// End program output
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 27 2006
Added on Nov 9 2006
15 comments
6,101 views