Hi,
I have this snippet of SQL that runs perfectly well and as expected in SQL Developer interactive, but I cannot get it to run with Oracle.ManagedDataAccess.Client.
SQL:
DECLARE
index_not_exists EXCEPTION;
PRAGMA EXCEPTION_INIT (index_not_exists, -1418);
BEGIN
EXECUTE IMMEDIATE 'DROP INDEX PIMANRELATION_RRELATION_TYPEU_IDX_BMP';
EXCEPTION
WHEN index_not_exists
THEN
NULL;
END;
/
CREATE BITMAP INDEX PIMANRELATION_RRELATION_TYPEU_IDX_BMP ON TCBIGDATA.PIMANRELATION (RRELATION_TYPEU)
Output of SQL Developer:
PL/SQL-Prozedur erfolgreich abgeschlossen.
INDEX PIMANRELATION_RRELATION_TYPEU_IDX_BMP erstellt.
(sorry, German, both lines translate to "successful")
PowerShell Code:
$oracmd = $oracon.CreateCommand()
$oracmd.CommandType = "text"
$oracmd.CommandText = (Get-Content $_.FullName -Raw)
$oracmd.ExecuteNonQuery()
$oracon is a working connection, CommandText reads a text file with exactly the SQL contents above
error message:
Ausnahme beim Aufrufen von "ExecuteNonQuery" mit 0 Argument(en): "ORA-06550: Zeile 11, Spalte 1:
PLS-00103: Fand das Symbol "/" "
Is there a way to run my SQL snippet with PowerShell?