Hello,
I'm trying to make a script which reads the PID of a process using awk. I've read the thread in this forum where it is explained.
However, the problem i'm having is when attributing that PID value to a variable.
I'm using AIX 5.3.
The command is the following:
:/home/user1>ps -ef |... (2 Replies)
Hi All-
First time using iSql.
I have 4 query files - some have more than 1 line of sql statements
After a bit of research it appears I can just use the -i command and specify the input file.
Questions:
Does it matter that there are multiple queries in each file? Do I need to have... (3 Replies)
I heard this was possible but from my research I haven't been able to figure it out yet. Seems it should be simple enough. Basically from a high level view I'm trying to accomplish...
. $X='grep foo blah.log'
then 'mysql command SELECT foo FROM bar WHERE ' . $X
or something like that.
... (2 Replies)
Dear all,
¿How can i insert a variable in a AWK pattern?
I have almost succeeded in solving a puzzle with AWK but now i want to make a script. Let me explain.
cat file.txt | awk 'BEGIN {RS="\\n\\n"} /tux/ { print "\n"$0 }'
I know that this command makes right what i want to do, but mi... (8 Replies)
My script contains as follows,
VALUE=`sqlplus un/pwd <<EOF > OB.txt
set pagesize 0 feedback off verify off heading off echo off
select max(1) from table1;
exit;
EOF`
insert into table2 values(1, 'The max value is $value',...);
i need the value of VALUE to be inserted after 'The max... (2 Replies)
Hi,
I'm trying to form an insert sql query using shell programming. I have table named company with four columns 'company name', 'company id', 'company code' and 'last change id'
I have to read the company name, company code and last change id from a file delimited by | which has around 10... (4 Replies)
Hello. I am writing a simple script that reads a text file and removes records from a mysql database. The items in the text file are of the format:
firstname.middle.lastXXX, where XXX is a 3 digit number. The table has an email field that will match the firstname.middle.last. So, I thought I... (1 Reply)
I'm trying to insert a filename into awk.
filename="12345.wmv"
I have tried this:
awk '/$filename/{print $0}' infile
and this:
awk -v fn=$filename '/$fn/{print $0}' infile
How do I insert the variable into awk? (1 Reply)
I want to incorporate the variable in the for statement as a column of my processed file. In the INCORRECT example below, it is $i which corresponds to the i in my for loop:
for i in x86_64 i686; do
awk '{ print $1" "$4" "$5" "$i }'awk $file-$i > processed-$i.log
doneThanks! (3 Replies)
I have a script in which i connect to database to run a query and get the result of the query to a temp file. This works fine , now what i want is there is flat file which contains the value to be used in the query. I want to read this file line by line and then run the query for each value in that... (7 Replies)
Discussion started by: gpk_newbie
7 Replies
LEARN ABOUT CENTOS
alter_view
ALTER VIEW(7) PostgreSQL 9.2.7 Documentation ALTER VIEW(7)NAME
ALTER_VIEW - change the definition of a view
SYNOPSIS
ALTER VIEW [ IF EXISTS ] name ALTER [ COLUMN ] column_name SET DEFAULT expression
ALTER VIEW [ IF EXISTS ] name ALTER [ COLUMN ] column_name DROP DEFAULT
ALTER VIEW [ IF EXISTS ] name OWNER TO new_owner
ALTER VIEW [ IF EXISTS ] name RENAME TO new_name
ALTER VIEW [ IF EXISTS ] name SET SCHEMA new_schema
ALTER VIEW [ IF EXISTS ] name SET ( view_option_name [= view_option_value] [, ... ] )
ALTER VIEW [ IF EXISTS ] name RESET ( view_option_name [, ... ] )
DESCRIPTION
ALTER VIEW changes various auxiliary properties of a view. (If you want to modify the view's defining query, use CREATE OR REPLACE VIEW.)
You must own the view to use ALTER VIEW. To change a view's schema, you must also have CREATE privilege on the new schema. To alter the
owner, you must also be a direct or indirect member of the new owning role, and that role must have CREATE privilege on the view's schema.
(These restrictions enforce that altering the owner doesn't do anything you couldn't do by dropping and recreating the view. However, a
superuser can alter ownership of any view anyway.)
PARAMETERS
name
The name (optionally schema-qualified) of an existing view.
IF EXISTS
Do not throw an error if the view does not exist. A notice is issued in this case.
SET/DROP DEFAULT
These forms set or remove the default value for a column. A default value associated with a view column is inserted into INSERT
statements on the view before the view's ON INSERT rule is applied, if the INSERT does not specify a value for the column.
new_owner
The user name of the new owner of the view.
new_name
The new name for the view.
new_schema
The new schema for the view.
view_option_name
The name of a view option to be set or reset.
view_option_value
The new value for a view option.
NOTES
For historical reasons, ALTER TABLE can be used with views too; but the only variants of ALTER TABLE that are allowed with views are
equivalent to the ones shown above.
EXAMPLES
To rename the view foo to bar:
ALTER VIEW foo RENAME TO bar;
COMPATIBILITY
ALTER VIEW is a PostgreSQL extension of the SQL standard.
SEE ALSO
CREATE VIEW (CREATE_VIEW(7)), DROP VIEW (DROP_VIEW(7))
PostgreSQL 9.2.7 2014-02-17 ALTER VIEW(7)