Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2005
    Posts
    3

    Unanswered: stored procedures

    Hello, I am a green horn as regards stored procedures...i have an SQL script which i want to run every week automatically...have read books on stored procedures...quite confusing..could someone help me with the syntax for writing a stored procedure...I currently use INFORMIX..

  2. #2
    Join Date
    Nov 2004
    Posts
    143
    Hi,

    If you have to run a simple sql script, then you can simply put the script in crontab or scheduler and execute that using dbaccess or any other tool.

  3. #3
    Join Date
    Jan 2005
    Location
    Ukraine
    Posts
    10
    Hello. Running script with crontab is the easiest way to solve THIS problem. But the Stored Procedures is more powerfull. The main syntax is (for example):

    create procedure eom_reports(
    st date,
    endd date,
    eod date,
    sttime datetime year to second,
    endtime datetime year to second)

    define OTHER_VARIABLE --definition of internal variables

    SOME SCRIPTS, WHICH COULD USE INCOMING VARIABLES LISTED ABOVE

    end procedure eom_reports;

    After loading it into Infomrix you could simply call it from dbaccess (or other tool) like this:

    execute procedure eom_reports(
    To_Date('01012005','%d%m%Y'),
    To_Date('31012005','%d%m%Y'),
    To_Date('25012005','%d%m%Y'),
    To_date('20050101000001','%Y%m%d%H%M%S'),
    To_date('20050201000001','%Y%m%d%H%M%S')
    );

Posting Permissions

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