1
我試圖執行一個Oracle SQL語句或通過Microsoft VBScript中的Oracle功能和循環throught結果集或顯示如何使用VBScript
到目前爲止,我有函數返回值來執行一個Oracle SQL語句設法通過SQLPlus *連接到Oracle,但現在我卡住了。任何人都可以幫忙嗎?
Dim output
Dim WshShell, oExec, input
set WshShell = CreateObject("WScript.Shell")
set oEnv=WshShell.Environment("Process")
cmdString = "C:\Oracle\11g\product\11.1.0\ruby\BIN\sqlplus.exe -S stradmin/[email protected] select * from dual"
Set oExec = WshShell.Exec(cmdString)
WScript.Echo "Status" & oExec.Status
Do While oExec.Status = 0
WScript.Sleep 2
Loop
input = ""
Do While Not oExec.StdOut.AtEndOfStream
input = input & oExec.StdOut.Read(1)
Loop
wscript.echo input