Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

error: parameters are only supported with natively compiled modules

I want to create a stored procedure. One of the parameters ....

@ID int not null,

is giving me an error:

NOT NULL parameters are only supported with natively compiled modules, except for inline table-valued functions.

how can I fix this?

like image 448
Cheri Choc Avatar asked May 24 '26 23:05

Cheri Choc


1 Answers

if you want to have required parameter for a stored procedure then just declare the parameter like below, then check whether param is null or not

Create procedure MyProc
@ID int
as
    if @ID is null
    begin
      -- handle the null case here
    end
--  rest of your query

If the parameter is optional then assign null to the parameter, which acts as a default value if no input is provided in procedure call

Create procedure MyProc
@ID int = null
as
--  your query
like image 131
Vinit Avatar answered May 27 '26 12:05

Vinit



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!