On Fri, 24 Jan 2003 12:33:12 +1100 [EMAIL PROTECTED] wrote: > I start by apologizing if I am asking a question that I should have been > able to find if RTFM but I can not seem to find the answer to my seemingly > simple question. I will also comment that I am not a perl programmer nor a > database/sql expert as I am sure you will gather. > What I do have is a 3rd party reporting script written for me in perl using > a sybase database.
The fine manual is always a good place to start. http://xmlproj.com/fom-serve/cache/49.html I get the impression that your script is not doing any error checking since an error should have been raised from the SQL you show below. Look for $DBI::errstr, RaiseError, 'use strict', and '-w' in the fine DBI manual while you are reading it. > The script currently matches up a few attributes and tables and returns a > full record of stored DSN (delivery status notices). What I would like is > that it returns the collection EXCLUDING a dynamic email address. > > So if I hardcode the select file > SELECT data.data_msgid, data_recipient||data_status||data_timestamp > FROM data, doc_message, doc_state, input_state > WHERE data.data_msgid = doc_message.message_id > AND doc_state.input_queue_id = doc_message.input_queue_id > AND doc_state.input_job_id = doc_message.input_job_id > AND doc_state.doc_seq_num = doc_message.doc_seq_num > AND doc_state.proc_seq_num = doc_message.proc_seq_num > AND input_state.input_queue_id = doc_state.input_queue_id > AND input_state.input_job_id = doc_state.input_job_id > AND (doc_state.proc_state = '2' OR doc_state.proc_state = '3') > AND doc_state.input_queue_id = '$queue_id' > AND doc_state.input_job_id = '$job_id' > AND input_state.biller_short_name = '$appid' If $appid, or any of the other variables you are pasting into the SQL, contain any 'odd' characters, they could invalidate the SQL. > AND data_recipient != 'sample\@sample.com.au' > <mailto:'sample\@sample.com.au'> This is an excellent example of why placeholders should be used whenever possible. You should have gotten an error from prepare(). Look in the fine manual (perldoc DBI) for placeholders and quote(). > AND data.data_timestamp <= '$end_time' > ORDER BY data.data_timestamp"); > $sth->execute; -- Mac :}) ** I normally forward private questions to the appropriate mail list. ** Ask Smarter: http://www.tuxedo.org/~esr/faqs/smart-questions.html Give a hobbit a fish and he eats fish for a day. Give a hobbit a ring and he eats fish for an age.
