Perl calling a Oracle PL/SQL script

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • davidr262
    New Member
    • Apr 2007
    • 2

    Perl calling a Oracle PL/SQL script

    I am new to perl and need help with the following. In perl we are calling sqlplus with a PLSQL Script. In order to do this in PERL we had to do a system call. How do we return a error code from the PLSQL script back to the perl script?
  • KevinADC
    Recognized Expert Specialist
    • Jan 2007
    • 4092

    #2
    You should be using the DBI module to interface with your database.

    If you literally mean you are using:

    system()

    to access the database, there is no way to get back error messages from the database that I know of.

    Comment

    • davidr262
      New Member
      • Apr 2007
      • 2

      #3
      Kevin

      If we have a PLSQL script how would we rub this script using the DBI module?

      Comment

      • KevinADC
        Recognized Expert Specialist
        • Jan 2007
        • 4092

        #4
        Originally posted by davidr262
        Kevin

        If we have a PLSQL script how would we rub this script using the DBI module?

        Read the DBI documentation:

        http://search.cpan.org/~timb/DBI-1.54/DBI.pm

        and you will need the particular driver for PLSQL, you can search for that on CPAN too.

        I can't help you with code examples because my experience and knowledge is quite limited in regards to database applications and the DBI module in general.

        Comment

        • jonathan184
          New Member
          • Nov 2006
          • 154

          #5
          Well you could use the system call because from what you are saying you are running the sqlplus commands, in the plsql code. define the dbms_output error line as a perl variable and run a perl print statement or print to a log or whatever.

          Comment

          • KevinADC
            Recognized Expert Specialist
            • Jan 2007
            • 4092

            #6
            Originally posted by jonathan184
            Well you could use the system call because from what you are saying you are running the sqlplus commands, in the plsql code. define the dbms_output error line as a perl variable and run a perl print statement or print to a log or whatever.
            Sounds like a very plausible suggestion.

            Comment

            Working...