Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Insert Statement Problem - Value (isn't!) too large for column! 1

Status
Not open for further replies.

RhythmAddict112

Programmer
Jun 17, 2004
625
US
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.
 
non query statements don't needs recordset usage. just adds hardships to your script.

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

Set RS_Insert = Nothing

to

DB.Execute(InsertString)

ASP verses the ORacle Anlyzer may be interpruting the data differently. Can you post the data types of those fields and or if you have tracked down which column it is that is causing the issue? Or even inserting a test like a single char (taking into account that date field) to check if it is a comm issue or really a sql build issue?

___________________________________________________________________

onpnt.com
SELECT * FROM programmers WHERE clue > 0
(0 row(s) affected) -->faq333-3811

 
Hi,

While onpnt's suggestion will likely work I think I may know why your original does not...

The code...
Code:
InsertString = "INSERT INTO tbl_Batch (dCreated,cRegion,cCreatorID,cSys,cComment) Values ('" & dCreated & "','" & GlbRegion & "','" & GlbUser & "','" & cBSys & "','" & strPromoCodes & "')"
contains what APPEARS to be a date in the field name dCreated. Instead of using the ' character try a pound sign like so....
Code:
InsertString = "INSERT INTO tbl_Batch (dCreated,cRegion,cCreatorID,cSys,cComment) Values (#" & dCreated & "#,'" & GlbRegion & "','" & GlbUser & "','" & cBSys & "','" & strPromoCodes & "')"
 
good thought -- I kind of glanced at that but thought asking the data types first before going there might be a good step.

I don't think from memory that Oracle (or PL) needs # delimiters, but could be wrong on that one. been a bit



___________________________________________________________________

onpnt.com
SELECT * FROM programmers WHERE clue > 0
(0 row(s) affected) -->faq333-3811

 
onpnt. everything worked perfectly after modifying the recordset code. thank you for your help!
 
glad it helped! [smile] and thanks for the *

___________________________________________________________________

onpnt.com
SELECT * FROM programmers WHERE clue > 0
(0 row(s) affected) -->faq333-3811

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top