perl - How can I handle with DBI this command "set Pagesize 50" -
hi trying set pagesize dbi , script fails recommendation how can hndle dbi:
$dbh=dbi->connect( "dbi:oracle:", "", "", { ora_session_mode => ora_sysdba , raiseerror => 1, printerror => 1 } ); $dbh->do(qq{ " set pagesize 50" } );
there error:
dbd::oracle::db failed: ora-00900: invalid sql statement (dbd error: error possibly near <> indicator @ char 1 in ' <>" set pagesize 50" ') [for statement " " set pagesize 50" "] @ run.pl line 9. dbd::oracle::db failed: ora-00900: invalid sql statement (dbd error: error possibly near <> indicator @ char 1 in ' <>" set pagesize 50" ') [for statement " " set pagesize 50" "] @ run.pl line 9.
any idea ?
you're quoting things twice in statement on accident.
so oracle seeing command sent it:" set pagesize 50"
qq{}
alternate way of doing double quotes in perl don't have escape double quotes inside. remove double quotes inside , happy (or use double quotes instead of qq, but, since want double quotes in sql, using brackets safer)
$dbh->do( qq{set pagesize 50} );
Comments
Post a Comment