Re: cobol embedded sql source example



On Wed, 3 May 2006 08:02:11 -0400, "Serge Lacombe"
<serge.lacombe@xxxxxxxxxxxx> wrote:

Hi,

I need to obtain the list of elements (name of column,type..) of an Oracle
table.

Can it be done in a cobol embedded sql program?

If yes, a source dode example would be appreciated.

Thanks.


Answer is yes. (WITH ORACLE)

see
http://download-uk.oracle.com/docs/cd/B19306_01/server.102/b14357/ch12019.htm
for a full description. You may need to create a user to view the
document above.

Bat basics are
Syntax
DESC[RIBE] {[schema.]object[@db_link]}
Lists the column definitions for the specified table, view or synonym,
or the specifications for the specified function or procedure.

Terms

schema
Represents the schema where the object resides. If you omit schema,
SQL*Plus assumes you own object.

object
Represents the table, view, type, procedure, function, package or
synonym you wish to describe.

@db_link
Consists of the database link name corresponding to the database where
object exists.

The above method needs to be done with a dynamic SQL, and if you only
need the table information then you can hardcode the columns required.
Note. Never tried it with ESQL.

For another method that is sure to work see.
http://download-uk.oracle.com/docs/cd/B19306_01/appdev.102/a96109/pco11ody.htm#sthref1655

You will need to create a new user if you are not already registered.
DO IT if you are going to be dealing with Oracle, as it is required
for all type of access to their website.


Frederico Fonseca
ema il: frederico_fonseca at syssoft-int.com
.



Relevant Pages

  • Re: ODBC cannot access Oracle tables under different schemas in one session
    ... >Access / Oracle problem, ... >referring to the proper server / SID of every branch. ... >table, when i try to query the second table under another schema, ODBC ... >shift to another schema and query their tables, ...
    (comp.databases.oracle.misc)
  • Re: UTL_FILE Permissions
    ... The schema APP has already been granted READ and WRITE to the APP_DIR, ... I used the usermod command so that oracle user has a secondary group ... it should be possible for your upload ...
    (comp.databases.oracle.server)
  • Re: UTL_FILE Permissions
    ... The schema APP has already been granted READ and WRITE to the APP_DIR, ... I used the usermod command so that oracle user has a secondary group ...
    (comp.databases.oracle.server)
  • Re: ODBC cannot access Oracle tables under different schemas in one session
    ... >>Access / Oracle problem, ... >>referring to the proper server / SID of every branch. ... >>table, when i try to query the second table under another schema, ODBC ... >>shift to another schema and query their tables, ...
    (comp.databases.oracle.misc)
  • Re: Synchronization Wizard weirdness
    ... Using the Oracle Enterprise Manager and Oracle Change Manager packages, ... :> I have a Test Schema in the same database as the Main schema and need to ... Wizard between the Main schema and Test schema -- obviously returned the full ...
    (comp.databases.oracle.tools)