Results 1 to 4 of 4
  1. #1
    Join Date
    Dec 2003
    Posts
    148

    Unanswered: Insert Statement - Value too large for column? But it isnt!

    Hi all. Im tryin to do a simple insert from an ASP page into an Oracle DB. I'm receiving this error:
    ORA-01401: inserted value too large for column

    So I Response.Write my SQL and go over to oracle:

    SQL> INSERT INTO tbl_Batch (dCreated,cRegion,cCreatorID,cBSys,cComment) Values ('19-AUG-2004','NY ','greenj','V','Test value');

    1 row created.

    SQL>

    Works with no issue whatsoever. Which to me means it's got to be something in ASP page. I can't for the life of me figure out what it may be.

    As I stated, this is just a simple Insert statement:


    Code:
     
    cBSys = RS_Select(0) 
    GlbUser = Session("glbUser") 
    GlbRegion = Session("glbRegion") 
    dCreated = OracleDate(date) 
    InsertString = "INSERT INTO tbl_Batch (dCreated,cRegion,cCreatorID,cSys,cComment) Values ('" & dCreated & "','" & GlbRegion & "','" & GlbUser & "','" & cBSys & "','" & strPromoCodes & "')" 
    
        Set RS_Insert = DB.Execute(InsertString) 
        RS_Insert.Close 
    
            Set RS_Insert = Nothing
    Anyone have any idea on what this may be? Thank you in advance.

  2. #2
    Join Date
    Jul 2003
    Location
    SoCal
    Posts
    721
    Try trimming your variables:

    InsertString = "INSERT INTO tbl_Batch (dCreated,cRegion,cCreatorID,cSys,cComment) Values ('" & Trim(dCreated) & "','" & Trim(GlbRegion) & "','" & Trim(GlbUser) & "','" & Trim(cBSys) & "','" & Trim(strPromoCodes) & "')"
    That which does not kill me postpones the inevitable.

  3. #3
    Join Date
    Nov 2003
    Location
    Christchurch, New Zealand
    Posts
    1,618
    response.write out your insert statement and then check that out against the db. you will probably find that some implicit conversion is happening (eg. the date may be changing format).

  4. #4
    Join Date
    Dec 2003
    Posts
    148

    Solved!

    eg
    Set RS_Insert = DB.Execute(InsertString)
    RS_Insert.Close

    Set RS_Insert = Nothing

    to

    DB.Execute(InsertString)


    thank you to onpnt for posting this solution in another fine forum. Turns out that nonquery statements don't need to use recordsets!

Posting Permissions

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