Cannot fetch rows with float values under Oracle 10g

35 pts.
Tags:
float values
OCIStmtExecute
Oracle
Oracle 10g
We are currently porting applications from a DEC Unix environment to Solaris. Our previous Oracle version was 8i and we are now using 10g on the Solaris system. We have several tables and are able to insert and fetch from all excpet one of the defined tables. The one table causing the issue contains a mix of string, integer and floating point values. The definitions of the string and the integers from the old server to the new one has not changed. The floating values had been defined as "FLOAT" under 8i but under 10g they are "FLOAT(126)". We are able to insert rows into this table without error, and we are able to fetch all rows in this table using SQL. The problem is that our application, using OCIStmtExecute, receives a -2 return status when the initial fetch is attempted and we continue down an error path. Any thoughts as to why the SQL retrievals are successful but our application (C interface) is not? Is it conceivable that the float values inserted by the same C definition is expanded to fit the "FLOAT(126)" definition and when the fetch is attempted, the supplied float variable is not large enough to hold the expanded value but the SQL query is? Any thoughts on the topic would be appreciated.

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Discuss This Question: 5  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • carlosdl
    Just to clarify things a little: Are you getting a return value of -2 when calling OCIStmtExecute, or when calling OCIStmtFetch ? I think -2 means an invalid handle. Have you checked the statement handle before executing the statement ? Also, what type are you using when binding to the column ? is it SQLT_FLTor SQLT_NUM ?
    70,220 pointsBadges:
    report
  • Midwesthumptard
    Carlosdl, 1) I am receiving the -2 return value on the OCIStmtExecute. 2) I'm not sure how to "check" the statement handle, it is being used successfully on two calls made by our application (initialization and define) immediately before the negative status return. 3) We are using "SQLT_FLT" for the floating point values. I hope that helps.
    35 pointsBadges:
    report
  • carlosdl
    For the statement handle I think the only thing to check is that it is not null, but if you have already used it, then maybe the problem is not the statement handle, but the service context handle. Aside from checking that the service context handle is not null, I think you could make a call to OCIAttrGet to read some attribute (OCI_ATTR_IN_V8_MODE for example), so you can confirm whether the handle is valid. Have you successfully executed other SQL statements from this application ?
    70,220 pointsBadges:
    report
  • Midwesthumptard
    Carlosdl, Good idea to check for non-null, I will add that to my application, it certainly can't hurt. The handle is used often but that doesn't mean it could not be getting cleared. Checking the attributes could be educational also. This application successfully inserts rows into this same table and fetches rows from another table, although the other fetch contains only strings in the rows. I will check the handle and get some attribute information while I work with our database guy to try and store the values as strings to see if that results in a successful fetch. If that approach works, I will have to do some local conversions to provide the floating point values to the other users. I'll let you know how the checks for the handle and the attributes works out. Thanks for the information.
    35 pointsBadges:
    report
  • Midwesthumptard
    Service and statement handles are not null. Will check the attributes next.
    35 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following