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

  • Home
  • SEARCH
  • 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 869105
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T10:15:18+00:00 2026-05-15T10:15:18+00:00

Is it possible to correctly pass an OracleParameter to a boolean parameter in a

  • 0

Is it possible to correctly pass an OracleParameter to a boolean parameter in a pl/sql stored procedure?

  • 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-05-15T10:15:19+00:00Added an answer on May 15, 2026 at 10:15 am

    You can not use boolean parameters in SQL. So calling an stored procedure that takes or returns a boolean value won’t work in SQL. There is no problem using such a procedure from within a pl/sql block.

    ADDED from JCallico answer:

    I used the following workaround to bypass this limitation:

    1. Wrap the function call using an anonymous block.
    2. Return an output variable containing 1 or 0.
    3. Read the output variable and cast it to boolean.

    Here is some sample code:

    using (var connection = new OracleConnection("<connection string>"))
    {
        var command = new OracleCommand();
        command.Connection = connection;
        command.CommandText = 
            "declare v_bool boolean;" + 
            "begin " +
            "v_bool := auth_com.is_valid_username (:username); "+
            "if (v_bool = TRUE) then select 1 into :v_result from dual; end if; " +
            "if (v_bool = FALSE) then select 0 into :v_result from dual; end if; " +
            "end;";
    
        command.Parameters.Add(new OracleParameter { ParameterName = "username", OracleDbType = OracleDbType.NVarchar2, Size=512, Direction = ParameterDirection.Input });
        command.Parameters.Add(new OracleParameter { ParameterName = "v_result", OracleDbType = OracleDbType.Decimal, Direction = ParameterDirection.Output });     
    
        try
        {
            connection.Open();
            command.ExecuteNonQuery();
        }
        finally
        {
            connection.Close();
        }
    
        bool success = Convert.ToBoolean(((OracleDecimal)command.Parameters["v_result"].Value).ToInt32());
    }
    

    EDIT:

    Alex Keh from Oracle, october 2013:

    We’re planning on supporting ODP.NET Boolean in the managed provider
    in the near term, possibly in the middle of next year.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to pass a report parameter to a stored procedure (@Time) to
Possible Duplicate: mysql_fetch_array() expects parameter 1 to be resource, boolean given in select I'm
In C# is it possible to pass a class function(not static) as a parameter
Possible Duplicate: How to correctly unregister an event handler MSDN states the following two
Possible Duplicate: SmartGWT Dialog title not set correctly I have a problem, is that
In what situation would one want to pass false for the mayInterruptIfRunning parameter to
Possible Duplicate: How to pass JS variable to php? pass a js variable to
Not sure if this is possible or if I'm expressing correctly what I'm looking
I am trying to pass a JVM parameter for a variable configured in web.xml
Is it possible to pass the url attribute a dynamical query string? E.g url(

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.