Different way to connect to database ans execute sql query
Hi Friends,
I am using AIX version and sqlplus to connect to database while writing a shell script.
I have implemented three ways to connect to database :
1)
2)
3)
********************************************
Please help me to find out the difference in above three, and how does it makes a difference if the .sql file is lying in any different location than the script location ??
Or in better words , which way is most economic to use in script for most quick execution.
Last edited by Scott; 04-28-2010 at 02:47 PM..
Reason: Code tags, please...
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)
Hi I'm looking to query a table on a database and then iterate over the results in a loop. I believe this is the last part of my script that I need (after finding out threads for passing variables to other scripts and calling functions in other scripts). I've searched the forums but the best... (8 Replies)
Hi
I am new in unix. oracle and unix are installed in my sytem.i need the script
which could connect to the oracle using username ,password and schema and can run the select * from tab query.
Thanks
vijay (8 Replies)
HI,
i want to write a script (Linux) that:
1) connect to a database oracle
2) execute some store procedure.
Can anybody help me, please?
Thanks a lot
Andrew (3 Replies)
Below i have the sample code. i need to pass the entire query from file or as parameter and read the results and write into a output file.
here the number of columns are unknown. some times it may be 2,3 or entire columns from the table.
read all the column results and write into a comma... (0 Replies)
I've been sent the following script to finish. It's supposed to connect to an oracle database, query it, and send an email if the query result value is one or more. Currently it isn't connecting properly, just giving the following error:
ERROR: ORA-01017: invalid username/password; logon denied... (2 Replies)
I have a requirement and below is the detail.
Create a shell script and needs to run in server "a".
Connect to teradata database server "b".
execute the .sql file from server "a"
Save the output of the query to a file in server "a"
Schedule this shell script to run every day for every 4... (1 Reply)
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
LEARN ABOUT DEBIAN
dbicadmin
DBICADMIN(1p) User Contributed Perl Documentation DBICADMIN(1p)NAME
dbicadmin - utility for administrating DBIx::Class schemata
SYNOPSIS
dbicadmin: [-I] [long options...]
deploy a schema to a database
dbicadmin --schema=MyApp::Schema
--connect='["dbi:SQLite:my.db", "", ""]'
--deploy
update an existing record
dbicadmin --schema=MyApp::Schema --class=Employee
--connect='["dbi:SQLite:my.db", "", ""]'
--op=update --set='{ "name": "New_Employee" }'
OPTIONS
Actions
--create
Create version diffs needs preversion
--upgrade
Upgrade the database to the current schema
--install
Install the schema version tables to an existing database
--deploy
Deploy the schema to the database
--select
Select data from the schema
--insert
Insert data into the schema
--update
Update data in the schema
--delete
Delete data from the schema
--op
compatiblity option all of the above can be suppied as --op=<action>
--help
display this help
Arguments
--schema-class
The class of the schema to load
--resultset or --resultset-class or --class
The resultset to operate on for data manipulation
--config-stanza
Where in the config to find the connection_info, supply in form MyApp::Model::DB
--config
Supply the config file for parsing by Config::Any
--connect-info
Supply the connect info as additional options ie -I dsn=<dsn> user=<user> password=<pass>
--connect
Supply the connect info as a json string
--sql-dir
The directory where sql diffs will be created
--sql-type
The RDBMs flavour you wish to use
--version
Supply a version install
--preversion
The previous version to diff against
--set
JSON data used to perform data operations
--attrs
JSON string to be used for the second argument for search
--where
JSON string to be used for the where clause of search
--force
Be forceful with some operations
--trace
Turn on DBIx::Class trace output
--quiet
Be less verbose
-I Same as perl's -I, prepended to current @INC
AUTHORS
See "CONTRIBUTORS" in DBIx::Class
LICENSE
You may distribute this code under the same terms as Perl itself
perl v5.14.2 2011-11-29 DBICADMIN(1p)