Sponsored Content
Top Forums Shell Programming and Scripting In a csh script, can I set a variable to the result of an SQLPLUS select query? Post 302307095 by quirkasaurus on Tuesday 14th of April 2009 02:39:17 PM
Old 04-14-2009
shouldn't count(1) be count(*) ?
i get a syntax error with count(1) within SQL.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to store query multiple result in shell script variable(Array)

:) Suppose,I have one table A. Table A have one column. Table A have 10 rows. I want this 10 rows store into shell script variable. like #!/bin/ksh v_shell_var=Hi here in call oracle , through loop How can I store table A's 10 rows into v_shell_var (Shell Script Array). Regards, Div (4 Replies)
Discussion started by: div_Neev
4 Replies

2. UNIX for Dummies Questions & Answers

select count(*) in sqlplus into variable unix shell

Need to select count(*) from table to check for zero result in unix script (2 Replies)
Discussion started by: struggle
2 Replies

3. Shell Programming and Scripting

how to convert the result of the select query to comma seperated data - urgent pls

how to convert the result of the select query to comma seperated data and put in a .csv file using korn shell. Pls help me as its very urgent. Thanks, Hema. (1 Reply)
Discussion started by: Hemamalini
1 Replies

4. Shell Programming and Scripting

Redirecting sql select query result to txt file

Hi , I just found you while surfing for the string 'Redirecting sql select query output from within a shell script to txt file/excel file' Could you find time sending me the code for the above question? It'll be great help for me. I have a perl file that calls the sql file... (1 Reply)
Discussion started by: dolphin123
1 Replies

5. Shell Programming and Scripting

Redirecting sql select query result to txt file

Hi Yogesh, Lucky that i caught you online. Yeah i read about DBI and the WriteExcel module. But the server is not supporting these modules. It said..."Cannot locate DBI"..."Cannot locate Spreadsheet::WriteExcel" I tried creating a simple text file to get the query output, but the... (1 Reply)
Discussion started by: dolphin123
1 Replies

6. UNIX for Advanced & Expert Users

Set shell variables from SQLPLUS query results

Hi All, I needed to get the result of two sqlplus queris into shell variables. After days of looking for the ultimate solution to this problem.. i found this... sqlplus -s USER/PASS@DB <<EOF | awk '{if(NR==1) printf("%s ", $1); if(NR==2) printf("%s ", $1);}' | read VAR1 VAR2 set head off... (2 Replies)
Discussion started by: pranavagarwal
2 Replies

7. Shell Programming and Scripting

redirecting oracle sqlplus select query into file

So, I would like to run differen select queries on multiple databases.. I made a script wich I thought to be called something like.. ./script.sh sql_file_name out.log or to enter select statement in a command line.. (aix) and I did created some shell script wich is not working.. it... (6 Replies)
Discussion started by: bongo
6 Replies

8. Shell Programming and Scripting

How to pass Variable from shell script to select query for SqlPlus?

echo "set echo off"; echo "set feedback off"; echo "set linesize 4000"; echo " set pagesize 0"; echo " set sqlprompt ''"; echo " set trimspool on"; Select statement is mentioned below echo "select res.ti_book_no from disney_ticket_history res where res.ti_status =${STATUS} and... (7 Replies)
Discussion started by: aroragaurav.84
7 Replies

9. Shell Programming and Scripting

Shell Script (ksh) - SQLPlus query filter using a string variable

Using ksh, I am using SQLPlus to execute a query with a filter using a string variable. REPO_DB=DEV1 FOLDER_NM='U_nmalencia' FOLDER_CHECK=$(sqlplus -s /nolog <<EOF CONNECT user/pswd_select@${REPO_DB} set echo off heading off feedback off select subj_name from subject where... (5 Replies)
Discussion started by: nkm0brm
5 Replies

10. Shell Programming and Scripting

How to set variable permanent in csh?

We are using csh on our AIX platform, if we have to export/set a specific environment variable we use setenv command but its only valid till session. How do we set that variable permanent in our csh AIX? Do we put it in userprofile file or something else? (1 Reply)
Discussion started by: aixusrsys
1 Replies
nice(1) 							   User Commands							   nice(1)

NAME
nice - invoke a command with an altered scheduling priority SYNOPSIS
/usr/bin/nice [-increment | -n increment] command [argument]... /usr/xpg4/bin/nice [-increment | -n increment] command [argument]... csh Builtin nice [-increment | +increment] [command] DESCRIPTION
The nice utility invokes command, requesting that it be run with a different system scheduling priority. The priocntl(1) command is a more general interface to scheduler functions. The invoking process (generally the user's shell) must be in a scheduling class that supports nice. If the C shell (see csh(1)) is used, the full path of the command must be specified. Otherwise, the csh built-in version of nice will be invoked. See csh Builtin below. /usr/bin/nice If nice executes commands with arguments, it uses the default shell /usr/bin/sh (see sh(1)). /usr/xpg4/bin/nice If nice executes commands with arguments, it uses /usr/xpg4/bin/sh (see ksh(1)). csh Builtin nice is also a csh built-in command with behavior different from the utility versions. See csh(1) for description. OPTIONS
The following options are supported: -increment | -n increment increment is a positive or negative decimal integer that has the same effect on the execution of the utility as if the utility had called the nice() function with the numeric value of the increment option-argument. See nice(2). nice() errors, other than EINVAL, are ignored. If not specified, an increment of 10 is assumed. The super-user may run commands with priority higher than normal by using a negative increment such as -10. A negative increment assigned by an unprivileged user is ignored. OPERANDS
The following operands are supported: command The name of a command that is to be invoked. If command names any of the special built-in utilities (see shell_builtins(1)), the results are undefined. argument Any string to be supplied as an argument when invoking command. ENVIRONMENT VARIABLES
See environ(5) for descriptions of the following environment variables that affect the execution of nice: LANG, LC_ALL, LC_CTYPE, LC_MES- SAGES, PATH, and NLSPATH. EXIT STATUS
If command is invoked, the exit status of nice will be the exit status of command. Otherwise, nice will exit with one of the following val- ues: 1-125 An error occurred. 126 command was found but could not be invoked. 127 command could not be found. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: /usr/bin/nice +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWcsu | +-----------------------------+-----------------------------+ |CSI |Enabled | +-----------------------------+-----------------------------+ /usr/xpg4/bin/nice +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWxcu4 | +-----------------------------+-----------------------------+ |CSI |Enabled | +-----------------------------+-----------------------------+ |Interface Stability |Standard | +-----------------------------+-----------------------------+ SEE ALSO
csh(1), ksh(1), nohup(1), priocntl(1), sh(1), shell_builtins(1), nice(2), attributes(5), environ(5), standards(5) SunOS 5.11 23 Jan 2004 nice(1)
All times are GMT -4. The time now is 12:33 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy