Skip to Main Content

ODP.NET

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

PLS-0221 Error in VB.NET 2008

479780Sep 22 2009 — edited Sep 24 2009
Hello Guys

I need help in resolving a problem I'm having regarding the above error. I have a packaged function which works fine when executed from SQL Developer and SQL*Plus. When I execute this same function from my VB.NET code, I get the PLS-0221 "GET_FULL_NAME is not a procedure or undefined". I know the function is defined and valid because I can execute it outside VB.NET and get a return vaule. I have checked the code over and over again but cannot find what is wrong with it. Can someone please help.


Private Sub OK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OK.Click
Dim cn As New OracleConnection(MHMS_Module.getConnectionString)
Dim iv As New OracleParameter

cn.ConnectionString = getConnectionString()

Try
Dim mycmd As New OracleCommand("MHMS_Package.Get_Full_Name", cn)

cn.Open()
mycmd.CommandType = CommandType.StoredProcedure

mycmd.Parameters.Add(New OracleParameter("varFullName", OracleDbType.Varchar2, 30, ParameterDirection.Input)).Value = txtUsername.Text

mycmd.ExecuteNonQuery()
iv = mycmd.Parameters.Add(New OracleParameter("RetVal", OracleDbType.Varchar2, 100, ParameterDirection.ReturnValue))

MDI_Parent.txtUserFullName.Text = (mycmd.Parameters("RetVal").Value.ToString())

Catch ex As Exception ' catches any error
MessageBox.Show(ex.Message.ToString())
End Try

cn.Close()

End Sub


(This is the packaged Function)
FUNCTION Get_Full_Name(varUsername IN VARCHAR2) RETURN VARCHAR2
IS
varFullName VARCHAR2 (100);
BEGIN
SELECT FIRST_NAME||' '||LAST_NAME
INTO varFullName
FROM MHMS_USER
WHERE USERNAME = varUsername;

RETURN varFullName;

END Get_Full_Name;
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 22 2009
Added on Sep 22 2009
7 comments
1,785 views