10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
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
2. Shell Programming and Scripting
Hi,
I never did this before... what I want to do is execute a SQL query from a unix script and redirect sql query's output to a flat file (comma separated one) without the header info (no column names). I would also want not to print the query's output to the screen.
snapshot of my script:... (13 Replies)
Discussion started by: juzz4fun
13 Replies
3. Programming
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)
Discussion started by: laknar
0 Replies
4. Shell Programming and Scripting
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)
sqlplus -s <USERNAME>/<PASSWORD> <<!
@<SQL FILE TO EXECUTE>
exit
!
2)
sqlplus -s <USERNAME>/<PASSWORD> <<!
-----sql statemenets... (6 Replies)
Discussion started by: gauravgarg
6 Replies
5. UNIX for Dummies Questions & Answers
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
6. UNIX for Dummies Questions & Answers
Hi guys,
I am new on here, I have a function in oracle that returns a specific value:
create or replace
PACKAGE BODY "CTC_ASDGET_SCHED" AS
FUNCTION FN_ASDSCHEDULE_GET
RETURN VARCHAR2
AS
BEGIN
DECLARE
ASDSchedule varchar2(6);
ASDComplete... (1 Reply)
Discussion started by: reptile
1 Replies
7. Shell Programming and Scripting
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
8. Shell Programming and Scripting
i'm used a sql query in a unix script to get the information from table. but unable to extract the output which i need. Any help with logic will be greatly appreciated.
my sql query provide output some thing like this -
col1 col2 count
---- ---- ------
A B 10
c D 6
e... (8 Replies)
Discussion started by: pharos467
8 Replies
9. Shell Programming and Scripting
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
10. UNIX for Dummies Questions & Answers
Hi
I want to get the a field from a SQL query into unix shell script variable. the whole situation is like this.
1. Opened a cursor to a table in DB2 databse.
2. Fetching individual rows with the help of cursor.
3. Each row has 4 fields.
I want each of the field in individual shell... (1 Reply)
Discussion started by: skyineyes
1 Replies