in reply to Executing Oracle PL/SQL statements through the DBI

&var replacement and all the set commands are part of SQL*Plus, which DBD::Oracle does not access in any way. DBD::Oracle will work as if you've got set define off.

Also, even in SQL*Plus, you'd find that using set in a PL/SQL block (like you show above) won't work.


Caution: Contents may have been coded under pressure.

Replies are listed 'Best First'.
Re^2: Executing Oracle PL/SQL statements through the DBI
by ptum (Priest) on Mar 14, 2006 at 16:47 UTC

    I think you're right. I can't replicate the problem I was having yesterday;. Whether I set define on or off in a SQLPlus session, my script using DBI/DBD::Oracle seems to happily insert the data without treating the embedded ampersand in any way special. This is very strange, since I'm pretty sure I was getting an error about that yesterday. (Well, I am becoming less sure every moment.)

    I tried the BEGIN/END PL/SQL block because a simple

    $sqlhandle->do("set define off");

    wasn't working.

    Thanks for helping me to understand the different rules that are in play in SQLPlus vs. through the DBI.


    No good deed goes unpunished. -- (attributed to) Oscar Wilde