If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > Insert Statement - Value too large for column? But it isnt!

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-19-04, 17:09
RhythmAddict RhythmAddict is offline
Registered User
 
Join Date: Dec 2003
Posts: 148
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.
Reply With Quote
  #2 (permalink)  
Old 08-19-04, 17:22
Seppuku Seppuku is offline
Useless...
 
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.
Reply With Quote
  #3 (permalink)  
Old 08-19-04, 19:44
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
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).
Reply With Quote
  #4 (permalink)  
Old 08-20-04, 10:27
RhythmAddict RhythmAddict is offline
Registered User
 
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!
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On