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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T16:23:09+00:00 2026-06-05T16:23:09+00:00

I want to do array fetch for DATE in oracle with following code. It

  • 0

I want to do array fetch for DATE in oracle with following code. It compiles alright and export all other data types correctly, except for the DATE type. The program says “ora-32146 cannot peform operation on a null date”.

Any one can see where I am wrong?

    Statement *stmt = conn->createStatement("SELECT AGE,CASH2, BIRTHDATE from myTable2"); /*, CASH1, CASH2, BIRTHDATE*/
    //stmt->setMaxParamSize(1,sizeof(Number));
    ResultSet *rs=stmt->executeQuery();
    string myName[400];
    int myAge[400];
    double myCash1[400];
    double myCash2[400];
    oracle::occi::Date myBirthDate[400];

    //rs->setDataBuffer(1,myName,OCCI_SQLT_STR,sizeof(string));
    rs->setDataBuffer(1,myAge,OCCIINT,sizeof(int));
    rs->setDataBuffer(2, myCash2, OCCIBDOUBLE, sizeof(double),NULL);
    rs->setDataBuffer(3, myBirthDate,OCCI_SQLT_DATE, sizeof(oracle::occi::Date),NULL);

    while (rs->next(200)==ResultSet::DATA_AVAILABLE)
    {
        //cout << "Exporting batch..." << endl;
        for(size_t i=0;i<rs->getNumArrayRows();i++)
        {
            //cout << myName[i] << endl;
            cout << myAge[i] << endl;
            //cout << myCash1[i] << endl;
            cout << myCash2[i] << endl;
            int y;
            unsigned int m,d,h,mm,s;
            myBirthDate[i].getDate(y,m,d,h,mm,s);
            cout << y <<"-"<<m<<"-"<<s << endl;
        }
    }
  • 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-05T16:23:11+00:00Added an answer on June 5, 2026 at 4:23 pm

    Figured it out.

    using rs->setDataBuffer(3, myBirthDate,OCCI_SQLT_DAT, 7,NULL);

    works out all right.

    No good document on OCCI…

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

Sidebar

Related Questions

I have an array of strings: @array I want to concatenate all strings beginning
I fetch an array with todo titles and due dates from MySQL. I want
I want to know how to fetch single row from Oracle in PHP? Chedck
I want to echo out each date in my Array within a PHP file.
Hy all..I have a table where I'm storing the date in the following format:
I have one array. I want that array to retain its value between function
Let's say I have integer variables x and y, and I want an array
I m making a Shooting game, in that I want an array of ImageViews
I want create an array in JSF EL. How can I do that? Is
I want to sort array A based on values in Array B actually in

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.