Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> ?retrive sql text from a stored proc

?retrive sql text from a stored proc

From: rob merritt <merritt.robert_at_spsd.sk.ca>
Date: 3 May 2002 22:59:46 -0700
Message-ID: <b6bf97d5.0205032159.1d704e34@posting.google.com>


hi

I am doing some consulting work for an k12 institution. The provincial
edu department has a oracle db that is queryed buy this division via a excel ss given to them buy the provincial edu. In the ss a sp is run to retrive data
for one grade we were hoping to customize the query a bit to get more demographics on all grades. can i get the text of a query that is run thusly:
sqlStr = "dbo.up_s_batch_stats_EXCEL " & Val(Range("G8").Value)

ie get the SELECT .... FROM... that is run by dbo.up_s_batch_stats_EXCEL

Sub batchStats()
On Error GoTo eh
'If Format(Time, "HH:MM") >= Format("08:00", "HH:MM") And Format(Time, "HH:MM") <= Format("17:00", "HH:MM") Then

'    MsgBox "This query can only be run before 8 AM or after 5 PM"
'    Exit Sub
'End If
 

 Range("A2").Select

    Dim sqlStr As String
    sqlStr = "dbo.up_s_batch_stats_EXCEL " & Val(Range("G8").Value)     

    With Selection.QueryTable

.Connection = _

        "ODBC;DRIVER=SQL Server;SERVER=LTDBPRDCL;APP=Microsoft® Query;DATABASE=cnv_ttl_prd;Trusted_Connection=Yes"

.Sql = sqlStr
.Refresh False

    End With     

    MsgBox "Data refreshed!"
    Exit Sub
eh:

    If Err.Number = 1004 Then

        MsgBox "This query can only be run before 8 AM or after 5 PM"     Else

        MsgBox Err.Number & " " & Err.Description     End If
End Sub Received on Sat May 04 2002 - 00:59:46 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US