-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error ORA-00936 when using Parameters #24
Comments
@tobit800 sorry for the delay in getting back to you -- I am not aware of any issues. Can you include exact code your are using that is causing problems? |
Closed as unreproducible |
I am getting the same issue. Here is my code snippet:
I always get this error, but only when passing parameters. I've tried piping the object in directly:
Creating a new object as a parameter:
But neither has helped. Every scenario I've tried ends in:
The only inserts I've been able to do successfully are when I add the values directly to the query:
I've tested on Windows and Linux.
|
@darthcircuit -- for Oracle, you have to prefix your variables with ":" instead of "@". so $sql = "INSERT INTO DB.TABLE(event_id,app_id,app_name,user_id,upn) VALUES (:event_id, :app_id, :app_name, :user_id, :upn)"
$newEvent = @{
event_id="test_event_1"
app_id="test_app_id_1"
app_name="Test App"
user_id="test_user_id_1"
upn="[email protected]"
}
Invoke-SqlUpdate $sql -Parameters $newEvent |
That worked!! thank you! |
Hi Mitharandyr.
I have tried to use Invoke-SqlUpdate with -Parameters to insert into an Oracle-DB.
I always get the exception ORA-00936. Is there a problem with the Parameters-Option?
Thanks a lot!
Tobias
Ausnahme beim Aufrufen von "ExecuteScalar" mit 0 Argument(en): "ORA-00936: Ausdruck fehlt"
In C:\Program Files\WindowsPowerShell\Modules\SimplySql\1.6.2\Classes.ps1:38 Zeichen:22
Try { return $cmd.ExecuteScalar() }
~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : OracleException
The text was updated successfully, but these errors were encountered: