473,836 Members | 1,490 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

sql procedure/ DB2 Procedure...in UNIX Script

13 New Member
Hi All,
can anybody let me know the steps how to call the stored proceedure that is developed in db2 or sql, into unix shell script.
Point: Stored proc. may or may not have parameters.
Point: Stored proc. may or may not return anything.
Feb 27 '07 #1
6 6976
Motoma
3,237 Recognized Expert Specialist
You would need to use the command line tool for your particular database.
For instance: With MySQL, there is a tool called mysql, which you can call on the command line to execute queries.
Feb 27 '07 #2
Varun Gupta
13 New Member
You would need to use the command line tool for your particular database.
For instance: With MySQL, there is a tool called mysql, which you can call on the command line to execute queries.
---------------------------------------------------------------------------------------------
First of all thanks for the reply...
Ya I want to use command line tool...that'll call some stored proc. with some parameters, and the call should be made from script.
Do you have any idea of that...plz let me know.

Let me know what are the other ways to call stored procs. of sql/db2 through unix shell scripts.

Thanks.
Feb 28 '07 #3
Motoma
3,237 Recognized Expert Specialist
---------------------------------------------------------------------------------------------
First of all thanks for the reply...
Ya I want to use command line tool...that'll call some stored proc. with some parameters, and the call should be made from script.
Do you have any idea of that...plz let me know.

Let me know what are the other ways to call stored procs. of sql/db2 through unix shell scripts.

Thanks.
Not being a DB2 guy, this link was all I can find. However, we do happen to have a DB2 forum, and if you were to post further questions there, the experts there may be more helpful.
Feb 28 '07 #4
Varun Gupta
13 New Member
Not being a DB2 guy, this link was all I can find. However, we do happen to have a DB2 forum, and if you were to post further questions there, the experts there may be more helpful.
-----------------------------
thanks for clement piece of advice..

could you please tell to call sql procedure through unix.....whatev er ways are !
Any no. of ways....I would accepts !
Thanks for sharing knowledge. !!

I am looking for the link that you have provided. (thanks for that.)
Mar 1 '07 #5
Motoma
3,237 Recognized Expert Specialist
Expand|Select|Wrap|Line Numbers
  1. db2 "call sp_myProc (4, 12)"
  2.  
Mar 1 '07 #6
Varun Gupta
13 New Member
Expand|Select|Wrap|Line Numbers
  1. db2 "call sp_myProc (4, 12)"
  2.  
---------------------------------------------------------------------

Is this only to be done ? Unix will deduct db2 through this or should we do some modifications with PATH ?
What happens when stored proc. returns a set of records ? Where those will go ?
If I want to display those filtered records in Unix then what is to be done ?

That means how the communication is to be maintained between Unix and database (SQL etc.) ?

Hope I'll get some info. on this from our side.
Thanks in advance !!

Bye
Mar 3 '07 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

3
6560
by: dpackwood | last post by:
Hello, I have two different scripts that do pretty much the same thing. The main perl script is on Windows. It runs and in the middle of it, it then calls out another perl script that then should run on a Unix box I have. Both scripts run ok, except for the part when Windows try's to call out the Unix script. I have it set up where the Unix is mapped through a drive letter and can drop stuff into the Unix box. It is going through another...
5
24096
by: vishal | last post by:
Hi, I am writing my first script to execute a Oracle procedure through a unix script. Could you tell me how do I do error handling here? How do I know in my script if the procedure executed successfully or failed? Thanks #!/usr/bin/ksh sqlplus user/password@name <<EOC set time on
1
3692
by: DB_2 | last post by:
Hello, I created the following stored procedure. (Please ignore the logic in it; at this point it is not complete and I am trying to get the basic structure working first.) CREATE PROCEDURE upgrade_sal () LANGUAGE SQL BEGIN DECLARE eldest INT;
2
3155
by: Michael | last post by:
Running DB2 v7 UDB ("DB2 v7.1.0.93", "n031208" and "WR21333") on Windows XP, I am unable to find out why the "Build for Debug" option within Stored Procedure Builder is not enabled on Java stored procedures. It is enabled for SQL stored procedures. It is possible to "Build" and "Run" the Java SPs, it just isn't possible to click on the "Build for Debug" option. Thanks for any help in advance. Michael
1
3102
by: KrippZ | last post by:
Hi! Im writing a asp.net webapp and I need some help with scheduling of a stored procedure. I'd like to know if it's possible to have a stored produdere (that I have written) to be schedualed for execution. I'd like it to exec on the mysql server on predetermined hours. Cheers
4
7040
by: istruttorenuoto | last post by:
hi to everbody i need to write a unix script to do a sqlplus connection (using user id and password) to an oracle database and call a stored procedure. how could i do it? thanks to all
0
3494
by: istruttorenuoto | last post by:
hi! I have some problems to call a stored procedure from an Unix Script. Here's the script stty istrip stty erase ^H export ORACLE_BASE=/product/oracle export ORACLE_HOME=$ORACLE_BASE/product/9.2.6 export PATH=$ORACLE_HOME/bin:/usr/ccs/bin:/bin:/usr/bin:/usr/local/bin:/usr/ucb
7
2075
by: programming | last post by:
Hi all, i have been having trouble with a login script that works on my windows machine, however when i upload it to the Unix server through VPN, the same script won't work! It won't parse member.txt properly i think. The password and usernames i am using are at the bottom of this post. Each time i go to login on the unix server, it clears the username and password field. I have been attempting to solve the problem, but have been...
26
22385
by: seemagoyal | last post by:
Hi, I don't have any experiance of UNIX and oracle. but i have got a short assignment for writing a unix script that will call a stored procedure. this script has to run this procedure after every two mintes. I have a few questions before actually start writing the script: 1. Do i have to have unix and oracle on same server. 2. what libraries i need to in unix, if any
0
10541
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10584
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10248
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7782
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6976
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5645
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5817
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
4006
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3108
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.