Sponsored Content
Full Discussion: shell script for sql queries
Top Forums UNIX for Dummies Questions & Answers shell script for sql queries Post 302197507 by user71408 on Wednesday 21st of May 2008 05:23:04 AM
Old 05-21-2008
shell script for sql queries

Hi All,
I have written 4 sql queries . Now I want to write one SHELL SCRIPTING program for all these queries...

i.e

1.select * from head;
2. select * from detail;
3. delete from head;
4. delete from detail;

Please let me know how to write a shell script...

Thank you
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Sh Shell Script executing remote SQL queries

Hi there folks, I am trying to execute remote sql queries on an Oracle server. I would like to save the result of the executed sql queries on a text file, and send that text file as an attachment to an email address. Could anyone give me an idea on how the above could be achieved? Any help... (2 Replies)
Discussion started by: Javed
2 Replies

2. Shell Programming and Scripting

How to extract queries using UNIX shell script?

Hi, I have an input file which have many lines,from which i need to extract only the complete sql statements and write this alone to an output file. please help us in this. Regards Meva (7 Replies)
Discussion started by: meva
7 Replies

3. Shell Programming and Scripting

Nested SQL queries within Shell script

Hi, Would someone know if I can fire nested sql queries in a shell script? Basically what I am trying to do is as follows: my_sql=$(sqlplus -s /nolog<<EOF|sed -e "s/Connected. *//g" connect... (2 Replies)
Discussion started by: shrutihardas
2 Replies

4. Shell Programming and Scripting

Script (with sql queries) not working using cron

Hi all, I have script, which performing sql queries and put output into file. When I run this script manually, its working fine, but when I want to schedule it with cron I am getting errors... I defined LD_LYBRARY_PATH and ,but no result. After I defined it, I am getting error: # more... (4 Replies)
Discussion started by: nypreH
4 Replies

5. Shell Programming and Scripting

How to store results of multiple sql queries in shell variables in ksh?

Hi, I have a script where I make a sqlplus connection. In the script I have multiple sql queries within that sqlplus connection. I want the result of the queries to be stored in shell variables declared earlier. I dont want to use procedures. Is there anyway else. Thanks in advance.. Cheers (6 Replies)
Discussion started by: gonchusirsa
6 Replies

6. Shell Programming and Scripting

Executing set of sql queries from shell script

Hi All, I tried executing set of queries from shell script but not able to capture the input query in the log file. The code looks something similar to below sqlplus user/pwd@dbname << EOF > output.log $(<inputfile.txt) EOF The above code is capturing the output of queries into... (9 Replies)
Discussion started by: loggedin.ksh
9 Replies

7. Shell Programming and Scripting

How can i run sql queries from UNIX shell script and retrieve data into text docs of UNIX?

Please share the doc asap as very urgently required. (1 Reply)
Discussion started by: 24ajay
1 Replies

8. Shell Programming and Scripting

run sql queries from UNIX shell script.

How can i run sql queries from UNIX shell script and retrieve data into text docs of UNIX? :confused: (1 Reply)
Discussion started by: 24ajay
1 Replies

9. Shell Programming and Scripting

Using shell scripting for making queries on postgres sql

I have a situation where I have a list of airplanes that make a series of flights. Therefore I am looking up the different flights that each airplane makes based on a postgres sql query: select flightid from plane where airplane='DELTAx' As a result I get a series of flight numbers... (0 Replies)
Discussion started by: JSNY
0 Replies

10. Shell Programming and Scripting

Storing multiple sql queries output into variable by running sql command only once

Hi All, I want to run multiple sql queries and store the data in variable but i want to use sql command only once. Is there a way without running sql command twice and storing.Please advise. Eg : Select 'Query 1 output' from dual; Select 'Query 2 output' from dual; I want to... (3 Replies)
Discussion started by: Rokkesh
3 Replies
SLAPD-SHELL(5)                                                  File Formats Manual                                                 SLAPD-SHELL(5)

NAME
slapd-shell - Shell backend to slapd SYNOPSIS
/etc/ldap/slapd.conf DESCRIPTION
The Shell backend to slapd(8) executes external programs to implement operations, and is designed to make it easy to tie an existing data- base to the slapd front-end. This backend is primarily intended to be used in prototypes. WARNING
The abandon shell command has been removed since OpenLDAP 2.1. CONFIGURATION
These slapd.conf options apply to the SHELL backend database. That is, they must follow a "database shell" line and come before any subse- quent "backend" or "database" lines. Other database options are described in the slapd.conf(5) manual page. These options specify the pathname and arguments of the program to execute in response to the given LDAP operation. Each option is fol- lowed by the input lines that the program receives: add <pathname> <argument>... ADD msgid: <message id> <repeat { "suffix:" <database suffix DN> }> <entry in LDIF format> bind <pathname> <argument>... BIND msgid: <message id> <repeat { "suffix:" <database suffix DN> }> dn: <DN> method: <method number> credlen: <length of <credentials>> cred: <credentials> compare <pathname> <argument>... COMPARE msgid: <message id> <repeat { "suffix:" <database suffix DN> }> dn: <DN> <attribute>: <value> delete <pathname> <argument>... DELETE msgid: <message id> <repeat { "suffix:" <database suffix DN> }> dn: <DN> modify <pathname> <argument>... MODIFY msgid: <message id> <repeat { "suffix:" <database suffix DN> }> dn: <DN> <repeat { <"add"/"delete"/"replace">: <attribute> <repeat { <attribute>: <value> }> - }> modrdn <pathname> <argument>... MODRDN msgid: <message id> <repeat { "suffix:" <database suffix DN> }> dn: <DN> newrdn: <new RDN> deleteoldrdn: <0 or 1> <if new superior is specified: "newSuperior: <DN>"> search <pathname> <argument>... SEARCH msgid: <message id> <repeat { "suffix:" <database suffix DN> }> base: <base DN> scope: <0-2, see ldap.h> deref: <0-3, see ldap.h> sizelimit: <size limit> timelimit: <time limit> filter: <filter> attrsonly: <0 or 1> attrs: <"all" or space-separated attribute list> unbind <pathname> <argument>... UNBIND msgid: <message id> <repeat { "suffix:" <database suffix DN> }> dn: <bound DN> Note that you need only supply configuration lines for those commands you want the backend to handle. Operations for which a command is not supplied will be refused with an "unwilling to perform" error. The search command should output the entries in LDIF format, each entry followed by a blank line, and after these the RESULT below. All commands except unbind should then output: RESULT code: <integer> matched: <matched DN> info: <text> where only the RESULT line is mandatory. Lines starting with `#' or `DEBUG:' are ignored. ACCESS CONTROL
The shell backend does not honor all ACL semantics as described in slapd.access(5). In general, access to objects is checked by using a dummy object that contains only the DN, so access rules that rely on the contents of the object are not honored. In detail: The add operation does not require write (=w) access to the children pseudo-attribute of the parent entry. The bind operation requires auth (=x) access to the entry pseudo-attribute of the entry whose identity is being assessed; auth (=x) access to the credentials is not checked, but rather delegated to the underlying shell script. The compare operation requires read (=r) access (FIXME: wouldn't compare (=c) be a more appropriate choice?) to the entry pseudo-attribute of the object whose value is being asserted; compare (=c) access to the attribute whose value is being asserted is not checked. The delete operation does not require write (=w) access to the children pseudo-attribute of the parent entry. The modify operation requires write (=w) access to the entry pseudo-attribute; write (=w) access to the specific attributes that are modi- fied is not checked. The modrdn operation does not require write (=w) access to the children pseudo-attribute of the parent entry, nor to that of the new par- ent, if different; write (=w) access to the distinguished values of the naming attributes is not checked. The search operation does not require search (=s) access to the entry pseudo_attribute of the searchBase; search (=s) access to the attributes and values used in the filter is not checked. EXAMPLE
There is an example search script in the slapd/back-shell/ directory in the OpenLDAP source tree. LIMITATIONS
The shell backend does not support threaded environments. When using the shell backend, slapd(8) should be built --without-threads. FILES
/etc/ldap/slapd.conf default slapd configuration file SEE ALSO
slapd.conf(5), slapd(8), sh(1). OpenLDAP 2012/04/23 SLAPD-SHELL(5)
All times are GMT -4. The time now is 08:30 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy