...

View Full Version : ORA-01704: string literal too long error using php



bhakti_thakkar
11-28-2007, 07:28 AM
hi all,
i m using oracle 9i. my development enviroment is using php, pear/DB. i m connecting the DB using ODBC.
the problem is i have a table with CLOB datatype:

Name Null? Type
----------------------------------------- -------- --------
NEWSLETTER_ID NOT NULL NUMBER
SUBJECT_VC VARCHAR2
MAILTYPE_VC VARCHAR2
CONTENT_TXT CLOB
SCHEDULE_DT VARCHAR2
SYSTEM_HOOK_VC VARCHAR2
NSTATUS_SI NUMBER
TEMPLATE_ID NUMBER

my sql insert statemt is quite huge:
INSERT INTO Newsletter_T (Newsletter_ID,Subject_VC,MailType_VC,Content_Txt,Schedule_DT,nStatus_SI,system_hook_VC,Template_ID) VALUES (1,'DIVIDEND TEMPLATE','html','
Dear Shareholder,

BOARD MEETING NOTICE



We wish to inform you that, the Meeting of the Board of Directors of our Company is scheduled to be held on Monday, January 01, 2007 to take on record, amongst other business, the unaudited financial results and Segment-Wise Financial Report for quarter and half year Monday, January 01, 2007



We also wish to inform you that at the said Meeting, the Board of Directors will consider payment of Interim Dividend for the financial year 2007





The Record for this Interim Dividend is Monday, January 01, 2007 and the date of payment is Monday, January 01, 2007





We request you to provide us with your ECS details before Monday, January 01, 2007 to enable us to remit dividend through ECS.

(please ignore if you have already given this details)







XXXXXXXXX

Company Secretary &
Vice President Human Resources

','28-Nov-2007',0,'474d0a0840d9a','1');
/////////////////////////////////////////////////////////////////////////////////
with all the carrige returns and spaces
it throws me an error :
[nativecode=S1000 [Oracle][ODBC][Ora]ORA-01704: string literal too long]


what is the problem??? :confused:

can any one please help me??
Thanks in advance

shyam
11-28-2007, 10:07 AM
http://ORA-01704.ora-code.com

bhakti_thakkar
11-29-2007, 05:36 AM
hi shyam,
i did refer to the link you provided. below are the changes that i have done:

$sth=$db->prepare("insert into Newsletter_T (Newsletter_ID , Subject_VC , MailType_VC , Content_Txt , Schedule_DT , nStatus_SI , system_hook_VC , Template_ID) values (:var1, :Subject_VC, :MailType_VC, :Schedule_DT , :Content_Txt, :nStatus_SI, :system_hook_VC, :Template_ID)");

$bindvars=array(
"var1" => $nid,
"Subject_VC" => $Subject_VC,
"MailType_VC" => $MailType_VC,
"Content_Txt" => $Content,
"Schedule_DT" => $Schedule_DT,
"nStatus_SI" => $nStatus_SI,
"system_hook_VC" => $system_hook_VC,
"Template_ID" => $Template_ID
);
print_r($bindvars);
$x=$db->execute($sth,$bindvars);
print_r($x);

but now its throwing me error of : [message] => DB Error: mismatch .
i checked all my fields with the bind variable values, i dnt see any problem.
below r the values of the bind variables and if you cross check my table structure, its absolutly fine.. Please help me. going nuts
:rolleyes:

Thanks

bhakti_thakkar
11-29-2007, 05:46 AM
values of th ebind variables are as follows:

Array ( [var1] => 1 [Subject_VC] => DIVIDEND TEMPLATE [MailType_VC] => html [Content_Txt] =>
Dear Shareholder,

BOARD MEETING NOTICE



We wish to inform you that, the Meeting of the Board of Directors of our Company is scheduled to be held on Monday, January 01, 2007 to take on record, amongst other business, the unaudited financial results and Segment-Wise Financial Report for quarter and half year Monday, January 01, 2007



We also wish to inform you that at the said Meeting, the Board of Directors will consider payment of Interim Dividend for the financial year 2007





The Record for this Interim Dividend is Monday, January 01, 2007 and the date of payment is Monday, January 01, 2007





We request you to provide us with your ECS details before Monday, January 01, 2007 to enable us to remit dividend through ECS.

(please ignore if you have already given this details)







XXXXXXXX

Company Secretary &
Vice President Human Resources

[Schedule_DT] => 29-Nov-2007 [nStatus_SI] => 0 [system_hook_VC] => 474e408dcb229 [Template_ID] => 1 )



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum