I am an Oracle DBA who has been writing PL/SQL for over 15 years. You should not need to learn explicit cursors. Perhaps your instructor wants you to understand explicit cursors but you should use implicit cursors instead. You can't select from an explicit cursor so that line won't work. You can use the c1%ROWCOUNT attribute. You may want to look at PL/SQL collections.
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 OSX
dbix::class::sqlmaker::limitdialects
DBIx::Class::SQLMaker::LimitDialects(3) User Contributed Perl Documentation DBIx::Class::SQLMaker::LimitDialects(3)NAME
DBIx::Class::SQLMaker::LimitDialects - SQL::Abstract::Limit-like functionality for DBIx::Class::SQLMaker
DESCRIPTION
This module replicates a lot of the functionality originally found in SQL::Abstract::Limit. While simple limits would work as-is, the more
complex dialects that require e.g. subqueries could not be reliably implemented without taking full advantage of the metadata locked within
DBIx::Class::ResultSource classes. After reimplementation of close to 80% of the SQL::Abstract::Limit functionality it was deemed more
practical to simply make an independent DBIx::Class-specific limit-dialect provider.
SQL LIMIT DIALECTS
Note that the actual implementations listed below never use "*" literally. Instead proper re-aliasing of selectors and order criteria is
done, so that the limit dialect are safe to use on joined resultsets with clashing column names.
Currently the provided dialects are:
LimitOffset
SELECT ... LIMIT $limit OFFSET $offset
Supported by PostgreSQL and SQLite
LimitXY
SELECT ... LIMIT $offset $limit
Supported by MySQL and any SQL::Statement based DBD
RowNumberOver
SELECT * FROM (
SELECT *, ROW_NUMBER() OVER( ORDER BY ... ) AS RNO__ROW__INDEX FROM (
SELECT ...
)
) WHERE RNO__ROW__INDEX BETWEEN ($offset+1) AND ($limit+$offset)
ANSI standard Limit/Offset implementation. Supported by DB2 and MSSQL >= 2005.
SkipFirst
SELECT SKIP $offset FIRST $limit * FROM ...
Suported by Informix, almost like LimitOffset. According to SQL::Abstract::Limit "... SKIP $offset LIMIT $limit ..." is also supported.
FirstSkip
SELECT FIRST $limit SKIP $offset * FROM ...
Supported by Firebird/Interbase, reverse of SkipFirst. According to SQL::Abstract::Limit "... ROWS $limit TO $offset ..." is also
supported.
RowNum
Depending on the resultset attributes one of:
SELECT * FROM (
SELECT *, ROWNUM rownum__index FROM (
SELECT ...
) WHERE ROWNUM <= ($limit+$offset)
) WHERE rownum__index >= ($offset+1)
or
SELECT * FROM (
SELECT *, ROWNUM rownum__index FROM (
SELECT ...
)
) WHERE rownum__index BETWEEN ($offset+1) AND ($limit+$offset)
or
SELECT * FROM (
SELECT ...
) WHERE ROWNUM <= ($limit+1)
Supported by Oracle.
Top
SELECT * FROM
SELECT TOP $limit FROM (
SELECT TOP $limit FROM (
SELECT TOP ($limit+$offset) ...
) ORDER BY $reversed_original_order
) ORDER BY $original_order
Unreliable Top-based implementation, supported by MSSQL < 2005.
CAVEAT
Due to its implementation, this limit dialect returns incorrect results when $limit+$offset > total amount of rows in the resultset.
FetchFirst
SELECT * FROM
(
SELECT * FROM (
SELECT * FROM (
SELECT * FROM ...
) ORDER BY $reversed_original_order
FETCH FIRST $limit ROWS ONLY
) ORDER BY $original_order
FETCH FIRST $limit ROWS ONLY
)
Unreliable FetchFirst-based implementation, supported by IBM DB2 <= V5R3.
CAVEAT
Due to its implementation, this limit dialect returns incorrect results when $limit+$offset > total amount of rows in the resultset.
RowCountOrGenericSubQ
This is not exactly a limit dialect, but more of a proxy for Sybase ASE. If no $offset is supplied the limit is simply performed as:
SET ROWCOUNT $limit
SELECT ...
SET ROWCOUNT 0
Otherwise we fall back to "GenericSubQ"
GenericSubQ
SELECT * FROM (
SELECT ...
)
WHERE (
SELECT COUNT(*) FROM $original_table cnt WHERE cnt.id < $original_table.id
) BETWEEN $offset AND ($offset+$rows-1)
This is the most evil limit "dialect" (more of a hack) for really stupid databases. It works by ordering the set by some unique column, and
calculating the amount of rows that have a less-er value (thus emulating a "RowNum"-like index). Of course this implies the set can only be
ordered by a single unique column.
Also note that this technique can be and often is excruciatingly slow. You may have much better luck using "software_limit" in
DBIx::Class::ResultSet instead.
Currently used by Sybase ASE, due to lack of any other option.
AUTHORS
See "CONTRIBUTORS" in DBIx::Class.
LICENSE
You may distribute this code under the same terms as Perl itself.
perl v5.16.2 2012-08-23 DBIx::Class::SQLMaker::LimitDialects(3)