Skip to content

Navigation Menu

Sign in
Sign up

Execute Oracle Stored Procedure #174

Unanswered
wiemerr asked this question in Q&A
Apr 24, 2025 · 1 comments · 1 reply
Discussion options

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?

You must be logged in to vote

Replies: 1 comment 1 reply

Comment options

It should be able to -- can you provide code to reproduce the issue?

You must be logged in to vote
1 reply
Comment options

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;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /