Using Perl to connect with Oracle Database

From: Eugene Katzman <e.katzman_at_stanleyassoc.com>
Date: 5 May 1999 21:44:24 GMT
Message-ID: <01be9740$4d87d040$987769ce_at_katzmae>



Hi

        I just completed writing a C program for compiling with the ProC precompiler.
Now I find that I can no longer access the Precompiler. I need to write the same program in Perl.

        What I need to know is what I have to post as #include or use ie use ORALIB
the other thing I need to know is what has to preceed the SQL like EXEC SQL
or
SQLPLUS and how do I get the Oracle statements to execute out of the program to wherever it needs to go and how to run the connect operation.

With Pro C I use EXEC SQL begin declare section;

			varchar userid[10], password[15];
		EXEC SQL end declare section;
after some logic to obtain userid and passwd, 
		EXEC SQL connect :userid identified by :password;
		if (sqla.sqlcode != 0)
			fprintf(stderr, "Failed");

etc
How is it done in Perl, do you use the sqlca structure for returning values. How does one get data returned from a select statement, ie

        EXEC SQL select idnum into :peridnum from table1 where columnb equals tempvalue;

Thanks a lot

Gene Katzman e.katzman_at_stanleyassoc.com (703)739-8559 Received on Wed May 05 1999 - 23:44:24 CEST

Original text of this message