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 6202781
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T04:47:54+00:00 2026-05-24T04:47:54+00:00

Here’s my statement from my C# program: (edit by gbn, formatted for clarity so

  • 0

Here’s my statement from my C# program:

(edit by gbn, formatted for clarity so not all on one line)

DbCommand.CommandText =
             @"SELECT 
      HIST.MBRSEP, HIST.LOCATION, HIST.BILLTYPE, HIST.BILLMOYR, LOCINFO.CYCLE, 
      LOCINFO.DIST, LOCINFO.LOCATION
    FROM 
      (CAV_MBRHISTDEL AS HIST INNER JOIN CAV_LOCINFODETL AS LOCINFO ON HIST.LOCATION = LOCINFO.LOCATION)
    WHERE
       LOCINFO.CYCLE = @CYCLE AND 
       LOCINFO.DIST = @DISTRICT AND 
       HIST.BILLTYPE = '09' AND 
       HIST.BILLMOYR <> '9999'";

Here’s the error message:

ERROR [HY000] [Oracle][ODBC][Ora]ORA-00907: missing right parenthesis

There’s only 2 parenthesis in my SQL statement, a right one and a left one. I’m not sure what the error is telling me. Any advice?

EDIT: Here is how the parameters are defined:

        string cycle = cbCycle.Text;
        string district = cbDistrict.Text.Substring(0,2);

And here is where I add them to the DbCommand:

        DbCommand.Parameters.AddWithValue("@CYCLE", cycle);
        DbCommand.Parameters.AddWithValue("@DISTRICT", district);

Here’s my complete code that triggers when someone clicks the ‘Go’ button on my form:

private void btnGo_Click(object sender, EventArgs e)
    {
        //get parameters
        string cycle = cbCycle.Text;
        string district = cbDistrict.Text.Substring(0,2);

        //create a connection to the database
        OdbcConnection DbConnection = new OdbcConnection("DSN=UPN2;uid=xxx;pwd=xxxx");
        DbConnection.Open();

        //create a command to extract the required data and
        //assign it to the connection string
        OdbcCommand DbCommand = DbConnection.CreateCommand();
        DbCommand.CommandText =
             @"SELECT HIST.MBRSEP, HIST.LOCATION, HIST.BILLTYPE, HIST.BILLMOYR, LOCINFO.CYCLE, LOCINFO.DIST, LOCINFO.LOCATION FROM CAV_MBRHISTDEL AS HIST INNER JOIN CAV_LOCINFODETL AS LOCINFO ON HIST.LOCATION = LOCINFO.LOCATION WHERE LOCINFO.CYCLE = @CYCLE AND LOCINFO.DIST = @DISTRICT AND HIST.BILLTYPE = '09' AND HIST.BILLMOYR <> '9999'; ";

        DbCommand.Parameters.AddWithValue("@CYCLE", cycle);
        DbCommand.Parameters.AddWithValue("@DISTRICT", district);

        //Create a DataAdapter to run the command and fill the datatable
        OdbcDataAdapter da = new OdbcDataAdapter();
        da.SelectCommand = DbCommand;
        DataTable dt = new DataTable();
        da.Fill(dt);


        tbOutput.Text = PrintDataTable(dt);

        DbCommand.Dispose();
        DbConnection.Close();

    }
  • 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-24T04:47:55+00:00Added an answer on May 24, 2026 at 4:47 am

    the problem might be that you are using an oracle reserved word as a column name and as a param name – namely CYCLE…
    doing so might result in strange and erratic behaviour of the DB!

    see http://download.oracle.com/docs/cd/B19306_01/em.102/b40103/app_oracle_reserved_words.htm

    Depending on your db provider you might want to use : instead of @ for params.

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

Sidebar

Related Questions

Here's my code: // Not all headers are relevant to the code snippet. #include
Here's what I'm trying to accomplish with this program: a recursive method that checks
Here is my query: SELECT * FROM [GeoName] WHERE ((-26.3665122100029-Lat)*(-26.3665122100029-Lat))+((27.5978928658078-Long)*(27.5978928658078-Long)) < 0.005 ORDER BY
Here's a query that works fine: SELECT rowid as msg_rowid, a, b, c FROM
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
Here is a function from Dreamweaver, if (($strUsers == ) && false) what the
Here's a basic regex technique that I've never managed to remember. Let's say I'm
Here's a problem I ran into recently. I have attributes strings of the form
Here is the issue I am having: I have a large query that needs
Here's my scenario - I have an SSIS job that depends on another prior

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.