Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: slightly OT: visual c++ and null values
Maria,
They need to use indicator variables. This is documented in the Pro*C
documentation. The application that I wrote is two years old but is still
operational against a 8.1.x database. I tried to find a small snippet of code
to include but since I haven't worked on the application in about two years
couldn't find anything quickly.
The gist of it is though that you define short integer variables in addition to your variable to hold your column value. The column is then referenced in the select/update statement as a concatenation of the two variables. :column_name:indicator then if the indicator is <0 the column variable has undefined value (NULL). For inserts/updates the user sets the indicator to -1 and Pro*C interpretes the value as a NULL.
I admit that my version of Visual C++ is old 5.0 and my version of Pro*C is 8.0.5 but this does work against a 8.1.x database (on Compaq) but I haven't seen anything to indicate that they were getting away from indicator variables.
Shari Dishop
SAP ABAP Development - Project Systems Team
Northrop Grumman Information Technology
Baltimore, MD
>hello!
>
>our developers here are requesting that I put defaults (' ' for
>chars/varchars, 0 for numbers, etc) in place instead of nulls in all
>columns that would supposedly allow null values...
>they are using visual c++ and they say that they cannot make visual c++
>retreive null values...
>i am very hesitant in implementing this...
>i have no knowledge whatsoever of visual c++ and don't know if this is
>true...
>
>i'd like to know if anyone had encountered this same problem before?
>or maybe someone can tell me if there is any truth to what our
>developers are saying...
>
>
>oracle817 on solaris7
>
>thanks =)
>
>--
>Maria Aurora VT de la Vega (OCP)
>Database Specialist
>Philippine Stock Exchange, Inc.
-- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Shari Dishop INET: DISHOP_at_bullet.md.essd.northgrum.com Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists -------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).Received on Fri Oct 19 2001 - 09:08:36 CDT
![]() |
![]() |