Home » SQL & PL/SQL » SQL & PL/SQL » Help required - Problem with CLOB datatype
Help required - Problem with CLOB datatype [message #20964] Wed, 03 July 2002 05:20 Go to next message
Vinod K
Messages: 1
Registered: July 2002
Junior Member
Hi,

I have Oracle 9i1 installed.
I fire a query say "select A1.f1, A1.f2, A1.f3, A1.f4 from table1 A1" where f3 is a CLOB datatype through an ADODB.connection object from an ASP
is returning undefined values for f3..
The web server is IIS 5.0.

What is the problem?
Is there any way to get correct values in to a recordset?

Structure of Table1 is as follows:
-----------------------------------------------
f1 - int
f2 - datetime
f3 - CLOB
f4 - bit

its important so please reply soon
thanks in advance
Vinod.
Re: Help required - Problem with CLOB datatype [message #20965 is a reply to message #20964] Wed, 03 July 2002 07:46 Go to previous message
Mahesh Rajendran
Messages: 10707
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
CREATE TABLE empclob (
empno number(4),
clob1 clob);

sample ADO code

Dim objCon As ADODB.Connection
Dim objRst As ADODB.Recordset

Set objCon = New ADODB.Connection
Set objRst = New ADODB.Recordset

  objCon.ConnectionString = "DSN=V815;Data Source=V815;User ID=scott;password=tiger;"
  objCon.Open ConnectionString

  objRst.Open "empclob", objCon, adOpenStatic, adLockOptimistic, adCmdTable

  'One way to insert... using insert
  objRst.AddNew Array("empno", "clob1"), Array(9000, "Testing 9000")

  'Another way to insert... using update
  objRst.AddNew
  objRst!EMPNO = 9001
  objRst!CLOB1 = "Testing 9001"
  objRst.Update

  'Third way to insert... using stream
  objRst.AddNew
  objRst!EMPNO = 9002
  objRst.Fields("CLOB1").AppendChunk "First stream..."
  objRst.Fields("CLOB1").AppendChunk "Second stream..."
  objRst.Fields("CLOB1").AppendChunk "Third and last stream..."
  objRst.Update

command_button2 code:
=====================
'Read from the clob
Dim objCon As ADODB.Connection
Dim objRst As ADODB.Recordset

Set objCon = New ADODB.Connection
Set objRst = New ADODB.Recordset

  objCon.ConnectionString = "DSN=dsn815;Data Source=V81;User ID=scott;password=tiger;"
  objCon.Open ConnectionString
  MsgBox ("connected")
  sql = "select * from empclob"
  Set rsTabel = New ADODB.Recordset
  rsTabel.ActiveConnection = objCon
  rsTabel.CursorLocation = adUseServer
rsTabel.LockType = adLockReadOnly
rsTabel.Source = sql
rsTabel.Open

MsgBox (rsTabel(0))
MsgBox (rsTabel(1))
Previous Topic: HOW CAN ONE COUNT NUMBER OF TABLES IN A SCHEMA
Next Topic: Re: Delete Records - DJW
Goto Forum:
  


Current Time: Fri Apr 19 08:29:04 CDT 2024