Sponsored Content
Top Forums Shell Programming and Scripting SQLPLUS command with more than 1 select statement Post 302901294 by Pratiksha Mehra on Tuesday 13th of May 2014 07:15:20 AM
Old 05-13-2014
processId is any number: the output is like:

8742
N
these are the values returned by 2 select queries
 

10 More Discussions You Might Find Interesting

1. 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

2. UNIX and Linux Applications

Oracle Select IN statement

If I recall, when I used informix I could do a sql statement like: SELECT Value from Table WHERE ID in (100,200,300); How do I do this in Oracle? I believe I am using Oracle 10 if that matters. Thanks. (1 Reply)
Discussion started by: benefactr
1 Replies

3. Shell Programming and Scripting

In a csh script, can I set a variable to the result of an SQLPLUS select query?

Can someone tell me why I'm getting error when I try to run this? #!/bin/csh -f source ~/.cshrc # set SQLPLUS = ${ORACLE_HOME}/bin/sqlplus # set count=`$SQLPLUS -s ${DB_LOGIN} << END select count(1) from put_groups where group_name='PC' and description='EOD_EVENT' and serial_number=1;... (7 Replies)
Discussion started by: gregrobinsonhd
7 Replies

4. 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

5. UNIX for Advanced & Expert Users

SQLPlus Select with Grep

I m trying to grep 'select * from' from a script, but the problem is with the * ... I think its taking * as some special character ... when I try to do grep '*' test (test is my test file) its displaying * But when I am trying to do grep 'select * from' test its not showing anything... (2 Replies)
Discussion started by: RDR
2 Replies

6. UNIX and Linux Applications

linux sqlplus select results writes into file twice

Hello, This is my first post and its because I could not find solution for myself I decided to ask help here. What I want to do; I want to get some data from a table 1 on server 1 and insert those datas into a table 2 on server 2. ( lets say schema names are server1 and server 2 also ).... (10 Replies)
Discussion started by: azuahaha
10 Replies

7. Programming

SQLPlus Case statement on a substring

Hi, I have an SQL query that returns a substring of a field and I want to work a case statement on it, but either I get a syntax error or in it's current manifestation the case is ignored all together. select distinct dbms_lob.substr(msg_body,1,4) as networkId, A_STATUS, count(*) from... (1 Reply)
Discussion started by: chris01010
1 Replies

8. Shell Programming and Scripting

Connecting sqlplus from UNIX with multiple select statement

hi, i have a requirement where i need to connect sqlplus from unix and i am able to do so by following command: cust_count=`sqlplus -s $ORACLE_USER/$ORACLE_PASS@$ORACLE_SID << EOF set pagesize 0 set feedback off set verify off ... (1 Reply)
Discussion started by: lovelysethii
1 Replies

9. Shell Programming and Scripting

Use sqlplus statement inside case sentence

Hello, I have a problem. I want to launch a different sql queries for different shell parameter values, something like this. #/bin/bash case $1 in "A") sqlplus -s user/pass << SQL query A; SQL "B") sqlplus -s user/pass << SQL2 ... (3 Replies)
Discussion started by: Vares
3 Replies

10. 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
setlocale(3)						     Library Functions Manual						      setlocale(3)

Name
       setlocale - set localization for internationalized program

Syntax
       #include <locale.h>

       char *setlocale (category, locale)
       int category;
       char *locale;

Description
       The  function changes or queries the run-time environment of the program.  The function can affect the settings of language, territory, and
       codeset in the program's environment.

       In the category argument, you specify what part of the run-time environment you want to affect. Possible values for category are  shown	in
       the following table:

       ---------------------------------------------------------------------------
		     Effect of Specifying		    Environment Variable
       category      the Value				    Affected
       ---------------------------------------------------------------------------
       LC_ALL	     Sets or queries entire environment     LANG
       LC_COLLATE    Changes	or    queries	collation   LC_COLLATE
		     sequences
       LC_CTYPE      Changes or queries character classi-   LC_CTYPE
		     fication
       LC_NUMERIC    Changes  or  queries  number  format   LC_NUMERIC
		     information
       LC_TIME	     Changes or queries  time  conversion   LC_TIME
		     parameters
       LC_MONETARY   Changes or queries monetary informa-   LC_MONETARY
		     tion
       ---------------------------------------------------------------------------

       You change only one part of the program's locale in a single call to unless you use the category

       The locale argument is a pointer to a character string containing the required setting of category in the following format:
       language[_territory[.codeset]][@modifier]
       You use language to specify the native language you want in the program environment.  You can specify what dialect of the  native  language
       you  want in _territory, and the codeset to be used in codeset.	For example, the following string specifies the French native language, as
       spoken in France (as opposed to Switzerland), and the Digital Multinational Character Set:
       LANG = FRE_FR.MCS
       You use @modifier to select a specific instance of an environment setting within a single category.  For example, you could  use  @modifier
       to select dictionary sorting of data, as opposed to telephone directory sorting.  You can use @modifier for all categories, except

       The following preset values of locale are defined for all the settings of category:

       "C"	 Specifies  setting the locale to the minimum C language environment, as specified by the ANSI standard for the C language. (Draft
		 ANSI X3.159)

       ""	 Specifies using the environment variable corresponding to category to set the locale.	If the appropriate environment variable is
		 not set, the environment variable is used.  If is not set, returns an error.

       NULL	 Queries  the  current international environment and returns current locale setting.  You can use the string returns only as input
		 to a subsequent call; in particular, the string cannot be printed for category The string returns is a  pointer  to  static  data
		 area that might be written over.

   International Environment
       INTLINFO       The  INTLINFO  environment  variable  specifies the directory to search for language databases. The default is to search the
		      directory.

Examples
       The following calls to the function set the environment to the French language and then modify the collating sequence to German	dictionary
       collation:
       setlocale (LC_ALL, "FRE_FR.MCS");
       setlocale (LC_COLLATE, "GER_DE.MCS@dict");
       You can use the function to bind the specific language requirements of a user to the program as follows:
       status = setlocale (LC_ALL, "");
       For  this  example to work properly, the user of the international program sets the LANG variable before running the program.  Once LANG is
       set and the program runs, this call causes to use the definition of LANG to set the current locale.  You should test the value of after the
       call completes to be sure no errors occur.

Return Values
       If  you pass valid setting for category and locale, other than NULL, changes the current locale and returns the string associated with that
       locale.

       If locale is NULL, returns the string associated with category for the current locale.	The  current  locale  is  unchanged.   The  string
       returns may not be in a printable format.

       If either the category or locale argument is invalid, returns The function does not modify the locale if any part of the call is invalid.

       The  function stores its return values in a data area that may be written over. You should move the return value to another location if you
       want to use it in your program.

See Also
       ic(1int), nl_langinfo(3int), printf(3int), environ(5int), lang(5int)
       Guide to Developing International Software

																      setlocale(3)
All times are GMT -4. The time now is 10:56 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy