Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_databases thread: ASP(client)/DB2(mainframe) problem


Message #1 by Tom Craig <tcrai2@e...> on Thu, 13 Feb 2003 10:33:28 -0500
This is an ASP(server)/DB2(mainframe) problem. I can connect from ASP
(on a server) to a DB2 database on a mainframe with ease. I need to
store NOTES that are often several K long. When I create the SQL
commands in ASP to do this, I am forced to create a loop that stores the
first 255 bytes in the NOTES area on the database and then concatenate
the remaining data in chunks of 255 bytes until I have all the data on
the DB2 database. I am using  MS ODBC. It gives me the following error
if I try to send a string longer than 255 bytes.
===================================================================================

Technical Information (for support personnel)

Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[IBM][CLI Driver][DB2] SQL0102N The string constant beginning with
"a1b2c3d4e5" is too long. SQLSTATE=54002 /ecksforms/eforms/sendmail.asp,
line 444
Browser Type:Mozilla/4.51 [en]C-99032 (WinNT; I)
Page: POST 815 bytes to /ecksforms/eforms/sendmail.asp
===================================================================================

Here is the line with the problem:

sql = "INSERT INTO
EFFRMRTN(FORM_NAME,STORE_NUMBER,STORE_FORM_CNT,EMAIL_ADDRESS," &_
         "EMAIL_TEXT) VALUES('" & formname & "','" & store & "'," &
sfcnt & ",'" &_
         emailaddr & "','" & tmpetext & "')"

curdate = Date()

cmd.CommandText = sql

cmd.Execute updcnt
 =====================================================================================

If tmpetext is longer than 255 bytes, I get the error.  If it is 255 or
less, I do not get the error.  I did get one suggestion to use to LOBS
but no one seems to know anything about that.

All assistance is extremely appreciated

The information transmitted is intended only for the person or entity to
which it is addressed and may contain confidential and/or privileged 
material.  If the reader of this message is not the intended recipient,
you are hereby notified that your access is unauthorized, and any review,
dissemination, distribution or copying of this message including any
attachments is strictly prohibited.   If you are not the intended
recipient, please contact the sender and delete the material from any
computer.

Message #2 by "Gary Hartge" <ghartge@u...> on Thu, 13 Feb 2003 10:57:48 -0500
Tom,

Could the problem be that the field you are trying to insert this data into
is defined as a text field. If so this only allows 255 characters. Change it
to a memo field and you can use up to 65,535 characters.

Gary

-----Original Message-----
From: Tom Craig [mailto:tcrai2@e...]
Sent: Thursday, February 13, 2003 10:33 AM
To: ASP Databases
Subject: [asp_databases] ASP(client)/DB2(mainframe) problem


This is an ASP(server)/DB2(mainframe) problem. I can connect from ASP
(on a server) to a DB2 database on a mainframe with ease. I need to
store NOTES that are often several K long. When I create the SQL
commands in ASP to do this, I am forced to create a loop that stores the
first 255 bytes in the NOTES area on the database and then concatenate
the remaining data in chunks of 255 bytes until I have all the data on
the DB2 database. I am using  MS ODBC. It gives me the following error
if I try to send a string longer than 255 bytes.
============================================================================
=======

Technical Information (for support personnel)

Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[IBM][CLI Driver][DB2] SQL0102N The string constant beginning with
"a1b2c3d4e5" is too long. SQLSTATE=54002 /ecksforms/eforms/sendmail.asp,
line 444
Browser Type:Mozilla/4.51 [en]C-99032 (WinNT; I)
Page: POST 815 bytes to /ecksforms/eforms/sendmail.asp
============================================================================
=======

Here is the line with the problem:

sql = "INSERT INTO
EFFRMRTN(FORM_NAME,STORE_NUMBER,STORE_FORM_CNT,EMAIL_ADDRESS," &_
         "EMAIL_TEXT) VALUES('" & formname & "','" & store & "'," &
sfcnt & ",'" &_
         emailaddr & "','" & tmpetext & "')"

curdate = Date()

cmd.CommandText = sql

cmd.Execute updcnt

============================================================================
=========

If tmpetext is longer than 255 bytes, I get the error.  If it is 255 or
less, I do not get the error.  I did get one suggestion to use to LOBS
but no one seems to know anything about that.

All assistance is extremely appreciated

The information transmitted is intended only for the person or entity to
which it is addressed and may contain confidential and/or privileged
material.  If the reader of this message is not the intended recipient,
you are hereby notified that your access is unauthorized, and any review,
dissemination, distribution or copying of this message including any
attachments is strictly prohibited.   If you are not the intended
recipient, please contact the sender and delete the material from any
computer.



Message #3 by Tom Craig <tcraig5812@y...> on Thu, 13 Feb 2003 10:29:16 -0800 (PST)
The field on the DB2 database is extremely large...it
can handle my starting off with 255 bytes and then
adding additional 255 bytes on the DB2 table.

On the ASP side, I am just defining the field with a
DIM statement...my understanding is that ASP(VBScript)
defines the field as a string automatically...maybe
strings in ASP have a max length of 255...


--- Gary Hartge <ghartge@u...> wrote:
> Tom,
> 
> Could the problem be that the field you are trying
> to insert this data into
> is defined as a text field. If so this only allows
> 255 characters. Change it
> to a memo field and you can use up to 65,535
> characters.
> 
> Gary
> 
> -----Original Message-----
> From: Tom Craig [mailto:tcrai2@e...]
> Sent: Thursday, February 13, 2003 10:33 AM
> To: ASP Databases
> Subject: [asp_databases] ASP(client)/DB2(mainframe)
> problem
> 
> 
> This is an ASP(server)/DB2(mainframe) problem. I can
> connect from ASP
> (on a server) to a DB2 database on a mainframe with
> ease. I need to
> store NOTES that are often several K long. When I
> create the SQL
> commands in ASP to do this, I am forced to create a
> loop that stores the
> first 255 bytes in the NOTES area on the database
> and then concatenate
> the remaining data in chunks of 255 bytes until I
> have all the data on
> the DB2 database. I am using  MS ODBC. It gives me
> the following error
> if I try to send a string longer than 255 bytes.
>
============================================================================
> =======
> 
> Technical Information (for support personnel)
> 
> Error Type:
> Microsoft OLE DB Provider for ODBC Drivers
> (0x80004005)
> [IBM][CLI Driver][DB2] SQL0102N The string constant
> beginning with
> "a1b2c3d4e5" is too long. SQLSTATE=54002
> /ecksforms/eforms/sendmail.asp,
> line 444
> Browser Type:Mozilla/4.51 [en]C-99032 (WinNT; I)
> Page: POST 815 bytes to
> /ecksforms/eforms/sendmail.asp
>
============================================================================
> =======
> 
> Here is the line with the problem:
> 
> sql = "INSERT INTO
>
EFFRMRTN(FORM_NAME,STORE_NUMBER,STORE_FORM_CNT,EMAIL_ADDRESS,"
> &_
>          "EMAIL_TEXT) VALUES('" & formname & "','" &
> store & "'," &
> sfcnt & ",'" &_
>          emailaddr & "','" & tmpetext & "')"
> 
> curdate = Date()
> 
> cmd.CommandText = sql
> 
> cmd.Execute updcnt
> 
>
============================================================================
> =========
> 
> If tmpetext is longer than 255 bytes, I get the
> error.  If it is 255 or
> less, I do not get the error.  I did get one
> suggestion to use to LOBS
> but no one seems to know anything about that.
> 
> All assistance is extremely appreciated
> 
> The information transmitted is intended only for the
> person or entity to
> which it is addressed and may contain confidential
> and/or privileged
> material.  If the reader of this message is not the
> intended recipient,
> you are hereby notified that your access is
> unauthorized, and any review,
> dissemination, distribution or copying of this
> message including any
> attachments is strictly prohibited.   If you are not
> the intended
> recipient, please contact the sender and delete the
> material from any
> computer.
> 
> 
> 
> 


=====
Tom Craig 
Systems Technical Specialist A/Eckerds
Tampa, Florida

__________________________________________________
Do you Yahoo!?
Yahoo! Shopping - Send Flowers for Valentine's Day
http://shopping.yahoo.com
Message #4 by "Gary Hartge" <ghartge@u...> on Thu, 13 Feb 2003 13:55:40 -0500
There is a technique referred to as "Stuffing" that is located on page 519
of Wrox's book ASP Databases. It discusses this very issue. The method they
use is called AppendChunk. It is rather lengthy for my sub par typing skills
but maybe you can search on the AppendChunk method and get example code.
Basically you need to break the text apart into manageable "chunks" for ASP.

I only have an intermediate level of knowledge so hopefully this helps. Just
trying to give something back for all of the help I have received from this
site.

-----Original Message-----
From: Tom Craig [mailto:tcraig5812@y...]
Sent: Thursday, February 13, 2003 1:29 PM
To: ASP Databases
Subject: [asp_databases] RE: ASP(client)/DB2(mainframe) problem


The field on the DB2 database is extremely large...it
can handle my starting off with 255 bytes and then
adding additional 255 bytes on the DB2 table.

On the ASP side, I am just defining the field with a
DIM statement...my understanding is that ASP(VBScript)
defines the field as a string automatically...maybe
strings in ASP have a max length of 255...


--- Gary Hartge <ghartge@u...> wrote:
> Tom,
>
> Could the problem be that the field you are trying
> to insert this data into
> is defined as a text field. If so this only allows
> 255 characters. Change it
> to a memo field and you can use up to 65,535
> characters.
>
> Gary
>
> -----Original Message-----
> From: Tom Craig [mailto:tcrai2@e...]
> Sent: Thursday, February 13, 2003 10:33 AM
> To: ASP Databases
> Subject: [asp_databases] ASP(client)/DB2(mainframe)
> problem
>
>
> This is an ASP(server)/DB2(mainframe) problem. I can
> connect from ASP
> (on a server) to a DB2 database on a mainframe with
> ease. I need to
> store NOTES that are often several K long. When I
> create the SQL
> commands in ASP to do this, I am forced to create a
> loop that stores the
> first 255 bytes in the NOTES area on the database
> and then concatenate
> the remaining data in chunks of 255 bytes until I
> have all the data on
> the DB2 database. I am using  MS ODBC. It gives me
> the following error
> if I try to send a string longer than 255 bytes.
>
============================================================================
> =======
>
> Technical Information (for support personnel)
>
> Error Type:
> Microsoft OLE DB Provider for ODBC Drivers
> (0x80004005)
> [IBM][CLI Driver][DB2] SQL0102N The string constant
> beginning with
> "a1b2c3d4e5" is too long. SQLSTATE=54002
> /ecksforms/eforms/sendmail.asp,
> line 444
> Browser Type:Mozilla/4.51 [en]C-99032 (WinNT; I)
> Page: POST 815 bytes to
> /ecksforms/eforms/sendmail.asp
>
============================================================================
> =======
>
> Here is the line with the problem:
>
> sql = "INSERT INTO
>
EFFRMRTN(FORM_NAME,STORE_NUMBER,STORE_FORM_CNT,EMAIL_ADDRESS,"
> &_
>          "EMAIL_TEXT) VALUES('" & formname & "','" &
> store & "'," &
> sfcnt & ",'" &_
>          emailaddr & "','" & tmpetext & "')"
>
> curdate = Date()
>
> cmd.CommandText = sql
>
> cmd.Execute updcnt
>
>
============================================================================
> =========
>
> If tmpetext is longer than 255 bytes, I get the
> error.  If it is 255 or
> less, I do not get the error.  I did get one
> suggestion to use to LOBS
> but no one seems to know anything about that.
>
> All assistance is extremely appreciated
>
> The information transmitted is intended only for the
> person or entity to
> which it is addressed and may contain confidential
> and/or privileged
> material.  If the reader of this message is not the
> intended recipient,
> you are hereby notified that your access is
> unauthorized, and any review,
> dissemination, distribution or copying of this
> message including any
> attachments is strictly prohibited.   If you are not
> the intended
> recipient, please contact the sender and delete the
> material from any
> computer.
>
>
>
>


=====
Tom Craig
Systems Technical Specialist A/Eckerds
Tampa, Florida

__________________________________________________
Do you Yahoo!?
Yahoo! Shopping - Send Flowers for Valentine's Day
http://shopping.yahoo.com


Message #5 by Tom Craig <tcraig5812@y...> on Thu, 13 Feb 2003 11:05:46 -0800 (PST)
Thanks...I will check it out...

This is similar to what we are doing now...we are
splitting up the "string" field up into chunks of 255
bytes, sending that to the DB2 database...continuing
thru a loop that updates the field on the database
until we get all of the information on the DB2
database.  Unfortunately the system "burps" and only
the first 255 bytes are written out to the DB2
database.

Maybe I can return the favor someday.

--- Gary Hartge <ghartge@u...> wrote:
> There is a technique referred to as "Stuffing" that
> is located on page 519
> of Wrox's book ASP Databases. It discusses this very
> issue. The method they
> use is called AppendChunk. It is rather lengthy for
> my sub par typing skills
> but maybe you can search on the AppendChunk method
> and get example code.
> Basically you need to break the text apart into
> manageable "chunks" for ASP.
> 
> I only have an intermediate level of knowledge so
> hopefully this helps. Just
> trying to give something back for all of the help I
> have received from this
> site.
> 
> -----Original Message-----
> From: Tom Craig [mailto:tcraig5812@y...]
> Sent: Thursday, February 13, 2003 1:29 PM
> To: ASP Databases
> Subject: [asp_databases] RE:
> ASP(client)/DB2(mainframe) problem
> 
> 
> The field on the DB2 database is extremely
> large...it
> can handle my starting off with 255 bytes and then
> adding additional 255 bytes on the DB2 table.
> 
> On the ASP side, I am just defining the field with a
> DIM statement...my understanding is that
> ASP(VBScript)
> defines the field as a string automatically...maybe
> strings in ASP have a max length of 255...
> 
> 
> --- Gary Hartge <ghartge@u...> wrote:
> > Tom,
> >
> > Could the problem be that the field you are trying
> > to insert this data into
> > is defined as a text field. If so this only allows
> > 255 characters. Change it
> > to a memo field and you can use up to 65,535
> > characters.
> >
> > Gary
> >
> > -----Original Message-----
> > From: Tom Craig [mailto:tcrai2@e...]
> > Sent: Thursday, February 13, 2003 10:33 AM
> > To: ASP Databases
> > Subject: [asp_databases]
> ASP(client)/DB2(mainframe)
> > problem
> >
> >
> > This is an ASP(server)/DB2(mainframe) problem. I
> can
> > connect from ASP
> > (on a server) to a DB2 database on a mainframe
> with
> > ease. I need to
> > store NOTES that are often several K long. When I
> > create the SQL
> > commands in ASP to do this, I am forced to create
> a
> > loop that stores the
> > first 255 bytes in the NOTES area on the database
> > and then concatenate
> > the remaining data in chunks of 255 bytes until I
> > have all the data on
> > the DB2 database. I am using  MS ODBC. It gives me
> > the following error
> > if I try to send a string longer than 255 bytes.
> >
>
============================================================================
> > =======
> >
> > Technical Information (for support personnel)
> >
> > Error Type:
> > Microsoft OLE DB Provider for ODBC Drivers
> > (0x80004005)
> > [IBM][CLI Driver][DB2] SQL0102N The string
> constant
> > beginning with
> > "a1b2c3d4e5" is too long. SQLSTATE=54002
> > /ecksforms/eforms/sendmail.asp,
> > line 444
> > Browser Type:Mozilla/4.51 [en]C-99032 (WinNT; I)
> > Page: POST 815 bytes to
> > /ecksforms/eforms/sendmail.asp
> >
>
============================================================================
> > =======
> >
> > Here is the line with the problem:
> >
> > sql = "INSERT INTO
> >
>
EFFRMRTN(FORM_NAME,STORE_NUMBER,STORE_FORM_CNT,EMAIL_ADDRESS,"
> > &_
> >          "EMAIL_TEXT) VALUES('" & formname & "','"
> &
> > store & "'," &
> > sfcnt & ",'" &_
> >          emailaddr & "','" & tmpetext & "')"
> >
> > curdate = Date()
> >
> > cmd.CommandText = sql
> >
> > cmd.Execute updcnt
> >
> >
>
============================================================================
> > =========
> >
> > If tmpetext is longer than 255 bytes, I get the
> > error.  If it is 255 or
> > less, I do not get the error.  I did get one
> > suggestion to use to LOBS
> > but no one seems to know anything about that.
> >
> > All assistance is extremely appreciated
> >
> > The information transmitted is intended only for
> the
> > person or entity to
> > which it is addressed and may contain confidential
> > and/or privileged
> > material.  If the reader of this message is not
> the
> > intended recipient,
> > you are hereby notified that your access is
> > unauthorized, and any review,
> > dissemination, distribution or copying of this
> > message including any
> > attachments is strictly prohibited.   If you are
> not
> > the intended
> > recipient, please contact the sender and delete
> the
> > material from any
> > computer.
> >
> >
> >
> >
> 
> 
> =====
> Tom Craig
> Systems Technical Specialist A/Eckerds
> Tampa, Florida
> 
> __________________________________________________
> Do you Yahoo!?
> Yahoo! Shopping - Send Flowers for Valentine's Day
> http://shopping.yahoo.com
> 
> 
> 


=====
Tom Craig 
Systems Technical Specialist A/Eckerds
Tampa, Florida

__________________________________________________
Do you Yahoo!?
Yahoo! Shopping - Send Flowers for Valentine's Day
http://shopping.yahoo.com
Message #6 by sankar_sengupta2002@y... on Fri, 21 Feb 2003 06:50:41
Yes I alsp think so.
> This is an ASP(server)/DB2(mainframe) problem. I can connect from ASP
(on a server) to a DB2 database on a mainframe with ease. I need to
store NOTES that are often several K long. When I create the SQL
commands in ASP to do this, I am forced to create a loop that stores the
first 255 bytes in the NOTES area on the database and then concatenate
the remaining data in chunks of 255 bytes until I have all the data on
the DB2 database. I am using  MS ODBC. It gives me the following error
if I try to send a string longer than 255 bytes.
===========================================================================
========

Technical Information (for support personnel)

Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[IBM][CLI Driver][DB2] SQL0102N The string constant beginning with
"a1b2c3d4e5" is too long. SQLSTATE=54002 /ecksforms/eforms/sendmail.asp,
line 444
Browser Type:Mozilla/4.51 [en]C-99032 (WinNT; I)
Page: POST 815 bytes to /ecksforms/eforms/sendmail.asp
===========================================================================
========

Here is the line with the problem:

sql = "INSERT INTO
EFFRMRTN(FORM_NAME,STORE_NUMBER,STORE_FORM_CNT,EMAIL_ADDRESS," &_
         "EMAIL_TEXT) VALUES('" & formname & "','" & store & "'," &
sfcnt & ",'" &_
         emailaddr & "','" & tmpetext & "')"

curdate = Date()

cmd.CommandText = sql

cmd.Execute updcnt
 
===========================================================================
==========

If tmpetext is longer than 255 bytes, I get the error.  If it is 255 or
less, I do not get the error.  I did get one suggestion to use to LOBS
but no one seems to know anything about that.

All assistance is extremely appreciated

The information transmitted is intended only for the person or entity to
which it is addressed and may contain confidential and/or privileged 
material.  If the reader of this message is not the intended recipient,
you are hereby notified that your access is unauthorized, and any review,
dissemination, distribution or copying of this message including any
attachments is strictly prohibited.   If you are not the intended
recipient, please contact the sender and delete the material from any
computer.


  Return to Index