Home » SQL & PL/SQL » SQL & PL/SQL » how use the if condition to check inputs in pl sql
how use the if condition to check inputs in pl sql [message #36506] Sat, 01 December 2001 03:14 Go to next message
sridhar
Messages: 119
Registered: December 2001
Senior Member
Iam trying to use the if condition to check the value of the inputs that i get through html.the IF condition that i use in the pl sql procedure is not checking the
value that i read.
The code looks slike this
if (custid='') then <stattements>.

the custid is of type varchar.how to check this inorder to execute the statements taht proceed.

also Iam not able check for the exixtance the custid taht is already present in the table.

I tried to do this by using the following query

select count(*) into num from
where <nameof the variable>=cusid

then i tried to implement the other parts if the number is 0.
but that too is not working.

what is the way to check for the existance a given value in a table and also chek whether it is not null..

some one pls help me

thanks

sridhar

----------------------------------------------------------------------
Re: how use the if condition to check inputs in pl sql [message #36507 is a reply to message #36506] Sat, 01 December 2001 04:37 Go to previous message
Suresh Vemulapalli
Messages: 624
Registered: August 2000
Senior Member
1) check for null
IF custid is null then

2) select count(*) into l_count
from table_name where custid='123';

----------------------------------------------------------------------
Previous Topic: Fetching Errors in a Table
Next Topic: Re: PL/SQL ; SQL plus
Goto Forum:
  


Current Time: Tue Mar 31 12:02:04 CDT 2020