Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Trigger and ACE Report from Visual Basic 1

Status
Not open for further replies.

ufobaby

MIS
Sep 25, 2001
238
US
hi all,

i have a front end in Visual Basic, can i triggger an ace report from the same and get the o/p in a file saved by that ace report.

the file will get saved in some default location on the unix server...

pls help

[cheers]
Niraj [noevil]
 
Should be fairly straightforward. We used to do it (not using VB) by populating a parameter table and then issuing an 'EXECUTE PROCEDURE aixa("unixcommand")' SQL statement passing the command line to run. The stored procedure was simply :

CREATE PROCEDURE aixa(runcommand CHAR(250))
SYSTEM runcommand;
END PROCEDURE;

(specifically SE 7.24)

You will have to run a script that sets appropriate environment variables and then does an sacego to run your report.

Hope this helps

Ade
 
hi, Ade thx for that prompt reply :)

what i need to do is ;
my ace report has a lot of formating done in the format clause i.e "using" clause and "if then" conditions.... now i should be able to trigger this ACE report as is and the o/p generated can then be transefered by some script on the unix server.

what u'v given is to create procedure , but then it will only execute the SQL stmt what abt my Formatting in the report ?

any ideas on this ?

[cheers]
Niraj [noevil]
 
Hi Niraj,

I am assuming that your Informix DB and ACE report are on the server where you are looking to save the output.

In your VB script you would do something like

EXECUTE PROCEDURE aixa("/usr/local/runacereport")

This will fire off a process on the server and run the script passed as the parameter.

On the server the script /usr/local/runacereport would contain something along the lines of

#!/usr/bin/ksh
#
export INFORMIXDIR=/usr/informix
export INFORMIXSERVER=...
export DBPATH=...
...

sacego myacereport > /somepath/somefilename



Ade
 
hey Ade , now this looks a bit simpler :) thx.

couple of doubts still !

1.] runacereport would be a ".ksh" file right ?
2.] "sacego myacereport > /somepath/somefilename"

so the command is ->

sacego altemp1.ace > /cpcusr/query/wrk/out/trial.txt

coul you kindly confirm this ?

[Cheers]
Niraj [noevil]
 
hey Ade , now this looks a bit simpler :) thx.

couple of doubts still !

1.] runacereport would be a ".ksh" file right ?
2.] "sacego myacereport > /somepath/somefilename"
so the command is ->
sacego altemp1.ace > /cpcusr/query/wrk/out/trial.txt
**** IMP ***
3.] if the ace report has some input clause, how do we pass parameters from this command.
************

Pls Help

[Cheers]
Niraj [noevil]
 
Niraj,

1.] runacereport would be a ".ksh" file right ?

Doesn't really matter, but it is nice to make contents easily identifiable.

2.] "sacego myacereport > /somepath/somefilename"
so the command is ->
sacego altemp1.ace > /cpcusr/query/wrk/out/trial.txt

Looks fine


**** IMP ***

3.] if the ace report has some input clause, how do we pass parameters from this command.

Hmmmmmmm.

We were using 4GL which is obviously easier. I think the following should work using UNIX to take input from a file.

EXECUTE PROCEDURE aixa("/usr/local/runacereport par1 par2")

#!/usr/bin/ksh
#
export INFORMIXDIR=/usr/informix
export INFORMIXSERVER=...
export DBPATH=...
...

echo $1 > /tmp/params_$$
echo $2 >> /tmp/params_$$

sacego -q myacereport </tmp/params_$$ >/somepath/somefilename

rm /tmp/params_$$


You can leave out the rm for testing purposes.


Ade
 
thx a ton Ade ,

but my damm DBA doesn't allow us to write scripts or Procedures on the back end , lemme jus convince him , i'll try this and get back to u in a day or 2

Thx a lot once again

[cheers]
Niraj [noevil]
 
hi, Ade,

am really troubling u a lot :-(
but now the problem is my front end is Java and using JDBC to connect to Informix can i still use
EXECUTE PROCEDURE aixa(......)

??? if yes how ?

could u pls help

[cheers]
Niraj [noevil]
 
Niraj,

Have not used anything like that but EXECUTE PROCEDURE is an SQL statement so you should be able to issue it in the same way you would do a SELECT statement


Ade
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top