hi,
can anyone help me by saying how can i spool a unix file.. do we need to specify the pathname as such to spool the file ..
right now, i tried giving like spool filename in the sql prompt.. but its not giving me the required output even if i can see that the command is being executed..
... (2 Replies)
HI
Have some problem with spooling out some relatively large number of records (~2-3 mil)
Small table - OK though.
Getting error: SP2 0308: cannot close spool file.
Any thoughts?
sqlplus -s user/pwd << EOF
set term off
set head off
set trims on
set pages 0
set... (1 Reply)
Dear Gurus,
Tried searching for some clues in this forum but dont seem to be able to find my answer. :confused:
Anyway i have a quick question:
Today I have produced a messages generated from a application and placed them on the print queue. Before this I had stopped the printer queue, so... (2 Replies)
Hi,
Iam a newbie. When I give the below query at SQL prompt.
SQL> select col1||'`ß`'||col2 from tablename where rownum<2;
1-J7WGX`ß`1-7OKC-23
Iam getting ß within appostropies...... If I remove appostropies and give the query it is throwing an error.
If I give the same query in spool as... (1 Reply)
hi all,
am trying to write a ksh script which will take a username, password, db instance as input arguments and login to the database using sqlplus and select some data via sql and spool to a file.
problem is that i am using "sqlplus -s" in order to hide the username/password and it doesnt... (8 Replies)
Hi
#Testing for file existence
if ; then
echo 'SCHOOL data is available for processing'
else
echo 'SCHOOL DATA IS NOT AVAILABLE FOR PROCESSING'
:
i wrote a script, where it begins by checking if file exists or not.
If it exists, it truncates the database... (2 Replies)
Hello,
I am trying to spool data from database into a file on solaris through ksh.
Data is getting fetched but the problem is record is getting split in to multiple lines.
excerpt from sql is
whenever sqlerror exit 1;
set define on
set echo off
set feed off
set head off
set... (1 Reply)
Hi All,
I have a problem with the column heading while spooling the data from the database. Since i want the column header, therefore i am not using SET HEADING OFF, and i am getting the header, but for the longer column name, some of the character from the column name is missing.
for... (7 Replies)
Hi,
I have a requirement of
Connecting to sqlplus from unix
Execute the package. The output of package is stored in a table
Need to query the table and move to txt file.
The problem iam facing is, when I try to spool the file. I get the sql query also along with the output.... (6 Replies)
Hello,
I have a shell script through which I am executing .sql file and spooling the result of Query from .sql . I want to spool the result in ascending order. Is there any parameter to be set to print result in ascending or descending order.
Thanks in advance. (4 Replies)
Discussion started by: Aparna.N
4 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)