Sponsored Content
Top Forums Shell Programming and Scripting Cannot get literal ampersand to display in SQL output Post 302669807 by jim mcnamara on Wednesday 11th of July 2012 10:44:37 AM
Old 07-11-2012
The output has to be in text surrounded by quotes - single or double -- && is a keyword in shell
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

ampersand

What is the & for in Unix?? say for example that you have a line in a shellscript that will startup a executable and you have the ampersand at the end of the line, what is it for?? any info you could spare would be much appreciated thanks in advance (1 Reply)
Discussion started by: eloquent99
1 Replies

2. Programming

The Ampersand

In my program, I'm using argc and argv to accept command line arguments. However, if I have to get the '&' to work i.e. make it run the child as a background process, do I have to write some special code in C or does Unix handle it automatically? If I have to add the special code, how does it look... (2 Replies)
Discussion started by: Legend986
2 Replies

3. UNIX for Dummies Questions & Answers

Command display output on console and simultaneously save the command and its output

Hi folks, Please advise which command/command line shall I run; 1) to display the command and its output on console 2) simultaneous to save the command and its output on a file I tried tee command as follows; $ ps aux | grep mysql | tee /path/to/output.txt It displayed the... (7 Replies)
Discussion started by: satimis
7 Replies

4. Shell Programming and Scripting

How to display fields and values in sql+ for Oracle DB

Hello, I'm trying to do a select for an Oracle table but the output gives me only filelds values without fields name as in Informix. Is there anyway to display both in output ? For instance, the output will be : Name Rico Age 30 Position Engineer Thx, (5 Replies)
Discussion started by: rany1
5 Replies

5. UNIX for Advanced & Expert Users

v$sql not display correct sql_text

Hi folks, I am facing one problem with v$sql, i need to store updating sql query in temp table when one trigger get fired on some update sql statement. but with "sql_text" , i am not getting correct update statement in temp table. I am getting sql_text with this cursor statement. select... (0 Replies)
Discussion started by: apskaushik
0 Replies

6. Shell Programming and Scripting

Awk script to run a sql and print the output to an output file

Hi All, I have around 900 Select Sql's which I would like to run in an awk script and print the output of those sql's in an txt file. Can you anyone pls let me know how do I do it and execute the awk script? Thanks. (4 Replies)
Discussion started by: adept
4 Replies

7. Shell Programming and Scripting

Display the output

Hi, I have the following output of a shell script k m == -77.2820 (Act=79.9) i want to display only k m (6 Replies)
Discussion started by: sreejithalokkan
6 Replies

8. Shell Programming and Scripting

sed Ampersand

I want to add the character "<" to the end of each line of input using the & function in SED. Something like: sed 's/.*/&\</' It's important to use the &, not another method, because I want to know what I'm doing wrong. Thanks (5 Replies)
Discussion started by: rlopes
5 Replies

9. Programming

SQL*PLUS How to display a count of 0

Hi, I have been frantically googling and checking some sqlplus forums, but can't find the correct syntax. Basically within sqlplus I want to do a count on a table and if the count is 0 it displays 0 instead of "no rows found". For eample: select count(*) from tableA where... (3 Replies)
Discussion started by: chris01010
3 Replies

10. Shell Programming and Scripting

Storing multiple sql queries output into variable by running sql command only once

Hi All, I want to run multiple sql queries and store the data in variable but i want to use sql command only once. Is there a way without running sql command twice and storing.Please advise. Eg : Select 'Query 1 output' from dual; Select 'Query 2 output' from dual; I want to... (3 Replies)
Discussion started by: Rokkesh
3 Replies
vc(1)							      General Commands Manual							     vc(1)

Name
       vc - version control program

Syntax
       vc [-a] [-t] [-cchar] [-s] [keyword=value... keyword=value]

Description
       The  command  copies lines from the standard input to the standard output under control of its arguments and control statements encountered
       in the standard input.  In the process of performing the copy operation, user declared keywords may be replaced by their string value  when
       they appear in plain text and/or control statements.

       The  copying  of  lines from the standard input to standard output is conditional.  It is based on tests (in control statements) of keyword
       values specified in control statements or as command arguments.

       A control statement is a single line beginning with a control character, except as modified by the -t keyletter (see below).   The  default
       control character is colon (:), except as modified by the -c keyletter (see below).  Input lines beginning with a backslash () followed by
       a control character are not control lines and are copied to the standard output with the backslash removed.  Lines beginning with  a  back-
       slash followed by a noncontrol character are copied in their entirety.

       A  keyword  is  composed of 9 or fewer alphanumerics; the first must be alphabetic.  A value is any ASCII string that can be created with A
       numeric value is an unsigned string of digits.  Keyword values should contain blanks or tabs.

       Replacement of keywords by values occurs whenever a keyword surrounded by control characters is encountered on a version control statement.
       The  -a keyletter (see below) forces replacement of keywords in all lines of text.  An uninterpreted control character may be included in a
       value by preceding it with .  If a literal  is desired, then it too must be preceded by .

Options
       Keyletter arguments:

       -a Replaces the keywords surrounded by control characters in all text lines.

       -cchar
	  Specifies a control character to be used in place of :.

       -s Suppresses all warning messages.

       -t Ignores all characters from the beginning of the line to the first tab character.  If one is found, all characters up to  and  including
	  the tab are discarded.

Version Control Statements:
       :dcl  keyword[, ..., keyword]
	    Used to declare keywords.  All keywords must be declared.

       :asg keyword=value
	    Used  to  assign  values to keywords.  An asg statement overrides the assignment for the corresponding keyword on the command line and
	    all previous asg's for that keyword.  Keywords declared, but not assigned values have null values.

       :if condition
	    .
	    .
	    .
       :end
	    Used to skip lines of the standard input. If the condition is true all lines between the if statement and the matching  end  statement
	    are  copied  to  the  standard  output.  If the condition is false, all intervening lines are discarded, including control statements.
	    Note that intervening if statements and matching end statements are recognized solely for the purpose of maintaining the proper if-end
	    matching.
	    The syntax of a condition is:

	     <cond>  ::= [ "not" ] <or>
	     <or>    ::= <and> | <and> "|" <or>
	     <and>   ::= <exp> | <exp> "&" <and>
	     <exp>   ::= "(" <or> ")" | <value> <op> <value>
	     <op>    ::= "=" | "!=" | "<" | ">"
	     <value> ::= <arbitrary ASCII string> | <numeric string>

	    The available operators and their meanings are:

	       =      equal
	       !=     not equal
	       &      and
	       |      or
	       >      greater than
	       <      less than
	       ( )    used for logical groupings
	       not    may only occur immediately after the if, and
		      when present, inverts the value of the
		      entire condition

	    The  >  and  < operate only on unsigned integer values.  For example, : 012 > 12 is false).  All other operators take strings as argu-
	    ments.  For example, fB: 012 != 12 is true).  The precedence of the operators (from highest to lowest) is:
	       = != > <      all of equal precedence
	       &
	       |
	    Parentheses can be used to alter the order of precedence.
	    Values must be separated from operators or parentheses by at least one blank or tab.

       ::text
	    Used for keyword replacement on lines that are copied to the standard output.  The two leading control  characters	are  removed,  and
	    keywords  surrounded  by  control  characters  in text are replaced by their value before the line is copied to the output file.  This
	    action is independent of the -a keyletter.

       :on

       :off
	    Turn on or off keyword replacement on all lines.

       :ctl char
	    Change the control character to char.

       :msg message
	    Prints the given message on the diagnostic output.

       :err message
	    Prints the given message followed by:
		 ERROR: err statement on line ... (915)
	    on the diagnostic output.  The command halts execution, and returns an exit code of 1.

Diagnostics
       Use for explanations.

Exit Codes
       0 - normal
       1 - any error

																	     vc(1)
All times are GMT -4. The time now is 09:05 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy