I tried a couple variations, but I get the same error. I even put the statement inside a package function. While the package compiles cleanly, I get a similar error when I run it:
My oracle version:$ cat .SQL/glark.pks create or replace package glark as function gragnar(t in date, TZ1 in varchar2, TZ2 in varchar2) return timestamp with local time zone; end glark; $ cat .SQL/glark.pkb create or replace package body glark as function gragnar(t in date, TZ1 in varchar2, TZ2 in varchar2) return timestamp with local time zone is retval timestamp with local time zone; begin select (from_tz(cast(t as timestamp), TZ1) at time zone TZ2) i +nto retval from dual; return retval; end gragnar; end glark; $ cat t.pl #/usr/bin/perl use strict; use warnings; use feature ':5.10'; use XYZ::DBASE; use XYZ::Utils qw(dump_query); my $DB = XYZ::DBASE::connect('XYZDEV'); my $ST = $DB->prepare(<<SQL); select glark.gragnar(sysdate, :T, :U) from dual SQL $ST->bind_param(':T', 'Europe/Berlin'); $ST->bind_param(':U', 'Europe/Berlin'); $ST->execute; dump_query($ST); $ perl t.pl DBD::Oracle::st fetchall_arrayref failed: ORA-00923: FROM keyword not +found where expected ORA-06512: at "DEV_ROBO.GLARK", line 7 (DBD ERROR: OCIStmtFetch) [for +Statement "select glark.gragnar(sysdate, :T, :U) from dual " with ParamValues: :t='Europe/Berlin', :u='Europe/Berlin'] at /Work/P +erl/LIB/XYZ/Utils.pm line 342.
select * from v$version BANNER ---------------------------------------------------------------- Oracle9i Enterprise Edition Release 9.2.0.7.0 - 64bit Production PL/SQL Release 9.2.0.7.0 - Production CORE9.2.0.7.0Production TNS for Linux: Version 9.2.0.7.0 - Production NLSRTL Version 9.2.0.7.0 - Production 5 rows elapsed time: 0
...roboticus
When your only tool is a hammer, all problems look like your thumb.
In reply to Re: Strange errors with DBD::Oracle and placeholders
by roboticus
in thread Strange errors with DBD::Oracle and placeholders
by Skeeve
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |