DBAsupport.com Forums - Powered by vBulletin
Results 1 to 4 of 4

Thread: Oracle SP in ASP.NET

Hybrid View

  1. #1
    Join Date
    Jul 2003
    Posts
    2

    Oracle SP in ASP.NET

    I am creating an asp.net application and this is my first time using an Oracle back-end and I'm a bit confused.

    I'm getting this error:

    ORA-06550: line 1, column 7: PLS-00201: identifier 'GETCURRENTPOLLQUESTIONID' must be declared ORA-06550: line 1, column 7: PL/SQL: Statement ignored

    The information I've found on the net seems unrelated to my problem.

    This is the Stored Procedure:

    PROCEDURE GETCURRENTPOLLQUESTIONID
    (
    PARAM_MODULEID IN NUMBER,
    PARAM_QUESTIONID OUT NUMBER
    )
    IS
    BEGIN

    SELECT QUESTIONID INTO PARAM_QUESTIONID FROM POLLQUESTIONS
    WHERE MODULEID = PARAM_MODULEID;

    EXCEPTION WHEN NO_DATA_FOUND THEN

    PARAM_QUESTIONID := -1;

    END;


    And here's my function where I'm trying to use the Oracle SP above called GETCURRENTPOLLQUESTIONID.

    Public Shared Function GetQuestionID(ByVal moduleId As Integer) As Integer

    Dim myConnection As New OracleConnection(ConfigurationSettings.AppSettings("connectionString"))
    Dim myCommand As New OracleCommand("GETCURRENTPOLLQUESTIONID", myConnection)

    ' Mark the Command as a SPROC
    myCommand.CommandType = CommandType.StoredProcedure

    ' Add Parameters to SPROC
    Dim parameterModuleId As New OracleParameter("PARAM_MODULEID", OracleType.Int32, 4)
    parameterModuleId.Value = moduleId
    myCommand.Parameters.Add(parameterModuleId)

    Dim parameterQuestionId As New OracleParameter("PARAM_QUESTIONID", OracleType.Int32, 4)
    parameterQuestionId.Direction = ParameterDirection.Output
    myCommand.Parameters.Add(parameterQuestionId)

    ' Open the database connection and execute SQL Command
    myConnection.Open()
    myCommand.ExecuteNonQuery()
    myConnection.Close()

    If parameterQuestionId.Value Is System.DBNull.Value Then
    Return -1
    Else
    Return CInt(parameterQuestionId.Value)
    End If

    End Function

    I appreciate any responses.

    Trin

  2. #2
    Join Date
    Jan 2003
    Location
    Hull, UK
    Posts
    220
    Hi,

    Try to put the procedure inside a package

    and call it using packagename.procedurename in ASP.NET

    That should work i suppose,

    Cheers

    Srini

  3. #3
    Join Date
    Jul 2003
    Posts
    2
    Hey thanks so much Srinivas! That got rid of the error, sure enough.
    Trin

  4. #4
    Join Date
    Jan 2003
    Location
    Hull, UK
    Posts
    220
    No Problem

    Srini

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width