Building Very Large Records

G

Greg Lindstrom

Hello-

I am working on a routine to pull information from an Oracle database and
format it into fixed-length records. My problem is that the record layout
is quite long (over 500 bytes) and contains dozens of fields. How would
*you* go about building such a beast? I know that using the += operator is
a bad idea, as it creates a new copy of the string each time. How about the
struct.pack() method? A very big '%-12.12s%-50.50s.......' statement?
Other ideas? It does not have to be blazingly fast, but it doesn't have to
suck, either. I don't know enough about Oracle SQL yet, could I format the
data in the SQL call?

Thanks,

Greg Lindstrom (501) 975-4859
NovaSys Health (e-mail address removed)

"We are the music makers, and we are the dreamers of dreams" W.W.
 
A

Alex Martelli

Greg Lindstrom said:
Hello-

I am working on a routine to pull information from an Oracle database and
format it into fixed-length records. My problem is that the record layout
is quite long (over 500 bytes) and contains dozens of fields. How would
*you* go about building such a beast? I know that using the += operator is
a bad idea, as it creates a new copy of the string each time. How about the
struct.pack() method? A very big '%-12.12s%-50.50s.......' statement?

Yep, except that what you're quoting ain't a statement, just a string.
But put a % after it and the right tuple after that, and you''re going
somewhere!-)


Alex
 
E

Elbert Lev

I don't know enough about Oracle SQL yet, could I format the data in
the SQL call?

This would be the best solution. Especially if done via stored
procedure. I also do not know how to do this in Oracle. In MSSQL I
would write an extended stored prosedure.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Sharing Base Class members 0
Pattern Matching 0
Oracle Access via cx_Oracle 1
Oracle Access via cx_Oracle 0
Machine identification 1
Oracle Access via cx_Oracle 1
mySQL access 2
Pmw EntryWidget Help 1

Members online

No members online now.

Forum statistics

Threads
473,955
Messages
2,570,117
Members
46,705
Latest member
v_darius

Latest Threads

Top