Hi everybody,
When i am trying to run below sql in perl, i am getting an error message. In the sql i am trying to run a function. Sql is working fine in sqlplus command prompt.
Is there any problem in my syntax?
If i run "select sysdate from dual" sql, it works fine. Does it make a difference that actual sql is calling a function. Do i have to prepare this sql differently? ANY IDEAS.
Part of the script,
my $dbh = DBI->connect('dbi:Oracle:', $ENV{LOG}, $ENV{PWD}, undef)
or die "Unable to connect to DB: $DBI::errstr\n";
my $sth = $dbh->prepare(EXEC wag_batch_ddl.table_stats('patient'))
or die "Couldn't prepare statement: " . $dbh->errstr;
$sth->execute() # Execute the query
or die "Couldn't execute statement: " . $sth->errstr;
$dbh->disconnect;
This is the ERROR message:
Can't locate object method "EXEC" via package "wag_batch_ddl" (perhaps you forgot to load "wag_batch_ddl"?) at my_practice_script1.pl line 18.
/var/area51/pbm/coredss/ai_env/private_sand/dss_extract/bin
When i am trying to run below sql in perl, i am getting an error message. In the sql i am trying to run a function. Sql is working fine in sqlplus command prompt.
Is there any problem in my syntax?
If i run "select sysdate from dual" sql, it works fine. Does it make a difference that actual sql is calling a function. Do i have to prepare this sql differently? ANY IDEAS.
Part of the script,
my $dbh = DBI->connect('dbi:Oracle:', $ENV{LOG}, $ENV{PWD}, undef)
or die "Unable to connect to DB: $DBI::errstr\n";
my $sth = $dbh->prepare(EXEC wag_batch_ddl.table_stats('patient'))
or die "Couldn't prepare statement: " . $dbh->errstr;
$sth->execute() # Execute the query
or die "Couldn't execute statement: " . $sth->errstr;
$dbh->disconnect;
This is the ERROR message:
Can't locate object method "EXEC" via package "wag_batch_ddl" (perhaps you forgot to load "wag_batch_ddl"?) at my_practice_script1.pl line 18.
/var/area51/pbm/coredss/ai_env/private_sand/dss_extract/bin