RE: Testing for truth

2001-07-23 Thread PURMONEN, Joni
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

RE: automating database dumps

2001-07-19 Thread PURMONEN, Joni
Use crontab (unix command, which executes a given script automatically in given times) to invoke a shell script... Maybe this can be done in perl as well, I don't know, but I'd use a simple shell script for this kind of jobs. Hope this helps, Joni -Original Message- From: Pavan Kumar Ho

RE: ? embed scalars in the sql

2001-06-26 Thread PURMONEN, Joni
Take the safe option and assign the SQL query to a string before using it. The placeholders are ok with this as well. my $sql = qq(select * from testami where ? = ? and ? = ?); $sth = $dbh -> prepare($sql); $sth -> execute($field1, $value1, $field2, $value2); #$sth -> execute(); Hope you didn