Hi,
>From the book:

EXEC SQL BEGIN DECLARE SECTION; 
    int    emp_number; 
    float  salary, commission; 
    short comm_ind;  /* indicator variable  */
EXEC SQL END DECLARE SECTION;
    char temp[16];
    float  pay;      /* not used in a SQL statement */
...
printf("Employee number? "); 
gets(temp);
emp_number = atof(temp);
EXEC SQL SELECT SAL, COMM 
    INTO :salary, :commission:ind_comm 
    FROM EMP 
    WHERE EMPNO = :emp_number; 
if(ind_comm == -1)    /* commission is null */
    pay = salary; 
else
    pay = salary + commission; 


--
Chris J. Guidry  P.Eng.
ATCO Electric, Metering Services
Phone: (780) 420-4142
Fax: (780) 420-3854
Email: [EMAIL PROTECTED]

> -----Original Message-----
> From: Mercadante, Thomas F [SMTP:[EMAIL PROTECTED]]
> Sent: Friday, October 19, 2001 09:25 AM
> To:   Multiple recipients of list ORACLE-L
> Subject:      RE: slightly OT: visual c++ and null values
> 
> Stefan,
> 
> OK.  can you help with a solution?  sounds like you have experience...
> :)
> 
> How about some coding examples?
> 
> Tom Mercadante
> Oracle Certified Professional
> 
> 
> -----Original Message-----
> Sent: Friday, October 19, 2001 10:05 AM
> To: Multiple recipients of list ORACLE-L
> 
> 
> Hi,
> 
> sorry for the strong language, but the statement that VC++ isn't able to
> retrieve NULL values is plain bullshit.
> 
>  ----------------------------
> | Regards,                   |
> | Stefan Jahnke              |
> | BOV AG                     |
> | @:D2 Vodafone, Abt.: FBOM  |
> | Tel.: 0211/533-4893        |
>  ----------------------------
> 
> Maria Aurora VT de la Vega schrieb:
> > 
> > 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: Maria Aurora VT de la Vega
> >   INET: [EMAIL PROTECTED]
> > 
> > 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: [EMAIL PROTECTED] (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).
> > 
> > ---------------------------------------------------------
> > This Mail has been checked for Viruses
> > Attention: Encrypted mails can NOT be checked!
> > 
> > **
> > 
> > Diese Mail wurde auf Viren geprueft
> > Hinweis: Verschluesselte mails koennen NICHT auf Viren geprueft werden!
> > ---------------------------------------------------------
> 
> --
> -- 
> Please see the official ORACLE-L FAQ: http://www.orafaq.com
> -- 
> Author: Stefan Jahnke
>   INET: [EMAIL PROTECTED]
> 
> 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: [EMAIL PROTECTED] (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).
> -- 
> Please see the official ORACLE-L FAQ: http://www.orafaq.com
> -- 
> Author: Mercadante, Thomas F
>   INET: [EMAIL PROTECTED]
> 
> 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: [EMAIL PROTECTED] (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).
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Guidry, Chris
  INET: [EMAIL PROTECTED]

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: [EMAIL PROTECTED] (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).

Reply via email to