I'm a newbie myself, but if I understand you correctly, you just need to
check if the SQL query returns a defined value?

simply:

if (!defined($sql)){
        do something...
}
else {
do something else
}

or:

print "sorry" if !defined($sql);

print "Yippee" if defined($sql);

Joni

-----Original Message-----
From: Daniel Falkenberg [mailto:[EMAIL PROTECTED]]
Sent: 23 July 2001 00:42
To: '[EMAIL PROTECTED]'
Subject: Testing for truth


List,

I would like to be able to test my SQL query for truth. To do this I would
like to be able to do a SELECT query and if the colunm contains nothing I
would like my script to be able to return and tell me this. As an example.
if I do a SELECT statement as follows....

SELECT test FROM support WHERE unique_id ='1234'

If test = '(NOTHING)'  print Sorry the search retuned no results please
search again. 
elsif test = 'hello world' print here are the results for your search.  

I can do this exact same thing if I am searching with numeric values such as
data and time.  But can't seem to return a true statement if the column
contains some words?

Any ideas?

Thanks in advance.

Regards,

Daniel Falkenberg


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to