473,802 Members | 1,988 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 14894
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
17112
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
75879
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
9667
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
6813
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
2078
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
1843
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
5028
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
9699
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
9562
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10538
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
10285
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,...
1
7598
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
5494
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...
1
4270
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
3792
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2966
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.