Home » RDBMS Server » Server Administration » is NULL and cursor
is NULL and cursor [message #370573] Mon, 27 December 1999 09:01 Go to next message
Semenov
Messages: 6
Registered: December 1999
Junior Member
Hello all!

I have a procedure ^

procedure debkred_form_handle(
fil in varchar2,
date_b in varchar2,
nbsp in varchar2, nbsp2 in varchar2,
kodvp in varchar2, kodvp2 in varchar2,
klup in varchar2, klup2 in varchar2,
notdp in varchar2, notdp2 in varchar2)
is

cursor c1 is select * from debkred where nl=substr(fil,1,2) and dinf=to_date(date_b,'dd/mm/yy') and nbs1 = nbsp and kodv1=kodvp and klu1=klup and notd1=notdp
and nbs2 = nbsp2 and kodv2=kodvp2 and klu2=klup2 and notd2=notdp2;


begin

htp.print(fil||date_b||nbsp||kodvp||klup||notdp);
end;

But here is one problem i can't solve. To the procedure we can pass a few NULL parameters...i mean debkred_form_handle(NULL,'10/12/99' etc) and if we have only one NULL parameter then cursor c1 is not working... If we have in the cursor declaring something like that ----

c1 is select from .... where fil is null

then everybody is ok. But situation where fil=NULL did'nt work. How can i improve it?

Thanks for any suggestion. And sorry for ad english -)
Re: is NULL and cursor [message #370574 is a reply to message #370573] Mon, 27 December 1999 10:19 Go to previous messageGo to next message
hmg
Messages: 40
Registered: March 1999
Member
Try this

   where nvl(nl,'XXX')=nvl(substr(fil,1,2),'XXX')

'XXX' has to be a value which never will occur
in column nl and in parameter fil.
Re: is NULL and cursor [message #370579 is a reply to message #370574] Tue, 28 December 1999 05:43 Go to previous messageGo to next message
semenpov
Messages: 2
Registered: December 1999
Junior Member
Thank u HMG !
Re: is NULL and cursor [message #370580 is a reply to message #370574] Tue, 28 December 1999 05:43 Go to previous message
semenpov
Messages: 2
Registered: December 1999
Junior Member
Thank u HMG !
Previous Topic: Creating columns
Next Topic: QUERY/SQL/PLSQL
Goto Forum:
  


Current Time: Sat Oct 31 19:49:41 CDT 2020