Home » Developer & Programmer » Precompilers, OCI & OCCI » ORA-01405: fetched column value is NULL
ORA-01405: fetched column value is NULL [message #180282] Sun, 02 July 2006 19:28 Go to next message
mymot
Messages: 225
Registered: July 2005
Senior Member
Hi,

I am getting below error while running pl/sql code in Pro * C.

ORA-01405: fetched column value is NULL

After going through documentation its suggesting to use NVL or indicator.

Now suppose in below sample query, how can i find out which column needs inidicator / NVl

short *my_ind1;

table1.a (not null)
table1.b null
table2.c null
table2.d not null

Cursor test is
select a, b, c ,d from aa, bb,cc where <some conditions>

Fetch test into :p
                :q:my_ind1
                :r
                :s;

should it mean use NVL /INDICATOR for table2.c field only in above query to prevent ORA-01405 Problem.



thanks

[Updated on: Sun, 02 July 2006 21:47]

Report message to a moderator

Re: ORA-01405: fetched column value is NULL [message #180301 is a reply to message #180282] Mon, 03 July 2006 00:35 Go to previous messageGo to next message
Frank Naude
Messages: 4581
Registered: April 1998
Senior Member
Rewrite your query:

Cursor test is
select a, b, nvl(c,'QWE'), d from aa, bb, cc where ...

Or use an indicator with c. For more info, see http://www.orafaq.com/faq/what_is_an_indicator_variable_and_why_should_i_use_it
Re: ORA-01405: fetched column value is NULL [message #180382 is a reply to message #180301] Mon, 03 July 2006 06:03 Go to previous message
mymot
Messages: 225
Registered: July 2005
Senior Member
Thanks Frank.
Previous Topic: Using the SQLCA (Proc*C) to check for problems relating to connections
Next Topic: SQL-02115: From Pro*C
Goto Forum:
  


Current Time: Tue Dec 03 13:26:55 CST 2024