Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Not able to write SQL query output in to .csv file with shell script. Post 303036092 by Neo on Thursday 13th of June 2019 11:51:26 PM
Old 06-14-2019
You should attempt to write the code to process (parse) your text.

Your shell script had no basic code to process the text in your output.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

need help in reading a output of a sql query in unix script

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

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 sql data file in unix csv file as input to an sql query from shell

Hi , I used the below script to get the sql data into csv file using unix scripting. I m getting the output into an output file but the output file is not displayed in a separe columns . #!/bin/ksh export FILE_PATH=/maav/home/xyz/abc/ rm $FILE_PATH/sample.csv sqlplus -s... (2 Replies)
Discussion started by: Nareshp
2 Replies

4. Shell Programming and Scripting

SQL Script's output to a CSV file

I need to call and execute an SQL script within a KSH script and get the output/extracted data into a CSV file. Is there any way to get the out put in a CSV file other than spooling ? I tried spooling. Problem is if there is any wrning/comment/Error they all will be spooled into the csv file. I... (4 Replies)
Discussion started by: Sriranga
4 Replies

5. Shell Programming and Scripting

Problem in formatting output of SQL query in excel sheet in shell script

Hi Guys.. Need your help to format the output of my shell script. I am using spool command to take out put in csv file. below is my code. (for example) col USERNAME for a15 col EMAIL for a30 col FULL_NAME for a20 col LAST_LOGIN for a40 col DATE_CREATED for a40 SPOOL 120.csv... (3 Replies)
Discussion started by: Agupte
3 Replies

6. Shell Programming and Scripting

SQL query in UNIX script - output in flat file

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

7. Shell Programming and Scripting

SQL Query in Shell Script output formatting

Hi All, #!/bin/ksh call_sql () { sql=$1 sqlplus -s $sqlparam_sieb <<EOF SET ECHO OFF; SET NEWPAGE NONE; SET SQLBL OFF; SET VERIFY OFF; SET LINESIZE 2000; SET... (2 Replies)
Discussion started by: Kevin Tivoli
2 Replies

8. Shell Programming and Scripting

Need to write shell script for my .sql file call

Hi Guys, I need to write a simple shell script which will generate a .csv file/report by calling .sql file inside a shell script. Can somebody help me on this. Thanks in advance! Regards, LK (7 Replies)
Discussion started by: lakshmanraok117
7 Replies

9. Shell Programming and Scripting

Run sql query in shell script and output data save as delimited text

I want to run sql query in shell script and output data save as delimited text (delimited text would be comma) Code: SPOOL_FILE=/pgedw/dan.txt SQL=/pgedw/dan.sql sqlplus -s username/password@myhost:port/servicename <<EOF set head on set COLSEP , set linesize 32767 SET TRIMSPOOL ON SET... (8 Replies)
Discussion started by: Jaganjag
8 Replies

10. Shell Programming and Scripting

Shell script appending output of sql query

I am writing the following script to create the file v_out.txt. sqlplus -s /nolog << EOF CONNECT scott/tiger@orcl; whenever sqlerror exit sql.sqlcode; set newpage 0; SET PAGESIZE 0; SET ECHO OFF; SET FEEDBACK OFF; SET HEADING OFF; SET VERIFY OFF; SET LINESIZE 100; set tab off; set... (7 Replies)
Discussion started by: itzkashi
7 Replies
plock(2)							System Calls Manual							  plock(2)

NAME
plock() - lock process, text, data, stack, or shared library in memory SYNOPSIS
DESCRIPTION
The system call allows the calling process to lock the text segment of the process (text lock), its data segment (data lock), or both its text and data segment (process lock) into memory. Stack segments are also locked when data segments are locked. Shared library text and shared library data segments (shlib lock) can also be locked. Locked segments are immune to all routine swapping. also allows these seg- ments to be unlocked. The effective user ID of the calling process must be a user with the privilege. op must be one of the following: Lock text and data segments into memory (process lock) Lock text segment into memory (text lock) Lock data segment into memory (data lock) Remove locks Lock shared library text and shared library data segments (shared library lock) Lock text, data and shared library text and shared library data segments into memory (process and shared library lock) Lock text, shared library text and shared library data segments into memory (text and shared library lock) Lock data, shared library text and shared library data segments into memory (data and shared library lock) Although and the family of functions may be used together in an application, each may affect the other in unexpected ways. This practice is not recommended. Security Restrictions Some or all of the actions associated with this system call require the privilege. Processes owned by the superuser have this privilege. Processes owned by other users may have this privilege, depending on system configuration. See privileges(5) for more information about privileged access on systems that support fine-grained privileges. RETURN VALUE
returns the following values: Successful completion. Failure. The requested operation is not performed. is set to indicate the error. ERRORS
If fails, is set to one of the following values. op is equal to and a process lock, a text lock, or a data lock already exists on the calling process. op is equal to and a text lock or process lock already exists on the calling process. op is equal to and a data lock, or process lock already exists on the calling process. op is equal to and no type of lock exists on the calling process. op is equal to and there are no unlocked shared library segments in the calling process. op is equal to and a process lock, a text lock, or a data lock already exists on the calling process. op is equal to and a text lock or process lock already exists on the calling process. op is equal to and a data lock, or process lock already exists on the calling process. op is not equal to one of the values specified in is not allowed in a window. See vfork(2). There is not enough lockable memory in the system to satisfy the locking request. The effective user ID of the calling process is not a user with the privilege. EXAMPLES
The following call to locks the calling process in memory: SEE ALSO
setprivgrp(1M), exec(2), exit(2), fork(2), getprivgrp(2), mlock(2), vfork(2), privileges(5). STANDARDS CONFORMANCE
plock(2)
All times are GMT -4. The time now is 06:05 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy