Solved

Writing out DB2 CLOB strings in ASP/VB

Posted on 2007-12-06
1
1,113 Views
Last Modified: 2008-02-01
How would I write out a CLOB string in ASP/VB?

In JSP, I would be able to maintain it the same was as a VARCHAR field, but in ASP, it would print jibberish.

I would like to do the following:

sql = "SELECT EntryID, DescClob, NormalString FROM tblTest "
Set rs = conn.Execute(sql)
Do Until rs.EOF
  Response.Write rs("DescClob")
  rs.MoveNext
Loop

If DescClob currently has "Hello", the above code will only write out "????o"

Any ideas?
sql = "SELECT EntryID, DescClob, NormalString FROM tblTest "

Set rs = conn.Execute(sql)

Do Until rs.EOF

  Response.Write rs("DescClob")

  rs.MoveNext

Loop

Open in new window

0
Comment
Question by:DJmistral
1 Comment
 
LVL 5

Accepted Solution

by:
ocgstyles earned 50 total points
ID: 20424416
Hi,

VBScript doesn't support LOB data.  You'll have to cast it to a varchar to get it to work.
sql = "SELECT EntryID, varchar(DescClob) as DescClob, NormalString FROM tblTest "

Set rs = conn.Execute(sql)

Do Until rs.EOF

  Response.Write rs("DescClob")

  rs.MoveNext

Loop

Open in new window

0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Recursive SQL in UDB/LUW (you can use 'recursive' and 'SQL' in the same sentence) A growing number of database queries lend themselves to recursive solutions.  It's not always easy to spot when recursion is called for, especially for people una…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now