Home » SQL & PL/SQL » SQL & PL/SQL » Using COBOL to acess a Oracle databse
Using COBOL to acess a Oracle databse [message #235908] Tue, 08 May 2007 06:50 Go to next message
ozstrider
Messages: 3
Registered: May 2007
Junior Member
Hi there,
I'm a computer science student from Brazil and I just got a project to implement in COBOL from my ass teacher.

The problem is, she did not explain anything on how to do it, and I have no idea about how to do it. I've never even tried to connect to a database... I don't know how it works.

If someone could please give me some direction I would apreciate it

Some stuff that I have no idea:

-I have Oracle 10g installed and a server running in my PC, can I access it with COBOL?
-If yes, where can I find the commands to do this?
-Wich COBOL compiler would be best to do something like this (free)

Thanks in advance
Desperate cobol noob
Re: Using COBOL to acess a Oracle databse [message #235915 is a reply to message #235908] Tue, 08 May 2007 07:09 Go to previous messageGo to next message
Frank
Messages: 7880
Registered: March 2000
Senior Member
Would this not be the perfect time to ask your teacher?
Re: Using COBOL to acess a Oracle databse [message #235916 is a reply to message #235908] Tue, 08 May 2007 07:12 Go to previous messageGo to next message
ozstrider
Messages: 3
Registered: May 2007
Junior Member
You don't understand, she WON'T help. When you ask her she says:

"Do you know something called.. library ? Or maybe... Google?"

she's stupid..
Re: Using COBOL to acess a Oracle databse [message #235922 is a reply to message #235916] Tue, 08 May 2007 07:29 Go to previous messageGo to next message
ThomasG
Messages: 3189
Registered: April 2005
Location: Heilbronn, Germany
Senior Member
Hmmm.. I seem to remeber that at least an old 7.X DB we used shipped with something called "procobol".

A google for

oracle procobol examples


gave a few hits, but as far as I can tell it seems to be somewhat obsolete.
Re: Using COBOL to acess a Oracle databse [message #236100 is a reply to message #235916] Wed, 09 May 2007 00:59 Go to previous messageGo to next message
Frank
Messages: 7880
Registered: March 2000
Senior Member
ozstrider wrote on Tue, 08 May 2007 14:12
You don't understand, she WON'T help. When you ask her she says:

"Do you know something called.. library ? Or maybe... Google?"

she's stupid..

Hm. I wonder who is the stupid one here... She DID help.
Maybe this link will help you find what she advised.

1.6 million hits on Google, and you read them all? (googled for oracle cobol)

[Updated on: Wed, 09 May 2007 01:00]

Report message to a moderator

Re: Using COBOL to acess a Oracle databse [message #236353 is a reply to message #235908] Wed, 09 May 2007 13:01 Go to previous messageGo to next message
ozstrider
Messages: 3
Registered: May 2007
Junior Member
Kinda rude you don't you think ?
You did exacly the same thing my teacher did. But you two don't seem to understand that

Quote:
By friendly guy:
There is all sorts of rubbish published on the net, some of it ranked quite highly by Google. Being able to sort the wheat from the chaff requires a minimum level of knowledge


the friendly guy there knows that I lack any knowledge to do something like that and select a good material.

He helped me, you didn't, so why did you loose your time here?

Anyway
thanks in advance to anyone who would help
Re: Using COBOL to acess a Oracle databse [message #236489 is a reply to message #236353] Thu, 10 May 2007 01:50 Go to previous messageGo to next message
Maaher
Messages: 7062
Registered: December 2001
Senior Member
If it is for school, I feel that the school should provide you with a COBOL compiler (the most popular in my time was the MicroFocus one). The Oracle software is free of charge provided that you do not use it for commercial purposes. Even then, there's Oracle XE that is free of charge but it is limited.

Now, for your question.

Oracle has indeed something called PRO*COBOL. It is a precompiler. A Pro*COBOL program will first have to be precompiled and afterwards it has to be compiled through a regular COBOL compiler.

PRO*COBOL

MHE
Re: Using COBOL to acess a Oracle databse [message #236503 is a reply to message #236489] Thu, 10 May 2007 02:13 Go to previous messageGo to next message
gold_oracl
Messages: 129
Registered: July 2006
Location: Westborough, MA
Senior Member
I assume that you have little bit exposure in COBOL/Pro COBOL and you know how to compile and execute the pro Cobol program.

If so, please find the list of steps to be included inside the pro Cobol program to connect oracle, execute the query and etc. below.

To connet to Oracle..
           MOVE "/" TO USERNAME-ARR
           MOVE 1 TO USERNAME-LEN

           EXEC SQL 
              CONNECT :USERNAME
           END-EXEC

To declare the cursor..
           EXEC SQL DECLARE SYSCUR CURSOR FOR
             SELECT SYSDATE, DUMMY
               FROM DUAL
           END-EXEC

To open the cursor
           EXEC SQL OPEN SYSCUR END-EXEC

To load the data into local variables
           PERFORM UNTIL SQLCODE NOT = 0
                MOVE SPACES TO STATUS-TYPE
                EXEC SQL
                  FETCH SYSCUR INTO
                    :V-DATE,
                    :V-DUMMY
                END-EXEC

                IF SQLCODE = 0
                 /* DO YOUR STUFF HERE */
                END-IF
             END-PERFORM

To close the cursor
             EXEC SQL CLOSE SYSCUR END-EXEC


Thanks,
Thangam
Re: Using COBOL to acess a Oracle databse [message #236513 is a reply to message #236503] Thu, 10 May 2007 02:38 Go to previous message
Frank
Messages: 7880
Registered: March 2000
Senior Member
I think you missed the point of my post. If your teacher tells you to go use the library and Google, she will have a good reason for it. She probably wants to see how well you perform when you are 'on your own', a necessary ability for programmers.
Previous Topic: New Guy With Question
Next Topic: dates
Goto Forum:
  


Current Time: Sun Dec 04 22:48:02 CST 2016

Total time taken to generate the page: 0.21138 seconds