-
Notifications
You must be signed in to change notification settings - Fork 29
I am trying to use Invoke-SqlScalar to execute a simple Oracle stored procedure. I get an ORA-00900 both with the word execute in the query and without.
Can SimplySql execute Oracle stored procedures?
All reactions
Replies: 1 comment 1 reply
It should be able to -- can you provide code to reproduce the issue?
All reactions
this is the powershell:
###########################
$cred = Get-Credential
Open-OracleConnection -ConnectionName Tst -Server OracleLab -ServiceName Free -Port 1521 -Credential $cred
Show-SqlConnection -ConnectionName Tst
$query = "select * from user_tables"
invoke-sqlquery -Query $query -ConnectionName tst
$queryStatement = "CreateUser('abc', 'def', 'ghi', 'jkl')"
invoke-sqlscalar -Query $queryStatement -ConnectionName tst
###########################
and this is the stored procedure:
###########################
create or replace NONEDITIONABLE PROCEDURE CreateUser
(
p_FIRSTNAME IN VARCHAR2
, p_LASTNAME IN VARCHAR2
, p_EMAIL IN VARCHAR2
, p_AZUREID IN VARCHAR2
) AS
BEGIN
INSERT INTO ECMA_SPROC (ID, FIRSTNAME, LASTNAME, EMAIL, AZUREID) VALUES (sys_guid(), p_FIRSTNAME, p_LASTNAME, p_EMAIL, p_AZUREID);
END CreateUser;