Solved

Writing out DB2 CLOB strings in ASP/VB

Posted on 2007-12-06
1
1,115 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

How Do You Stack Up Against Your Peers?

With today’s modern enterprise so dependent on digital infrastructures, the impact of major incidents has increased dramatically. Grab the report now to gain insight into how your organization ranks against your peers and learn best-in-class strategies to resolve incidents.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Import csv files to MS SQL 5 85
Summernote and form validation 10 190
ASP CDO - Limiting Connections 3 59
Button on Table, name table1 not working 4 22
November 2009 Recently, a question came up in the DB2 forum regarding the date format in DB2 UDB for AS/400.  Apparently in UDB LUW (Linux/Unix/Windows), the date format is a system-wide setting, and is not controlled at the session level.  I'm n…
Recursive SQL in UDB/LUW (it really isn't that hard to do) Recursive SQL is most often used to convert columns to rows or rows to columns.  A previous article described the process of converting rows to columns.  This article will build off of th…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

839 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