Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 893
  • Last Modified:

UDB: How can I call a UDB stored procedure from UNIX ( AIX )

I am new programmer with UDB. I need to know how to call a stored procedure from UNIX(AIX) box, how to write & deploy a stored Procedure in UDB. Also let me know is there any tool available on UNIX to write UDB stored procedure.  
0
Amit_Pekamwar
Asked:
Amit_Pekamwar
  • 3
  • 3
  • 2
1 Solution
 
momi_sabagCommented:
what do you mean by call a procedure from an aix box?
from a prompt shell?
from an application?

0
 
woolmilkporcCommented:
Hi,
first, you should read this -
http://publib.boulder.ibm.com/infocenter/db2luw/v8/index.jsp?topic=/com.ibm.db2.udb.doc/core/r0010409.htm
It deals with the command line interface to DB2. You need a DB2 client on AIX for this to work. Learn here how to install it -
http://publib.boulder.ibm.com/infocenter/db2luw/v8/topic/com.ibm.db2.udb.doc/start/t0007317.htm
Once you got a bit familiar with the above, please come back here and ask for details, if necessary.
Cheers
wmp
 
0
 
woolmilkporcCommented:
... and to learn about creating stored procedures in DB2, please look here -
http://publib.boulder.ibm.com/infocenter/db2luw/v8/topic/com.ibm.db2.udb.doc/ad/c0002294.htm
wmp
 
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
woolmilkporcCommented:
0
 
Amit_PekamwarAuthor Commented:
Yes I want to call a UDB stored procedure from prompt shell or from a sheel script.
0
 
momi_sabagCommented:
in order to call a stored procedure from a prompt shell you will need to install a db2 client
the minimal client you need is called run time client and it will allow you to call the stored procedure (and can be downloaded for free from ibm's website)

after you install it you will need to catalog the udb server (by specifing it's hostname and port)
then, you script shell will need to run under a "db2 envrionment" that is, using several db2 envrionment variables (setup by default in the user db2inst1 which is by default the user that installs the client)
then in your script you will need to invoke the db2 command line processor and pass it the information for activating the procedure, for example :
db2 "connect to database_name user user_name using password"
db2 "call procedure_name(parm1, parm2... )"
db2 "connect reset"
0
 
Amit_PekamwarAuthor Commented:
Thanks momi_sabag. It resolved one part of question. Anything on below -
how to write & deploy a stored Procedure in UDB. Also let me know is there any tool available on UNIX to write UDB stored procedure.  
0
 
momi_sabagCommented:
i'm not familiar with a gui tool for unix that allows you to develop and deploy stored procedures
if you have a windows station, you could use a tool called - udb developer workbench
it can't be downloaded from ibm's website but you can find it around, and it's free

on unix you can always use the db2 command line processor in order to run the create procedure statement which is the statement that creates and "deploy" the procedure into db2
0

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

  • 3
  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now