Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: Passing in NULL via SQL ACCEPT
ACCEPT <variable> PROMPT 'message' DEFAULT 0
-- Chris J. Guidry P.Eng. EE ATCO Electric, Metering Services Phone: (780) 420-4142 Fax: (780) 420-3854 Email: chris.guidry_at_atcoelectric.comReceived on Wed Mar 13 2002 - 09:43:31 CST
> -----Original Message-----
> From: Magaliff, Bill [SMTP:Bill.Magaliff_at_lendware.com]
> Sent: Wednesday, March 13, 2002 07:43 AM
> To: Multiple recipients of list ORACLE-L
> Subject: Passing in NULL via SQL ACCEPT
>
> I'm writing an anonymous PL/SQL block that accepts various input from
> SQL*Plus via ACCEPT commands. I then take the SQL input and use it in the
> block, usually by assigning it to a PL/SQL variable.
>
> If no value is specified on the ACCEPT line, it appears that nothing is
> passed into PL/SQL, not even NULL. I tried using NVL(&&variable,0) to
> reassign the supposed NULL to a 0, but the program returns an error that
> nothing exists in place of &&variable.
>
> Any ideas how to catch this null, which I want to be a viable option
> (e.g.,
> if the &&varible is NULL then perform certain operations).
>
> Thanks much
> --
> Please see the official ORACLE-L FAQ: http://www.orafaq.com
> --
> Author: Magaliff, Bill
> INET: Bill.Magaliff_at_lendware.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).
-- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Guidry, Chris INET: chris.guidry_at_atcoelectric.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).
![]() |
![]() |