I am trying to run perl script but i get an oracle error.
DBD::Oracle::db prepare failed: ORA-01756: quoted string not properly terminated (DBD ERROR: OCIStmtPrepare)
But this SQL QUERY perfectly works fine in TOAD
MY perl connection details:
my $dbh = DBI->connect($dsn, $dbuser, $dbpass, { RaiseError => 1, AutoCommit => 0 });
my $sth=$dbh->prepare($SQL);
$sth->execute or die "EXEC ERROR $sth->errstr";
sql query:
SELECT name FROM employee WHERE
event IN ('IPO', 'RIGHTS')
AND (NOT market_code = 'ID' OR NOT event = 'RIGHTS')
AND NOT market_code = 'IN'
AND NOT market_code = 'NZ'
AND name NOT LIKE '%stat%'
AND NOT REGEXP_LIKE (name, 'S.K(Q|S)$')
AND name NOT LIKE '.%'
AND name NOT LIKE '%ol.SI'
AND name NOT LIKE '%bi.SI'
$SQLplease? Also try printing$SQLto check it's what you think it is. BTW theor dieis unnecessary since you have RaiseError on.$SQL?$in there. Maybe that confused Perl when creating the query text?