Sponsored Content
Top Forums Shell Programming and Scripting Shell Script to execute Oracle query taking input from a file to form query Post 302572336 by Shell_Life on Wednesday 9th of November 2011 04:00:00 PM
Old 11-09-2011
It would be quicker to load all these users into a temp table and join it against whatever table you want.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Execute oracle query determined at runtime from a unix script

Hi I am trying to run a SQL statement from a unix script determined at runtime. It is throwing me an error. Please advise some solution to this. echo "Enter username for the database" read username echo "Enter password for the database" read password echo "Enter SQL stmt" read... (4 Replies)
Discussion started by: infyanurag
4 Replies

2. Shell Programming and Scripting

TO execute .sql 2005 query file in shell script

Hi, I know in oracle a .sql file is called by @ <path> /<filename>. But how to call in sql 2005, I am opening the sql sessionwith sqsh, is there any command to execute there a .sql file (query in sql 2005) in K shell script. (0 Replies)
Discussion started by: n2ekhil
0 Replies

3. Shell Programming and Scripting

how to use data in unix text file as input to an sql query from shell

Hi, I have data in my text file something like this. adams robert ahmed gibbs I want to use this data line by line as input to an sql query which i run by connecting to an oracle database from shell. If you have code for similar scenario , please ehlp. I want the output of the sql query... (7 Replies)
Discussion started by: rdhanek
7 Replies

4. Shell Programming and Scripting

run oracle query remotly with shell script

hello how to run shell script to excute oracle queries on remote db ? i have tried as following sqlplus -s user/password@remote_server "select query;" but not working also this one sqlplus -s user/password@remote_server `select query;` not working :( i add this line to run another... (4 Replies)
Discussion started by: mogabr
4 Replies

5. Shell Programming and Scripting

Query Oracle tables and return values to shell script that calls the query

Hi, I have a requirement as below which needs to be done viz UNIX shell script (1) I have to connect to an Oracle database (2) Exexute "SELECT field_status from table 1" query on one of the tables. (3) Based on the result that I get from point (2), I have to update another table in the... (6 Replies)
Discussion started by: balaeswari
6 Replies

6. Shell Programming and Scripting

Shell script to query Oracle table

Hi, unix gurnis I need help for following requirement for writing a shell scritp. log in to oracle database, query one table total records (select count(*) from table1), pass the return value to a file. Thanks in advance (2 Replies)
Discussion started by: ken002
2 Replies

7. Shell Programming and Scripting

Problems with storing oracle sqlplus query output shell script

Hello everyone, I have a RHEL 5 system and have been trying to get a batch of 3-4 scripts each in a separate variables and they are not working as expected. I tried using following syntax which I saw a lot of people on this site use and should really work, though for some reason it doesn't... (3 Replies)
Discussion started by: rockf1bull
3 Replies

8. Shell Programming and Scripting

How to run a SQL select query in Oracle database through shell script?

I need to run a SQL select query in Oracle database and have to capture the list of retrieved records in shell script. Also i would like to modify the query for certain condition and need to fetch it again. How can i do this? Is there a way to have a persistent connection to oracle database... (9 Replies)
Discussion started by: vel4ever
9 Replies

9. Shell Programming and Scripting

Taking information from a postgres sql query and putting it into a shell script array

I have a postgres sql statement that is the following: select age from students; which gives me the entries: Age --- 10 15 13 12 9 14 10 which is about 7 rows of data. Now what I would like to do with this is use a shell script to create an array age. As a results... (3 Replies)
Discussion started by: JSNY
3 Replies

10. Shell Programming and Scripting

Shell script to execute sql query.

Hi Experts, Need your support. Not able to use sql query alias in shell script. Could you please help me in finding right way to use alias with sql query in shell script. Below is the code i am using. #!/bin/bash sqlplus -s abc/abc@abc << EOF> bcd.csv set trimspool on select zone_id... (4 Replies)
Discussion started by: as7951
4 Replies
DBI::Shell(3)						User Contributed Perl Documentation					     DBI::Shell(3)

NAME
DBI::Shell - Interactive command shell for the DBI SYNOPSIS
perl -MDBI::Shell -e shell [<DBI data source> [<user> [<password>]]] or dbish [<DBI data source> [<user> [<password>]]] DESCRIPTION
The DBI::Shell module (and dbish command, if installed) provide a simple but effective command line interface for the Perl DBI module. DBI::Shell is very new, very experimental and very subject to change. Your milage will vary. Interfaces will change with each release. TO DO
Proper docs - but not yet, too much is changing. "/source file" command to read command file. Allow to nest via stack of command file handles. Add command log facility to create batch files. Commands: load (query?) from file save (query?) to file Use Data::ShowTable if available. Define DBI::Shell plug-in semantics. Implement import/export as plug-in module Clarify meaning of batch mode Completion hooks Set/Get DBI handle attributes Portability Emulate popular command shell modes (Oracle, Ingres etc)? COMMANDS
Many commands - few documented, yet! help /help chistory /chistory (display history of all commands entered) /chistory | YourPager (display history with paging) clear /clear (Clears the current command buffer) commit /commit (commit changes to the database) connect /connect (pick from available drivers and sources) /connect dbi:Oracle (pick source from based on driver) /connect dbi:YourDriver:YourSource i.e. dbi:Oracle:mysid Use this option to change userid or password. current /current (Display current statement in the buffer) do /do (execute the current (non-select) statement) dbish> create table foo ( mykey integer ) dbish> /do dbish> truncate table OldTable /do (Oracle truncate) drivers /drivers (Display available DBI drivers) edit /edit (Edit current statement in an external editor) Editor is defined using the enviroment variable $VISUAL or $EDITOR or default is vi. Use /option editor=new editor to change in the current session. To read a file from the operating system invoke the editor (/edit) and read the file into the editor buffer. exit /exit (Exits the shell) get /get (Retrieve a previous command to the current buffer) go /go (Execute the current statement) Run (execute) the statement in the current buffer. This is the default action if the statement ends with / dbish> select * from user_views/ dbish> select table_name from user_tables dbish> where table_name like 'DSP%' dbish> / dbish> select table_name from all_tables/ | more history /history (Display combined command and result history) /history | more option /option [option1[=value]] [option2 ...] /option (Displays the current options) /option MyOption (Displays the value, if exists, of MyOption) /option MyOption=4 (defines and/or sets value for MyOption) perl /perl (Evaluate the current statement as perl code) quit /quit (Leaves shell. Same as exit) redo /redo (Re-execute the previously executed statement) rhistory /rhistory (Display result history) rollback /rollback (rollback changes to the database) For this to be useful, turn the autocommit off. /option autocommit=0 table_info /table_info (display all tables that exist in current database) /table_info | more (for paging) trace /trace (set DBI trace level for current database) Adjust the trace level for DBI 0 - 4. 0 off. 4 is lots of information. Useful for determining what is really happening in DBI. See DBI. type_info /type_info (display data types supported by current server) AUTHORS and ACKNOWLEDGEMENTS The DBI::Shell has a long lineage. It started life around 1994-1997 as the pmsql script written by Andreas Konig. Jochen Wiedmann picked it up and ran with it (adding much along the way) as dbimon, bundled with his DBD::mSQL driver modules. In 1998, around the time I wanted to bundle a shell with the DBI, Adam Marks was working on a dbish modeled after the Sybase sqsh utility. Wanting to start from a cleaner slate than the feature-full but complex dbimon, I worked with Adam to create a fairly open modular and very configurable DBI::Shell module. Along the way Tom Lowery chipped in ideas and patches. As we go further along more useful code and concepts from Jochen's dbimon is bound to find it's way back in. COPYRIGHT
The DBI::Shell module is Copyright (c) 1998 Tim Bunce. England. All rights reserved. Portions are Copyright by Jochen Wiedmann, Adam Marks and Tom Lowery. You may distribute under the terms of either the GNU General Public License or the Artistic License, as specified in the Perl README file. perl v5.8.0 2002-11-29 DBI::Shell(3)
All times are GMT -4. The time now is 05:09 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy