passing variable in like clause???
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 2 of 2

Thread: passing variable in like clause???

Hybrid View

  1. #1
    Join Date
    Dec 2005
    Posts
    2

    Question passing variable in like clause???

    i've tried this codes but it doesn't work..

    select sum((end_date-start_date+1)*(basic_sal/20))
    into :xtra.unpaid_leave
    from leave_appl,emp_mast
    where emp_mast.emp_id=leave_appl.emp_id and
    emp_mast.emp_id=:global.emp_id and
    status='approved' and
    type='unpaid'and
    la_date like '%":xtra.mont"%';

    notes:
    :xtra.month is the list item where i'll pass the value

  2. #2
    Join Date
    Nov 2000
    Location
    greenwich.ct.us
    Posts
    9,095
    The answer to your question is:

    Code:
    la_date like '%"' || :xtra.mont || '"%';
    although, you most likely want to do:
    Code:
    la_date like '%' || :xtra.mont || '%';
    Jeff Hunter
    marist89@yahoo.com
    http://marist89.blogspot.com/
    Get Firefox!
    "I pledge to stop eating sharks fin soup and will not do so under any circumstances."

Posting Permissions

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



Click Here to Expand Forum to Full Width