PERL Script to Load data into an oracle database

Discussion in 'Perl Misc' started by bony_dev@yahoo.com, Aug 5, 2006.

  1. Guest

    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
    , Aug 5, 2006
    #1
    1. Advertising

  2. David Squire Guest

    wrote:
    > 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
    David Squire, Aug 5, 2006
    #2
    1. Advertising

  3. Guest

    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
    David Squire wrote:
    > wrote:
    > > 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
    , Aug 5, 2006
    #3
  4. David Squire Guest

    wrote:

    [top-posting corrected. Please don't do that]

    > David Squire wrote:
    >> wrote:
    >>> 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.
    >>


    > 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
    David Squire, Aug 5, 2006
    #4
  5. wrote:
    > David Squire wrote:
    >> wrote:
    >>> 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.

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


    You seem to be the kind of guy who wants to minimize your own effort at
    others' expense. That attitude is not appreciated here; you may want to
    try the beginners mailing list instead.
    http://lists.cpan.org/showlist.cgi?name=beginners

    --
    Gunnar Hjalmarsson
    Email: http://www.gunnar.cc/cgi-bin/contact.pl
    Gunnar Hjalmarsson, Aug 5, 2006
    #5
  6. Guest

    wrote:
    > 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

    --
    -------------------- http://NewsReader.Com/ --------------------
    Usenet Newsgroup Service $9.95/Month 30GB
    , Aug 6, 2006
    #6
  7. Guest

    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

    wrote:
    > wrote:
    > > 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
    >
    > --
    > -------------------- http://NewsReader.Com/ --------------------
    > Usenet Newsgroup Service $9.95/Month 30GB
    , Aug 6, 2006
    #7
  8. freeholder Guest

    > wrote:
    > > wrote:
    > > > 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
    > >
    > > --
    > > -------------------- http://NewsReader.Com/ --------------------
    > > Usenet Newsgroup Service $9.95/Month 30GB


    wrote:
    > 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
    freeholder, Aug 7, 2006
    #8
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. dpackwood
    Replies:
    3
    Views:
    1,784
  2. geeteshss
    Replies:
    0
    Views:
    414
    geeteshss
    Jun 20, 2007
  3. Deshi

    Load xml file data into oracle

    Deshi, May 15, 2008, in forum: ASP .Net
    Replies:
    0
    Views:
    338
    Deshi
    May 15, 2008
  4. Vincent Le-Texier
    Replies:
    1
    Views:
    148
    Paul Lalli
    Dec 3, 2004
  5. Feyruz
    Replies:
    4
    Views:
    2,157
    Sherm Pendley
    Oct 14, 2005
Loading...

Share This Page