Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Regular Coder
    Join Date
    Sep 2006
    Location
    India Mumbai
    Posts
    248
    Thanks
    13
    Thanked 1 Time in 1 Post

    ORA-01704: string literal too long error using php

    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???

    can any one please help me??
    Thanks in advance

  • #2
    Senior Coder shyam's Avatar
    Join Date
    Jul 2005
    Posts
    1,563
    Thanks
    2
    Thanked 163 Times in 160 Posts
    You never have to change anything you got up in the middle of the night to write. -- Saul Bellow

  • #3
    Regular Coder
    Join Date
    Sep 2006
    Location
    India Mumbai
    Posts
    248
    Thanks
    13
    Thanked 1 Time in 1 Post
    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


    Thanks

  • #4
    Regular Coder
    Join Date
    Sep 2006
    Location
    India Mumbai
    Posts
    248
    Thanks
    13
    Thanked 1 Time in 1 Post
    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 )


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •