Oracle Database
--
Questions
--
Followers
Top Experts
ORA-01405 - fetched column value is NULL
Im using a select statement in order to retreive data from the DB to my c program using OCI.
I use ORACLE DB 8 , OAS 4.0.7 on SUN SOLARIS 2.6 .
My select statement is :
"SELECT a,b,c FROM myTable WHERE x=:x"
a is a varchar2 , b&c are numbers in the DB.
In my code a is a text * b is an integer and c is long.
I get the Error in the title for executing yhis statement?
The DB does NOT have a NULL value at any column !
1)What can cause this problem ?
2)Is it because the OCIDefineByPos() ;
In the ORACLE TECHNET website they suggest to solve this problem with NVL functions - What are NVL functions , Where they can be found and how should I use them.
Thank you
sharone
I use ORACLE DB 8 , OAS 4.0.7 on SUN SOLARIS 2.6 .
My select statement is :
"SELECT a,b,c FROM myTable WHERE x=:x"
a is a varchar2 , b&c are numbers in the DB.
In my code a is a text * b is an integer and c is long.
I get the Error in the title for executing yhis statement?
The DB does NOT have a NULL value at any column !
1)What can cause this problem ?
2)Is it because the OCIDefineByPos() ;
In the ORACLE TECHNET website they suggest to solve this problem with NVL functions - What are NVL functions , Where they can be found and how should I use them.
Thank you
sharone
Zero AI Policy
We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.
ASKER CERTIFIED SOLUTION
membership
Log in or create a free account to see answer.
Signing up is free and takes 30 seconds. No credit card required.
MattBradeley thank you.
How do I prevent this error using the NVL - (if my column name is a_col)?
How it is placed around each selected column ?
What are indicator variables and how they are used ?
for correct answer i will arase the points.
sharone
How do I prevent this error using the NVL - (if my column name is a_col)?
How it is placed around each selected column ?
What are indicator variables and how they are used ?
for correct answer i will arase the points.
sharone
select nvl(a_col,'a'), nvl(b_col,'B') from table
This will return a,b if a_col and b_col are both null
For the best description on indicator variables check out the Pro*c user guide. They take the form of select a,b into :a.a_ind,:b.b_ind from table. The variabels can then be accessed to determine if a or b is null. Basically if a_ind > 0 then a is null...
This will return a,b if a_col and b_col are both null
For the best description on indicator variables check out the Pro*c user guide. They take the form of select a,b into :a.a_ind,:b.b_ind from table. The variabels can then be accessed to determine if a or b is null. Basically if a_ind > 0 then a is null...






EARN REWARDS FOR ASKING, ANSWERING, AND MORE.
Earn free swag for participating on the platform.
Oracle Database
--
Questions
--
Followers
Top Experts
Oracle is an object-relational database management system. It supports a large number of languages and application development frameworks. Its primary languages are SQL, PL/SQL and Java, but it also includes support for C and C++. Oracle also has its own enterprise modules and application server software.