Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

scheduling Informix stored procedures on NT

52 views
Skip to first unread message

Mark Fisher

unread,
Aug 7, 1997, 3:00:00 AM8/7/97
to

> For scheduling , I put the "dbaccess <dbname> <spname?" command in a
> batch file and try to run it with the "at" command on NT. This is not
> working. In fact even if I try running dbaccess itself, the dbaccess

At a guess:

- What user does the at job run as, administrator?
- Do they have an account on the database?
- Is the path set correctly for the INFORMIXDIR etc under the at user?

It is most likely a user environment problem. I had a similar problem
scheduling a SQLBase job using "at" under NT.

Try running an "at" job that runs a "SET" command (batch file) and
output it to a file to see what environment the job is running as.

Mark Fisher

--
------------------------------------------
The views expressed here are mine and not
those of my employer, Britannic Assurance
------------------------------------------

Jacob Salomon

unread,
Aug 7, 1997, 3:00:00 AM8/7/97
to Vinitha

Vinitha wrote:

> I am trying to run certain Informix stored procedures at scheduled
> time intervals on NT.


> For scheduling , I put the "dbaccess <dbname> <spname?" command in a
> batch file and try to run it with the "at" command on NT. This is not
> working. In fact even if I try running dbaccess itself, the dbaccess

> screen just flashes on screen and disappears. Any ideas on why this is
> happening, and how to implement my basic requirement ?

While you can't runa stored procedure by using a naked AT command, you
can write a shell script to invoke dbaccess and run a procedure.

But first, I note that your dbaccess command is the form that expects to
use the screen editor and menus. Try this from the shell prompt:

dbaccess yourdatabase -

dbaccess will give you the message:

Database selected.

and start prompting you with:

>

You can type in SQL commands directly. Terminate a command with a
semicolon (;). Of course you can't edit and correct erroneous SQL
commands; you would have to type them over.

Now, that shell script you run with the AT command: It would look like
this the following:

#!/usr/bin/ksh
# Shell script to be executed by the AT command.
#
dbaccess mydatabase - <<%%
execute procedure yadayada(param1, param2);
%%

If you don't know what that <<%% business it, go read up on how to use
the shell. (Also the newsgroup comp.unix.shell)
--
-- Jake (In pursuit of undomesticated aquatic avians)

+----------------------------------------------------------+
|Aside from that, how did you enjoy the play, Mrs. Lincoln?|
+----------------------------------------------------------+

Paul Mosser

unread,
Aug 7, 1997, 3:00:00 AM8/7/97
to

Ah! But there *is* an "AT" command on NT (at least on 4.0 -- I would
assume that it is also on 3.51). However, it is NOT AT ALL LIKE the
"at" on UNIX. Read the NT Help info on the command.

--
==============================
pmo...@minisoftinc.com
Paul A. Mosser, Developer/DBA
MiniSoft, Inc. Phoenix, AZ U.S.A.

} -----Original Message-----
} From: Jacob Salomon [SMTP:ja...@apparel.net]
} Sent: Thursday, August 07, 1997 2:04 PM
} To: inform...@rmy.emory.edu
} Subject: Re: scheduling Informix stored procedures on NT


}
} Jacob Salomon wrote:
} >
} > Vinitha wrote:
} >
} > > I am trying to run certain Informix stored procedures at scheduled
} > > time intervals on NT.

} --- SNIP ---


} > While you can't runa stored procedure by using a naked AT command,
} you
} > can write a shell script to invoke dbaccess and run a procedure.
} >
} > But first, I note that your dbaccess command is the form that
} expects
} > to use the screen editor and menus. Try this from the shell prompt:

} --- SNIP --- stuff about ksh.
}
} I hadn't noticed the NT qualifier in the subject line.
}
} I have no idea if NT has an AT command or if there is a shell that
} runs
} on NT, though I would be unsurprised of some version of BASH (Bourne
} again shell from GNU) runs on NT.


}
} --
} -- Jake (In pursuit of undomesticated aquatic avians)
}
} +----------------------------------------------------------+

} |Never mind! --- Emily Littela, RIP |
} +----------------------------------------------------------+

Mark Fisher

unread,
Aug 8, 1997, 3:00:00 AM8/8/97
to

Well, if anyone needs me to reiterate this point... ;)

mark fisher

Sujit Pal

unread,
Aug 8, 1997, 3:00:00 AM8/8/97
to

Vinitha

Dont know anything about NT. There was a post here on your thread which =
said that the NT at functions differently than the Unix at. This is how =
I would go about doing it in Unix, so please extrapolate the information =
for NT if at all possible.

echo "dbaccess $DBNAME < spfile" | at midnight today next day

This will run your SP each day at midnight every day starting today. If =
you want other times or other frequencies of running the job then you =
can substitute the appropriate parameters. The first argument for at is =
the time the job needs to be run. The second is the date. The third and =
fourth specify how frequently you want to run the job.

There may be other ways to do this in NT, for instance:

at -f spjob.sh midnight today next day

or=20

at midnight today next day < spjob.sh

where spjob.sh contains:

dbaccess $DBNAME <<!
EXECUTE PROCEDURE spfile;
!

HTH

Sujit

----------
From: BAZIC Project Group[SMTP:bfl...@bfl.soft.net]
Sent: Friday, August 08, 1997 3:49 AM
To: sp...@scotch.den.csci.csc.com


Subject: Re: scheduling Informix stored procedures on NT

Sujit,

Thanks for the prompt reply. However, what you suggest would just run =
the sp onetime. What I want to do is automate the running. So I am =
looking at executing it from the NT "at" command, which is not working. =
Any further ideas ?=20

Vinitha

>=20
> Vinitha
>=20
> How about:
>=20
> dbaccess dbname <<!
> EXECUTE PROCEDURE spname;
> !
>=20
> If you want to use your original form, ie:
>=20
> dbaccess dbname <spname
>=20
> your spname file should have "EXECUTE PROCEDURE spname;" (where spname =
is the name of the SP you created in the database).
>=20
> HTH
>=20
> Sujit
>=20
> ----------
> From: Vinitha[SMTP:bfl...@plutonium.bflsl.soft.net]
> Sent: Wednesday, August 06, 1997 4:29 PM
> To: inform...@rmy.emory.edu
> Subject: scheduling Informix stored procedures on NT
>=20
> Hello,
>=20
> I am trying to run certain Informix stored procedures at scheduled =


time
> intervals on NT.
> For scheduling , I put the "dbaccess <dbname> <spname?" command in a
> batch file and try to run it with the "at" command on NT. This is not
> working. In fact even if I try running dbaccess itself, the dbaccess
> screen just flashes on screen and disappears. Any ideas on why this is
> happening, and how to implement my basic requirement ?

>=20
> Thanks in advance,
> Vinitha
>=20
>=20
>=20
>=20
>=20

0 new messages