Sponsored Content
Top Forums Programming Executing pl/sql using sqlplus on unix Post 302165982 by maverick1234 on Sunday 10th of February 2008 09:02:43 AM
Old 02-10-2008
Executing pl/sql using sqlplus on unix

Hi to all,

I have a endday.sh file. And I execute this like "sh endday.sh" from command prompt. In endday.sh file it writes:

sqlplus temp/temp@data @run.sql&
echo $!>>pid.txt

However my aim is not to put the pid into pid.txt but I need to insert the pid into an oracle table using sqlplus.

so I change the endday.sh like this below:

sqlplus temp/temp@data @run.sql& (1)
sqlplus -s temp/temp@data << EOF (2)
insert into liv_pid (pid) values ($!);
exit
EOF

In the insert into statement by using $!, do I take pid of 1 or 2, and indeed can I take the pid? And does this final endday.sh work?

Thank you very much, and I need urgent help....
 

10 More Discussions You Might Find Interesting

1. Solaris

Executing MS-SQL stored procedures from Unix/C Program?

All, We are contemplating a port of an existing software product and would like to expend as little effort as possible. Our new database would be MS-SQL, and we would write stored procedures to perform common db operations. We'd like to call these stored procedures from C or C++ code running... (3 Replies)
Discussion started by: mparks
3 Replies

2. UNIX for Advanced & Expert Users

Executing pl/sql using sqlplus on unix

Hi to all, I have a endday.sh file. And I execute this like "sh endday.sh" from command prompt. In endday.sh file it writes: sqlplus temp/temp@data @run.sql& echo $!>>pid.txt However my aim is not to put the pid into pid.txt but I need to insert the pid into an oracle table using sqlplus.... (1 Reply)
Discussion started by: maverick1234
1 Replies

3. Shell Programming and Scripting

Executing pl/sql using sqlplus on unix

Hi to all, I have a endday.sh file. And I execute this like "sh endday.sh" from command prompt. In endday.sh file it writes: sqlplus temp/temp@data @run.sql& echo $!>>pid.txt However my aim is not to put the pid into pid.txt but I need to insert the pid into an oracle table using sqlplus.... (1 Reply)
Discussion started by: maverick1234
1 Replies

4. UNIX for Advanced & Expert Users

Executing SQLPLUS in UNIX Script from JAVA

Hi ALL, I would like to execute one SQL query(ORACLE) in UNIX shell script. For this I used sqlplus in script and tested locally. It worked fine. But my requiremnt is to execute the script from Java. In this case the UNIX part is working but sqlplus is not returning anything The JAVA code used... (0 Replies)
Discussion started by: anooptech
0 Replies

5. Shell Programming and Scripting

Executing a Oracle SQL statement in a UNIX script

Hi All, I need to select one column from a table based upon the passed in parameter. I tried this: sqlplus -silent $MISP_USER << EOF set feedback off; set verify off; set sqlprompt "" SELECT mail_flag FROM dailyjobs WHERE job_name = '$1'; exit 0 EOF exit... (1 Reply)
Discussion started by: ganga.dharan
1 Replies

6. Shell Programming and Scripting

(Urgent):Creating flat file using sql script and sqlplus from UNIX Shell Script

Hi, I need help urgently for following issue. Pls help me to resolve this issue. I am calling sql script file(file1.sql) from UNIX Shell Script(script1.ksh) using sql plus and trying to create flat file that contains all records returned from SQL query in SQL script(file1.sql) I given... (6 Replies)
Discussion started by: praka
6 Replies

7. UNIX for Dummies Questions & Answers

executing SQL query using unix shell script

I want to perform few post-session success tasks like update a status to 'true' in one of the sql database table, update date values to current system date in one of the configuration table in sql. How do i achieve this in a post session command?syntax with example will be helpful. (3 Replies)
Discussion started by: nathanvaithi
3 Replies

8. UNIX for Advanced & Expert Users

Executing SQL file in UNIX

I have few .sql file at some location say /x/y/z. I want to execute those .sql files in UNIX server so that all packages,procedures can be applied on the database of the UNIX server. (1 Reply)
Discussion started by: Dip
1 Replies

9. Shell Programming and Scripting

Help in executing the following db2 sql querry in unix

Hi All, Please help me out in executing the following db2 querry in unix db2 "select AP_RQ_ACQ_INST_ID || ',' || txn_classifier || ',' || AP_RS_RESP_CD || ',' || (count(*) AS COUNT1) || ',' || (SUM(AP_RQ_TXN_AMT) AS TOTAL_AMT) from TXN_RECORD where CREATE_TS > '2010-11-22 11:00:00.008645' ... (1 Reply)
Discussion started by: dudd9
1 Replies

10. Shell Programming and Scripting

UNIX Sqlplus - Capture the sql statement about to run and execution status

Greetings Experts, I am on AIX using ksh. Created a unix script which generates the CREATE OR REPLACE VIEW ... and GRANT .. statements, which are placed in a single .txt file. Now I need to execute the contents in the file (there are around 300 view creation and grant statements) in Oracle and... (4 Replies)
Discussion started by: chill3chee
4 Replies
PKCHECK(1)							      pkcheck								PKCHECK(1)

NAME
pkcheck - Check whether a process is authorized SYNOPSIS
pkcheck [--version] [--help] pkcheck [--list-temp] pkcheck [--revoke-temp] pkcheck --action-id action {--process { pid | pid,pid-start-time | pid,pid-start-time,uid } | --system-bus-name busname} [--allow-user-interaction] [--enable-internal-agent] [--detail key value...] DESCRIPTION
pkcheck is used to check whether a process, specified by either --process (see below) or --system-bus-name, is authorized for action. The --detail option can be used zero or more times to pass details about action. If --allow-user-interaction is passed, pkcheck blocks while waiting for authentication. The invocation pkcheck --list-temp will list all temporary authorizations for the current session and pkcheck --revoke-temp will revoke all temporary authorizations for the current session. This command is a simple wrapper around the polkit D-Bus interface; see the D-Bus interface documentation for details. RETURN VALUE
If the specified process is authorized, pkcheck exits with a return value of 0. If the authorization result contains any details, these are printed on standard output as key/value pairs using environment style reporting, e.g. first the key followed by a an equal sign, then the value followed by a newline. KEY1=VALUE1 KEY2=VALUE2 KEY3=VALUE3 ... Octects that are not in [a-zA-Z0-9_] are escaped using octal codes prefixed with . For example, the UTF-8 string fol, will be printed as f303270l54344275240345245275. If the specificied process is not authorized, pkcheck exits with a return value of 1 and a diagnostic message is printed on standard error. Details are printed on standard output. If the specificied process is not authorized because no suitable authentication agent is available or if the --allow-user-interaction wasn't passed, pkcheck exits with a return value of 2 and a diagnostic message is printed on standard error. Details are printed on standard output. If the specificied process is not authorized because the authentication dialog / request was dismissed by the user, pkcheck exits with a return value of 3 and a diagnostic message is printed on standard error. Details are printed on standard output. If an error occured while checking for authorization, pkcheck exits with a return value of 127 with a diagnostic message printed on standard error. If one or more of the options passed are malformed, pkcheck exits with a return value of 126. If stdin is a tty, then this manual page is also shown. NOTES
Do not use either the bare pid or pid,start-time syntax forms for --process. There are race conditions in both. New code should always use pid,pid-start-time,uid. The value of start-time can be determined by consulting e.g. the proc(5) file system depending on the operating system. If fewer than 3 arguments are passed, pkcheck will attempt to look up them up internally, but note that this may be racy. If your program is a daemon with e.g. a custom Unix domain socket, you should determine the uid parameter via operating system mechanisms such as PEERCRED. AUTHENTICATION AGENT
pkcheck, like any other polkit application, will use the authentication agent registered for the process in question. However, if no authentication agent is available, then pkcheck can register its own textual authentication agent if the option --enable-internal-agent is passed. AUTHOR
Written by David Zeuthen <davidz@redhat.com> with a lot of help from many others. BUGS
Please send bug reports to either the distribution or the polkit-devel mailing list, see the link http://lists.freedesktop.org/mailman/listinfo/polkit-devel on how to subscribe. SEE ALSO
polkit(8), polkitd(8), pkaction(1), pkexec(1), pkttyagent(1) polkit May 2009 PKCHECK(1)
All times are GMT -4. The time now is 04:30 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy