06-06-2008
How to deal with long records (> 8k)??
Still working on manipulating SQL statements. Some are very long (10-20k). I'm using a shell script to read the SQL statements that are stored in a DB2 table and writing the records out to a file on Unix. The records appear to be getting truncated at 8k.
Is there any way for me to avoid the truncation??
fwiw, here's the code:
while (( $fetchrc == 0 )); do
sqlrow=`db2 +cp -x fetch from c1 `
fetchrc=$?
echo "$sqlrow"|tr -s " "
done
9 More Discussions You Might Find Interesting
1. What is on Your Mind?
Okay, I don't know how this is funny, but it is. I found this while searching for Linux (please don't ask). :o (0 Replies)
Discussion started by: gnerd
0 Replies
2. Shell Programming and Scripting
I have a flat file and need to count no of records in the file less the header and the trailer record.
I would appreciate any and all asistance
Thanks
Hadi Lalani (2 Replies)
Discussion started by: guiguy
2 Replies
3. Programming
hi
how to deal with hardware in c or c++?
i need to learn how open CD and close any hard >>> and control hardware
:) (2 Replies)
Discussion started by: hgphsf
2 Replies
4. Shell Programming and Scripting
Hi All,
I have two files say file1 and file2.
I want to check the number of records in file1 and if its atleast 2 (i.e., 2 or greater than 2 ) then I have to check records in file2 .If records in file2 is atleast 1 (i.e. if its not empty ) i have to set some conditions .
Could you pls... (3 Replies)
Discussion started by: mavesum
3 Replies
5. Shell Programming and Scripting
Hi all,
I'm new in unix scripting and I've a problem with a script... :confused:
I need to read a file, add some fields in the records, and write them in another file, but even when I simply read and write the records, the shell interprets some caracters and the result is that the records... (5 Replies)
Discussion started by: Macs_Linux
5 Replies
6. UNIX for Dummies Questions & Answers
Hi everyone.
I am a newbie to Linux stuff. I have this kind of problem which couldn't solve alone. I have a text file with records separated by empty lines like this:
ID: 20
Name: X
Age: 19
ID: 21
Name: Z
ID: 22
Email: xxx@yahoo.com
Name: Y
Age: 19
I want to grep records that... (4 Replies)
Discussion started by: Atrisa
4 Replies
7. Shell Programming and Scripting
Hi Freinds ,
I have 2 files .
File 1
|nag|HYd|1|Che
|esw|Gun|2|hyd
|pra|bhe|3|hyd
|omu|hei|4|bnsj
|uer|oeri|5|uery
File 2
|nag|HYd|1|Che
|esw|Gun|2|hyd
|uer|oi|3|uery
output : (9 Replies)
Discussion started by: i150371485
9 Replies
8. Windows & DOS: Issues & Discussions
Hi Experts,
I have a Unix csv file which has long records ie the record length is more than 80 so it goes to the next line.So when its in unix though it spans to two or three lines it still counts it as one record.
But what is happening is for the records that are long when i copy it into excel i... (0 Replies)
Discussion started by: 100bees
0 Replies
9. Shell Programming and Scripting
Hi I am new to shell programming in unix
Please if I can provide help.
I have a file structure of a header record and "N" detail records.
The header record will be the total number of detail records
I need to split the file in 2:
One for the header
Another for all detail records
Could... (1 Reply)
Discussion started by: jamcogar
1 Replies
LEARN ABOUT DEBIAN
sql::translator::producer::oracle
SQL::Translator::Producer::Oracle(3pm) User Contributed Perl Documentation SQL::Translator::Producer::Oracle(3pm)
NAME
SQL::Translator::Producer::Oracle - Oracle SQL producer
SYNOPSIS
use SQL::Translator;
my $t = SQL::Translator->new( parser => '...', producer => 'Oracle' );
print $translator->translate( $file );
DESCRIPTION
Creates an SQL DDL suitable for Oracle.
producer_args
delay_constraints
This option remove the primary key and other key constraints from the CREATE TABLE statement and adds ALTER TABLEs at the end with it.
quote_field_names
Controls whether quotes are being used around column names in generated DDL.
quote_table_names
Controls whether quotes are being used around table, sequence and trigger names in generated DDL.
NOTES
Autoincremental primary keys
This producer uses sequences and triggers to autoincrement primary key columns, if necessary. SQLPlus and DBI expect a slightly different
syntax of CREATE TRIGGER statement. You might have noticed that this producer returns a scalar containing all statements concatenated by
newlines or an array of single statements depending on the context (scalar, array) it has been called in.
SQLPlus expects following trigger syntax:
CREATE OR REPLACE TRIGGER ai_person_id
BEFORE INSERT ON person
FOR EACH ROW WHEN (
new.id IS NULL OR new.id = 0
)
BEGIN
SELECT sq_person_id.nextval
INTO :new.id
FROM dual;
END;
/
Whereas if you want to create the same trigger using "do" in DBI, you need to omit the last slash:
my $dbh = DBI->connect('dbi:Oracle:mysid', 'scott', 'tiger');
$dbh->do("
CREATE OR REPLACE TRIGGER ai_person_id
BEFORE INSERT ON person
FOR EACH ROW WHEN (
new.id IS NULL OR new.id = 0
)
BEGIN
SELECT sq_person_id.nextval
INTO :new.id
FROM dual;
END;
");
If you call this producer in array context, we expect you want to process the returned array of statements using DBI like "deploy" in
DBIx::Class::Schema does.
To get this working we removed the slash in those statements in version 0.09002 of SQL::Translator when called in array context. In scalar
context the slash will be still there to ensure compatibility with SQLPlus.
CREDITS
Mad props to Tim Bunce for much of the logic stolen from his "mysql2ora" script.
AUTHORS
Ken Youens-Clark <kclark@cpan.org>, Alexander Hartmaier <abraxxa@cpan.org>, Fabien Wernli <faxmodem@cpan.org>.
SEE ALSO
SQL::Translator, DDL::Oracle, mysql2ora.
perl v5.14.2 2012-01-18 SQL::Translator::Producer::Oracle(3pm)