DBAsupport.com Forums - Powered by vBulletin
Results 1 to 7 of 7

Thread: Execute a package through cron

  1. #1
    Join Date
    Apr 2002
    Posts
    291
    Hi All,
    I posted this query long back, but didn't get the solution . Now i've to do this , because it has to run every saturday on production which generates huge weekly reports. Our QA team escalated the problem to highier levels. Please help me.
    I was doing manually till now every week.

    I got a package which executes a public procedure by taking sysdate as a parameter. I tried it but couldn't succeed.
    Till now, i was doing like...

    SQL>conn scott/tiger@orcl
    SQL> Exec weekly_reports.psr_weekly_cr('27/06/2002');

    This date is sysdate. I tried to pass this variable in procedure itself , but not workng, That has to be passed from OS level.

    Any help would be greatly appreciated.

    Thanks in advance
    PNRDBA

  2. #2
    Join Date
    Apr 2001
    Location
    Louisville KY
    Posts
    295
    why not
    create or replac procedure weekly_reports.psr_weekly_cr
    declare
    whence date;
    begin
    select sysdate() into whence from dual;
    rest>>of>>procedure>>using>>whence
    end;
    Joseph R.P. Maloney, CSP,CDP,CCP
    'The answer is 42'

  3. #3
    Join Date
    Apr 2002
    Posts
    291
    Thanks , but we have to pass this sysdate while executing this.
    I tried this, but didn't work. Any solution like declaring a date variable which tracks sysdate into that at (OS level) and then while EXEC ..... can pass this variable in a shell ??
    PNRDBA

  4. #4
    Join Date
    Jan 2001
    Posts
    515

    What OS are you using?

    What is your operationg system? Is it unix korn shell that you will run this?

  5. #5
    Join Date
    Jan 2001
    Posts
    515

    try this

    if unix try

    mydate=`date +%d%h%Y`

    conn scott/tiger@orcl
    Exec weekly_reports.psr_weekly_cr('$mydate');


    The mydate will give you the system date in the follwing format. 27jun02

  6. #6
    Join Date
    Feb 2001
    Posts
    180
    Shouldn't it be:
    Exec weekly_reports.psr_weekly_cr(to_date('27/06/2002','dd/mm/yyyy');

    Regards
    Ben de Boer

  7. #7
    Join Date
    Apr 2002
    Posts
    291
    My OS is Linux 7.2, and i tried in both the ways you people mentioned. But it didn't work. I checked all the permissions, every thing is fine. Its not accepting the date format. Can any one help me please.
    PNRDBA

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