marscld has asked for the wisdom of the Perl Monks concerning the following question:

Hi Monks, Following Catalyst tutorial, going to create a static DBIC model for Oracle database. However, in 'script/myapp_create.pl', only following hint exists
myapp_create.pl model AnotherDB DBIC::Schema MyApp::Schema create=stat +ic\ dbi:Pg:dbname=foo root 4321
Let's say in oracle ,sid is 'TEST', user/schema is 'USER', password is 'PASS', how to use myapp_create.pl correctly ? Thanks

Replies are listed 'Best First'.
Re: Catalyst 5.7014 work with Oracle
by Corion (Patriarch) on Aug 05, 2008 at 09:14 UTC

    This is more a DBI question than a question about Catalyst. See DBD::Oracle on how to supply your connection parameters in the DSN.

Re: Catalyst 5.7014 work with Oracle
by lorn (Monk) on Aug 05, 2008 at 14:27 UTC

    Hi,

    You need to export some variables for Oracle

    export ORACLE_HOME=/home/foo/oracle/client_1
    export LD_LIBRARY_PATH=$ORACLE_HOME/product/oracle_version/client_1/lib/

    ORACLE_SID is the name of the instance.

    export ORACLE_SID=ORCL

    After you can try this code:

    use strict; use warnings; use DBI; my $host = '192.168.0.1'; my $driver = 'Oracle'; my $database = 'ORCL'; my $username = 'USER'; my $password = 'PASS'; my $dbh = DBI->connect("dbi:Oracle:host=$host;sid=$database", $usernam +e, $password, {RaiseError => 1, AutoCommit => 0});

    If they work without error, now you can try: myapp_create.pl model ....

    Good luck!

    PS: you can use ENV instead export at Perl:

    BEGIN {$ENV{ORACLE_HOME} = '/home/foo/oracle/product/oracle_version/cl +ient_1/';}
      Thanks, it helps:)