Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Apr 2005
    Location
    Ireland
    Posts
    122
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Oracle 10g TO_DATE problem

    Hi,

    I have the following query which executes fine and returns three rows when run from SQLPlus. Promlem is that when run from a cgi script in perl nothing is returned.

    Code:
    SELECT gv_vote_id, 
               gv_group_id,
               mg_group_name,
               gv_title, gv_description,
               TO_CHAR(gv_start_date,'DD-MON-YYYY HH24:MI'),              
               TO_CHAR(gv_end_date,'DD-MON-YYYY HH24:MI'), 
               gv_mail_to 
    FROM    group_vote, 
               group 
    WHERE  mg_group_code = gv_group_id 
    AND      TO_DATE(gv_start_date,'DD-MON-YYYY') < TO_DATE(SYSDATE,'DD-MON-YYYY') 
    AND      TO_DATE(gv_end_date,'DD-MON-YYYY') = TO_DATE(SYSDATE+1,'DD-MON-YYYY') 
    AND      gv_published = '1' 
    AND      gv_active = '1'
    If i remove the line TO_DATE(gv_start_date,'DD-MON-YYYY') < TO_DATE(SYSDATE,'DD-MON-YYYY'), and replace TO_DATE(gv_end_date,'DD-MON-YYYY') = TO_DATE(SYSDATE+1,'DD-MON-YYYY') with TO_CHAR function, then it works fine (in script and SQLPlus)!!

    gv_start_date and gv_end_date both have "Date" datatype.

    Thanks in Advance
    Last edited by tom123; 02-01-2007 at 11:41 AM.

  • #2
    New to the CF scene
    Join Date
    Aug 2011
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Oh, why nobody answered, I have exactly the same problem
    May be you tom123 have already fixed it up??


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •