PERL Script to Load data into an oracle database

B

bony_dev

Hello,

i am trying to write a perl script to load data in oracle from windows.
has anybody doe this before..please guide me on how to do this..what
modules to use etc..thanks

-bony
 
D

David Squire

Hello,

i am trying to write a perl script to load data in oracle from windows.
has anybody doe this before..
Yes.

please guide me on how to do this..what
modules to use etc..thanks

You need to learn how to use CPAN. Go to http://search.cpan.org/ and
search for 'oracle'. See the first result.


DS
 
B

bony_dev

can you please provide me with a sample code..i am just trying to gain
more knowledge on this as i am a newbie ..thanks a lot..

-Bony
 
D

David Squire

(e-mail address removed) wrote:

[top-posting corrected. Please don't do that]
can you please provide me with a sample code..i am just trying to gain
more knowledge on this as i am a newbie ..thanks a lot..

That is not how this works. Read the posting guidelines for the group.
You make an attempt, and then post here to get help with your code.
People here will help you with your code, not write it for you.

For a start, the DBD::Oracle module documentation (that you should have
found following my earlier hint) contains code examples.


DS
 
X

xhoster

Hello,

i am trying to write a perl script to load data in oracle from windows.
has anybody doe this before..please guide me on how to do this..what
modules to use etc..thanks

DBI, DBD::Oracle. The very newest DBD::Oracle has a "real" execute_array,
which is very much faster than the older emulations.

Xho
 
B

bony_dev

I have been getting this oracle error and not even successfull trying
to connect to the oracle database---i have tried several combinations
to connect but no luck..

Unable to connect : ORA-12705: Cannot access NLS data files or invalid
environment specified (DBD ERROR: OCISessionBegin)

my code to conect is -

use DBI;

my $dbh = DBI->connect('dbi:Oracle:', q{scott/tiger@(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = host.com)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SID=SIDNAME)
(SERVICE_NAME = bony)
)
)},"" )|| die "Unable to connect : $DBI::errstr\n";
print "connection established\n";

Please help..

Thanks..Bony
 
F

freeholder

I have been getting this oracle error and not even successfull trying
to connect to the oracle database---i have tried several combinations
to connect but no luck..

Unable to connect : ORA-12705: Cannot access NLS data files or invalid
environment specified (DBD ERROR: OCISessionBegin)

my code to conect is -

use DBI;

my $dbh = DBI->connect('dbi:Oracle:', q{scott/tiger@(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = host.com)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SID=SIDNAME)
(SERVICE_NAME = bony)
)
)},"" )|| die "Unable to connect : $DBI::errstr\n";
print "connection established\n";

Please help..

Thanks..Bony

I'm not familiar with the notation you're using, above. I've set up
the connection using one of the following two ways:

1. Using ORACLE_HOME and the tnsnames.ora file (see your Oracle
manuals and tutorials for how to set up your environment), and assuming
the SID is 'bony', your connect string would look like:

my $dbh = DBI->connect('dbi:Oracle:bony', $user, $passwd) or die ...

2. But I prefer, at least for an application that is designed to work
with a specific schema, to use this format (which allows you to
dispense with the environment and having to use the tnsnames.ora file):

my $dbh = DBI->connect('dbi:Oracle:host=host.com;port=1521;sid=bony',
$user, $passwd)
or die ...

The DBI connect function allows you to add additional information, such
as attributes that control some of how the connection works, but you
should get this working before trying to add functionality.

Hope this helps.

Bob
 

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

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top