473,789 Members | 2,422 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to return a status from sqlplus to .ksh unix script ?

I have a script a.ksh as follow:

[vashti]<orasp> cat a.ksh
sqlplus -s rsi/rsi < aaa1.sql
echo stat $?
[vashti]<orasp>

text of aaa1.sql:

exec dbms_stats.gath er_table_stats
('P0E1A00','MI_ AC_CIRBE_GEN',c ascade=>true,es timate_percent= >25);

Problem: how can i transfer the status of the execution of
dbms_stats.gath er_table_stats to the .ksh ????
Jul 19 '05 #1
2 14893
zg*******@il.bp hx.com (Zvika Glickman) wrote in message news:<b6******* *************** ****@posting.go ogle.com>...
I have a script a.ksh as follow:

[vashti]<orasp> cat a.ksh
sqlplus -s rsi/rsi < aaa1.sql
echo stat $?
[vashti]<orasp>

text of aaa1.sql:

exec dbms_stats.gath er_table_stats
('P0E1A00','MI_ AC_CIRBE_GEN',c ascade=>true,es timate_percent= >25);

Problem: how can i transfer the status of the execution of
dbms_stats.gath er_table_stats to the .ksh ????


Z, look up the SQLPlus command "whenever sqlerror exit FAILURE"

Many times all you need to pass back to the shell is success or
failure. For the exact problem you can look at the spool file.

In the case of a dmbs_stats I would generally not expect a failure
message.

HTH -- Mark D Powell --
Jul 19 '05 #2
zg*******@il.bp hx.com (Zvika Glickman) wrote in message news:<b6******* *************** ****@posting.go ogle.com>...
I have a script a.ksh as follow:

[vashti]<orasp> cat a.ksh
sqlplus -s rsi/rsi < aaa1.sql
echo stat $?
[vashti]<orasp>

text of aaa1.sql:

exec dbms_stats.gath er_table_stats
('P0E1A00','MI_ AC_CIRBE_GEN',c ascade=>true,es timate_percent= >25);

Problem: how can i transfer the status of the execution of
dbms_stats.gath er_table_stats to the .ksh ????


Thanks mark,
I used:
whenever sqlerror exit sql.sqlcode;
Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
20207
by: Rick | last post by:
I am installing Oracle 9i client runtime on AIX 5.1-003. The installation completes successfully, but neither the Net Configuration Assistant or SQLPLUS will run. I get the following error when trying to run netca: Error loading native library: libnjni9.so. java.lang.UnsatisfiedLinkError: jniGetOracleHome at oracle.net.common.NetGetEnv.getOracleHome(NetGetEnv.java) at oracle.net.ca.CmdlineArgs.setOraArgs(CmdlineArgs.java)
2
17111
by: Vincento Harris | last post by:
Oracle 8.1.7.4 on Hp Unix 11i I am attempting to pass unix parameters on to sql plus I did read on technet that with 9i it is very straightforward Example script name whoisit Pass sid 23 whoisit 23 returns
4
75878
by: Raj Kotaru | last post by:
Hi, In sqlplus, I can insert a single row using: insert into employee (name, salary, hiredate) values ('xyz', '86378', sysdate); Is there a modification of the insert command that will allow me to
3
9665
by: tngoe | last post by:
#!/bin/ksh echo "" echo "Enter person ID:" read person_id sqlplus -silent '/nolog'<<end_sql1 connect useract/passwd start $BANNER_LINKS/gurlsid.sql $person_id FAISMGR end_sql1
1
6812
by: tpawona | last post by:
I'm writing a script that would be run by user oracle, that would logon to all the databases on the server. Thus I'll need to logon as sysdba. In Sqlplus, this would be sqlplus / as sysdba. How do I do this in Perl. I've tried $dbh = DBI->connect("dbi:Oracle:host=$host;sid=$sid","/","",{ ora_session_mode => SYSDBA }); I keep getting invalid username/password.I'm logged on at the unix level as user "oracle".
1
2077
by: edwardscm | last post by:
Like in UNIX where you can echo $0 and it gives the name of the script running how do you do a similar thing in SQLPLUS. Is there a set option that can be turned on that will allow the name of the script to be displayed when the script first executes? Regards Christopher
0
1842
by: Mark D Powell | last post by:
getamit23@rediffmail.com (Amit Kapoor) wrote in message news:<c33bca54.0307090046.7698321f@posting.google.com>... The Windows version of sqlplus should be part of the Oracle client install for Windows. That is where all the versions of sqlplus I have ever installed on the PC have come from. HTH -- Mark D Powell --
2
1105
by: Zvika Glickman | last post by:
I have a script a.ksh as follow: <oraspcat a.ksh sqlplus -s rsi/rsi < aaa1.sql echo stat $? <orasp> text of aaa1.sql: exec dbms_stats.gather_table_stats
3
5027
by: draffe | last post by:
This is not a sqlplus script problem per se but I don't know where else to go with my problem. I use wordpad to record my sqlplus script, then copy and paste it into the sqlplus prompt. I've run many scripts successfully. All of a sudden, instead of stopping and running my script, the script is read all the way to the end with no download. If I e-mail it to someone else they can run it fine. I retyped it once today and succeeded. Then it...
0
9663
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10404
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10136
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
9979
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...
0
9016
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5415
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
5548
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4090
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3695
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.