Home » SQL & PL/SQL » SQL & PL/SQL » FMT File copied into program at Compile Time (Oracle 10g)
FMT File copied into program at Compile Time [message #279487] Thu, 08 November 2007 14:38 Go to next message
pcd_lou
Messages: 63
Registered: October 2007
Location: Florida
Member
I would like to copy a Flat-File Layout into my PL/SQL Program at COMPILE TIME! Much like COBOL's copybook method.

Does Oracle SQL Plus have this feature? If so, How do I format the command?

Also, It would be great to be able to sub-define an element like in COBOL so that I can list a bunch of elements and include them as one if I need to.

Does Oracle SQL Plus have this feature? If so, How do I format the command?

Thanks,
Lou
Re: FMT File copied into program at Compile Time [message #279553 is a reply to message #279487] Fri, 09 November 2007 00:29 Go to previous messageGo to next message
Michel Cadot
Messages: 64103
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Neither SQL*Plus nor PL/SQL have this feature.
You have to create it.
Clues:
- utl_file allows you to read a file
- "execute immediate" allows you to execute a SQL or PL/SQL block included in a string variable.

Regards
Michel
Re: FMT File copied into program at Compile Time [message #279621 is a reply to message #279487] Fri, 09 November 2007 07:17 Go to previous messageGo to next message
pcd_lou
Messages: 63
Registered: October 2007
Location: Florida
Member
Michel,

I think I can figure out how to do that, but what about being able to sub-define an element?

10 Output-Record.
05 First-Byte Pic X(01).
05 Other-Stuff Pic X(49).

Like that? That way I can put stuff in each element and then put out the record.

Does this feature exist in PL/SQL Oracle 10g?

Thanks,
Lou
Re: FMT File copied into program at Compile Time [message #279622 is a reply to message #279621] Fri, 09 November 2007 07:20 Go to previous messageGo to next message
ThomasG
Messages: 3189
Registered: April 2005
Location: Heilbronn, Germany
Senior Member
For that you could either use :

A rowtype

A user defined type
Re: FMT File copied into program at Compile Time [message #279625 is a reply to message #279622] Fri, 09 November 2007 07:34 Go to previous messageGo to next message
pcd_lou
Messages: 63
Registered: October 2007
Location: Florida
Member
ThomasG,

Thank you. I'm a newbie.

Is there a site that can give me some reference information for these commands and data types? Something that will show me the format/syntax of how to set this stuff up?

Thanks,
Lou
Re: FMT File copied into program at Compile Time [message #279647 is a reply to message #279625] Fri, 09 November 2007 09:00 Go to previous message
Michel Cadot
Messages: 64103
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Quote:

I'm a newbie.

Why do you post your question in Expert forum?

Quote:

I think I can figure out how to do that, but what about being able to sub-define an element?

10 Output-Record.
05 First-Byte Pic X(01).
05 Other-Stuff Pic X(49).

This is not PL/SQL.
You have to parse your file and convert it to something understandable for PL/SQL.

Regards
Michel
Previous Topic: using select statement wile creating sequence
Next Topic: ORA-00907 missing right parenthesis
Goto Forum:
  


Current Time: Sat Dec 03 03:34:19 CST 2016

Total time taken to generate the page: 0.06587 seconds