Your goal is to loop through all tables in schema HR, count the records and display the results? The reason your procedure shows the error is because tab_var and not the content of the variable with that name is treated as the tablename for the SELECT statement.
You'll have to use dynamic SQL for your task:
EDIT: seems like Gandof989 was a few minutes faster but came to the same conclusion
dear friends,
I have a large size file containg two fields data
like this
*** ****
122 222
***** *****
***** *****
232 233
i have file like this.
i want to remove blank lines from file .
i think awk is servive this problem
i wrote a awk command but the error is... (3 Replies)
Dear friends,
I am writing shell script in csh .
i want to make arthimatic operation in csh.
i wrote sysntax like this.
set val = 230
set tmp = `0.1 * $val + 300`
echo $tmp
but it is not working .
anyone please give me syntax. (3 Replies)
m kinda new to unix. i have been trying to write a script where i am trying to switch between users.
but the problem is that the syntax like USERNAME/PASSWORD (like oracle SCOT/TIGER) is not working.
if i write su USERNAME then the script goes to the command prompt and asks for user to enter... (0 Replies)
I am calculating a time and appending a space in front of it to get only certain records in a file because the times are represented in HH:II:SS format and I don't want to see anything other than the actual hour and minute combination (hence appending the space to the front of the time). My... (9 Replies)
I have one File named "txt_file"
# cat txt_file
<DBType>RT</DBType>
<AppType>RT</AppType>
--------------------------------------------------
I want replace "<AppType>RT</AppType>" to
<AppType>XY</AppType> in txt_file and output redirect to Newfile
... (2 Replies)
Hi guys,
Basically I'm trying to write a CShell script that calls an awk script on a given directory (given in command-line). I keep getting a syntax error with my code though:
#!/bin/csh
set dir = $ARGV
foreach file ( $dir/* )
set output = 'awk -f /Desktop/aal $file'
echo... (3 Replies)
Hello,
I have perl script,which take some part of data in the file.
the below command works fine in normal cmd prompt.
`awk '/CDI/ && // && !/Result for/ {print $3 $5 > "final.txt"}' datalist.txt`;
`nawk -F"" '{print $2}' finalcdi.txt`;
But not working.
Please use code tags, thanks. (5 Replies)
I'm calling the following if-else from nawk. But I keep getting an error at the "else". I've tried putting more brackets and ; but still I get complaints about the "else".
Any ideas ?
Thanks,
wbrunc
BEGIN { FS = "," ; OFS = "," }
{ if ( $8 ~ /A/ && $9 == B )
$1="4/29/2013" ;
$2="J.Doe"... (2 Replies)
awk -v sw="lemons|dogs" 'NR>100 && NR<200 BEGIN { c=split(sw,a,""); } { for (w in a) { if ($0 ~ a) d]++; } }
END { for (i in a) { o=o (a"="(d]?d]:0)","); }
sub(",*$","",o); print o;
}' /home/jahitt/data.txt
what am i doing wrong with the above code? im pretty sure the issue is in the... (6 Replies)
Discussion started by: SkySmart
6 Replies
LEARN ABOUT SUSE
create_constraint_trigger
CREATE CONSTRAINT TRIGGER(7) SQL Commands CREATE CONSTRAINT TRIGGER(7)NAME
CREATE CONSTRAINT TRIGGER - define a new constraint trigger
SYNOPSIS
CREATE CONSTRAINT TRIGGER name
AFTER event [ OR ... ]
ON table_name
[ FROM referenced_table_name ]
{ NOT DEFERRABLE | [ DEFERRABLE ] { INITIALLY IMMEDIATE | INITIALLY DEFERRED } }
FOR EACH ROW
EXECUTE PROCEDURE funcname ( arguments )
DESCRIPTION
CREATE CONSTRAINT TRIGGER creates a constraint trigger. This is the same as a regular trigger except that the timing of the trigger firing
can be adjusted using SET CONSTRAINTS [set_constraints(7)]. Constraint triggers must be AFTER ROW triggers. They can be fired either at
the end of the statement causing the triggering event, or at the end of the containing transaction; in the latter case they are said to be
deferred. A pending deferred-trigger firing can also be forced to happen immediately by using SET CONSTRAINTS.
PARAMETERS
name The name of the constraint trigger. This is also the name to use when modifying the trigger's behavior using SET CONSTRAINTS. The
name cannot be schema-qualified -- the trigger inherits the schema of its table.
event One of INSERT, UPDATE, or DELETE; this specifies the event that will fire the trigger. Multiple events can be specified using OR.
table_name
The (possibly schema-qualified) name of the table in which the triggering events occur.
referenced_table_name
The (possibly schema-qualified) name of another table referenced by the constraint. This option is used for foreign-key constraints
and is not recommended for general use.
DEFERRABLE
NOT DEFERRABLE
INITIALLY IMMEDIATE
INITIALLY DEFERRED
The default timing of the trigger. See the CREATE TABLE [create_table(7)] documentation for details of these constraint options.
funcname
The function to call when the trigger is fired. See CREATE TRIGGER [create_trigger(7)] for details.
arguments
Optional argument strings to pass to the trigger function. See CREATE TRIGGER [create_trigger(7)] for details.
COMPATIBILITY
CREATE CONSTRAINT TRIGGER is a PostgreSQL extension of the SQL standard.
SEE ALSO
CREATE TRIGGER [create_trigger(7)], DROP TRIGGER [drop_trigger(7)], SET CONSTRAINTS [set_constraints(7)]
SQL - Language Statements 2010-05-14 CREATE CONSTRAINT TRIGGER(7)