Avatar of fairrington
fairrington

asked on 

How do I call a stored procedure (ASP.net) using the IBM provided OLE DB driver. I'm getting an error message.

I'm trying to call a simple stored procedure that takes an input parm (string), does a look up, and returns an output parm (string).  I'm using ASP.NET (VS 2008) using the 2.0 framework.  I'm calling an IBM DB2 9.1 LUW database running on Windows 64-bit through OLEDB .  Here is the message I keep getting when trying to call this program.

There was an error. IBM OLE DB Provider for DB2 [DB2/NT64] SQL0444N Routine "*FOR_ZONE" (specific name "SQL080717085156720") is implemented with code in library or path "\FTC.LOOKUP_STATE_FOR_ZONE", function "*TE_FOR_ZONE" which cannot be accessed. Reason code: "4". SQLSTATE=42724  

Please help.
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs)
        Dim cnn As New OleDbConnection("Provider=IBMDADB2.DB2COPY1;Data Source=TM_REPORTING_00004;Persist Security Info=True;Password=123456;User ID=rfuser")
        Dim cmd As New OleDbCommand("FTC.LOOKUP_STATE_FOR_ZONE", cnn)
        cmd.CommandType = CommandType.StoredProcedure
        
        cmd.Parameters.Add("IN_ZIP", OleDbType.WChar)
        With cmd.Parameters("IN_ZIP")
            .Direction = ParameterDirection.Input
            .Size = 10
            .Value = TextBox1.Text
        End With
        cmd.Parameters.Add("OUT_STATE", OleDbType.WChar)
        With cmd.Parameters("OUT_STATE")
            .Direction = ParameterDirection.Output
            .Size = 4
            .Value = " "
        End With
        
 
        Try
            cnn.Open()
            cmd.ExecuteNonQuery()
            Label1.Text = cmd.Parameters("OUT_STATE").Value
 
        Catch ex As Exception '
 
            Label1.Text = "There was an error. " & ex.Source & " " & ex.Message
 
        Finally
            
            cnn.Close()
            cnn.Dispose()
 
        End Try
    End Sub

Open in new window

ASP.NETDB2

Avatar of undefined
Last Comment
fairrington
ASKER CERTIFIED SOLUTION
Avatar of momi_sabag
momi_sabag
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of fairrington
fairrington

ASKER

We don't have a dba on site.  We purchased the software from a third party vendor.  I'm the dba in training.  Is there something I can look at in the database to see that the path environment is set up correctly?  I looked at the procedure through Toad and it shows the "SQL path at the time the routine was created" is null.

Thanks,
Steve
SOLUTION
Avatar of Kent Olsen
Kent Olsen
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
Avatar of fairrington
fairrington

ASKER

Thanks.  It was a library (schema) issue, so it couldn't find the procedure name.
ASP.NET
ASP.NET

The successor to Active Server Pages, ASP.NET websites utilize the .NET framework to produce dynamic, data and content-driven web applications and services. ASP.NET code can be written using any .NET supported language. As of 2009, ASP.NET can also apply the Model-View-Controller (MVC) pattern to web applications

128K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo