Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
My program uses Perl DBI to connect to Oracle database, I have an strange issue as explained below-
I have a select query in my program, which uses to compare data between two dates (start date and end date)and selects it,
( WHERE REC_STATUS = 'A' and UCSIIU_RECEIPT_AT_MOT_DT between to_date( +? ,'mm/dd/yyyy') and to_date(?,'MM/DD/YYYY ) ) OR (UCSIIU_RECEIPT_AT_MOT_DT between to_date(?,'mm/dd/yyyy') and to_da +te(?,'MM/DD/YYYY) AND REC_STATUS = 'I'))
I found that when I pass these four parameters as variable (using bind_param function), the perl script is taking four to five hours to execute the query ($sth->execute) in the perl script, however when I hard code these parameters (dates) in the select query this query is executed within ten minutes of time.
In brief when I hard code the date parameters inside query the perl script takes 10 to 15 min to execute, but if I pass date parameters as variables this script is talking more than five hours to execute, it hangs in a single ,step $sth->execute for a very long tome.
I am unable to get the cause of this problem; your suggestion to this problem is heartily welcome.
Thanks in advance,
Ram
20060925 Janitored by Corion: Added formatting, code tags, as per Writeup Formatting Tips
2006-09-25 Retitled by GrandFather, as per Monastery guidelines
Original title: 'Hi Monks,'
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Excessive execution time passing parameters to Oracle
by ozone (Friar) on Sep 25, 2006 at 11:50 UTC | |
by Anonymous Monk on Sep 26, 2006 at 09:59 UTC | |
|
Re: Excessive execution time passing parameters to Oracle
by jhourcle (Prior) on Sep 25, 2006 at 13:31 UTC | |
by Anonymous Monk on Sep 26, 2006 at 09:45 UTC | |
by jhourcle (Prior) on Sep 27, 2006 at 15:19 UTC | |
by Anonymous Monk on Sep 26, 2006 at 09:52 UTC |