Rogue
Rogue

Reputation: 11

Powershell ORA-00933 Error when executing sql queries from .sql file

I have a SQL file and I'm trying to execute queries in it via PowerShell. But even I can execute one query, I can not when adding that file multiple queries like below.

GRANT SELECT ON table TO user1;
GRANT SELECT ON table TO user2;
Exception calling "ExecuteReader" with "0" argument(s): "ORA-00933: SQL komutu tam doğru olarak sona ermedi"   
At line:23 char:5   
$reader = $command.ExecuteReader()
+ CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : OracleException
$query=Get-Content C:\Users\asdg.sql | Out-String
write-host $query


$command.CommandText = $query
$reader = $command.ExecuteReader()

while ($reader.Read()) {
    $reader.GetString(0)
    }

English Error:

SQL command did not end properly

Upvotes: 1

Views: 429

Answers (0)

Related Questions