Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8214013
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T11:18:59+00:00 2026-06-07T11:18:59+00:00

I have a function inside an oracle package called TEST in an Oracle 10g

  • 0

I have a function inside an oracle package called TEST in an Oracle 10g database

FUNCTION GetEname(P_ename IN VARCHAR2) RETURN VARCHAR2 AS
retVal VARCHAR2(10);
BEGIN
retVal := SUBSTR(P_ename, 3, INSTR(P_ename, ':', 1, 2) - 3);

RETURN RetVal;

END GetEntDefIEIDFromEname;

I have created an ASP.net page and I have the following code in the page_load:

String strResult = "";
        try
        {   
            oracleConn.ConnectionString = ConfigurationManager.ConnectionStrings["OracleDatabase"].ConnectionString;
            oracleConn.Open();
            OracleCommand orclCmnd = new OracleCommand();
            orclCmnd.Connection = oracleConn;
            orclCmnd.CommandText = "TEST.GetEname";
            orclCmnd.CommandType = CommandType.StoredProcedure;

            OracleParameter ename = new OracleParameter();
            ename.ParameterName = "ename";
            ename.OracleType = OracleType.VarChar;
            ename.Direction = ParameterDirection.Input;
            ename.Value = "0:490330";
            orclCmnd.Parameters.Add(ename);

            strResult = (String)orclCmnd.ExecuteOracleScalar();

            oracleConn.Close();
            oracleConn.Dispose();

            lbl1.Text = "Result of  " + strResult;
        }                
        catch (Exception ex)
        {
            Console.Out.WriteLine(ex.ToString());
            oracleConn.Close();
        }

When I run the code I get the following error message:

“ORA-06550: line 1, column 7:\nPLS-00306: wrong number or types of
arguments in call to ‘GETENAME’\nORA-06550: line 1, column 7:\nPL/SQL:
Statement ignored\n”} System.Exception
{System.Data.OracleClient.OracleException}

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T11:19:02+00:00Added an answer on June 7, 2026 at 11:19 am

    You’re using a different name for the parameter in your code. Try changing

    ename.ParameterName = "ename";
    

    to

    ename.ParameterName = "P_ename";
    

    ALSO

    You need to add a parameter for the output value:

    OracleParameter result = new OracleParameter();
    result.OracleType = OracleType.VarChar;
    result.Direction = ParameterDirection.ReturnValue;
    orclCmnd.Parameters.Add(result);
    

    And get the value from the parameter after calling the function with ExecuteNonQuery:

    orclCmnd.ExecuteNonQuery();
    strResult = result.Value.ToString();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a function defined inside an Oracle package: CREATE OR REPLACE PACKAGE BODY
I have Oracle Package named DEF , with 1 function inside named ABC that
I have a function that is often called inside of other functions, and I'd
Inside the begining of a function I have this: if(false); { return 'TRUE'; }
I have this function inside another function: def _sum(k): return sum([(-1) ** v *
I have an AJAX function inside a javascript file and I want it to
I have a function defined inside the script tags of head.(in a JSP) I
I have the following function defined inside my linked list class. The declaration in
Inside my Controller i have function that runs after user clicks on item, which
I have a bit of a quandary. I need to call a function inside

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.