Microsoft
Software
Hardware
Network
Question : stored procedure
i am having trouble gettting a stored procedure to work. Using the following code i get this error:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E37)
[IBM][Client Access Express ODBC Driver (32-bit)][DB2/400 SQL]SQL7967 - PREPARE of statement QZ92D3E2CF9BFB1000 completed.
this is the code..its failing on the Execute statement.
Dim rsRETax,NewConnxRETax,NewC
ommandxRET
ax
set NewConnxRETax = server.CreateObject("ADODB
.Connectio
n")
NewConnxRETax.Open "test","gblodbc","odbcgbl"
set NewCommandxRETax = server.CreateObject ("ADODB.Command")
set NewCommandxRETax.ActiveCon
nection = NewConnxRETax
NewCommandxRETax.CommandTe
xt = "getOpenDvirByChassis"
NewCommandxRETax.CommandTy
pe = 4
NewCommandxRETax.Parameter
s.Append NewCommandxRETax.CreatePar
ameter("te
rm-code",2
00,1,30)
NewCommandxRETax.Parameter
s.Append NewCommandxRETax.CreatePar
ameter("ch
assis-numb
er",200,1,
30)
NewCommandxRETax("term-cod
e") = "GBLDEV"
NewCommandxRETax("chassis-
number") = "APLZ330211"
set rsRETax = NewCommandxRETax.Execute
set rsRETax = rsRETax.NextRecordset()
While not rsRETax.eof
Response.Write "*" & rsRETax(0) & "*" & rsRETax(1) & "<br>"
rsRETax.MoveNext
Wend
Answer : stored procedure
SQL7967 indicates successful completion of the PREPARE.
ado probably just isn't capturing the correct message - SQL7967 is not generally an exception message.
DB2 can issue multiple messages. There is probably a previous or subsequent message that was issued that indicates the real error. The job log from the database server job that handled the request may have additional messages that provide more detail.
Most likely, the prepared statement is invalid. Find the variable that contains the prepared statement and check it for validity. Are all the table names and column names valid? Do you have the correct number and type of parameters?
Take the prepared statement and run it interactively using the green-screen STRSQL command and see if it succeeds.
Here are detailed steps on how to troubleshoot ODBC errors:
http://publib.boulder.ibm.
com/infoce
nter/iseri
es/v5r4/
in
dex.jsp?to
pic=/rzaii
/rzaiiodbc
22.htm
- Gary Patterson
Random Solutions
Create subdomain in iis7 w2008 server
OCS 2007 R2 and Cisco call manager
Terminal server 2008 R2 Pinned Taskbar Links
Move applications between networked computers
Windows Update Error on Hyper-V guest on a HP Proliant ML370 G6 (NC375i network card)
Select All Columns Count Column Group By Only One Column?
Windows 7 recently used programs is blank
why can't autocomplete after div is loaded via ajax when autocomplete is in the div box
SpellNumber
Can't Figure Out How to Turn Off PHP Display Errors