Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Retrieve Trigger Source
Hi All,
In order to retrieve the complete source of an existing ORACLE trigger
with Visual Basic code via ADO I am aware that we have to use the
GetChunk method of the ADO field object.
Dim lngSize As Long
Dim lngOffset As Long
Dim varChunk As Variant
Dim varAll As Variant
Dim rs1 As New ADODB.Recordset
rs1.Source = "select trigger_body from user_triggers where
trigger_name = " & "'" & Me.DataCombo1.Text & "'"
rs1.ActiveConnection = goConnection
rs1.Open , , adOpenStatic, adLockOptimistic
lngSize = 8000 'or: rs1.Fields(0).ActualSize ??? Do While lngOffset < lngSize
'**************************************
varChunk = rs1.Fields(0).GetChunk(1000)
'**************************************
varAll = varAll & varChunk
lngOffset = lngOffset + 1000
Loop
Me.RichTextBox1.Text = varAll
With SQL*Plus, when I set the LONG environment variable to say 8000 I
can get the whole <trigger_body> statement in one chunk. But why does
my VB code above not work? I keep getting only the first 90 or so
characters (the first 3 lines, truncated)!
Any suggestions?
Thanks in advance.
Paul
Received on Sat Nov 02 2002 - 08:42:28 CST