If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Informix > stored procedures

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-03-05, 05:12
chukwuma chukwuma is offline
Registered User
 
Join Date: Feb 2005
Posts: 3
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..
Reply With Quote
  #2 (permalink)  
Old 02-04-05, 02:40
nitin_math nitin_math is offline
Registered User
 
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.
Reply With Quote
  #3 (permalink)  
Old 02-04-05, 04:45
Frank_a Frank_a is offline
Registered User
 
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')
);
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On