Quantcast
Channel: SCN : All Content - SAP HANA Developer Center
Viewing all articles
Browse latest Browse all 6745

Stored procedure insert statement

$
0
0

Hi guys

 

I using the following Stored procedure  to insert and update for one table.

 

create procedure spUsersAndCompanies

 

(

 

Operationtype char(1),

 

UsersAndCompaniesId int,

 

UserId int,

 

CompanyId int,

 

PositionId int

 

)

 

LANGUAGE SQLSCRIPT

 

SQL SECURITY INVOKER

 

AS

 

Begin

 

If (OperationType = 'I')then

 

Begin

 

INSERT INTO

 

UsersAndCompanies

 

(

 

UsersAndCompaniesId,

 

UserId,

 

CompanyId,

 

PositionId

 

)

 

VALUES (

 

S_UsersAndCompanies.nextval,

 

:UserId,

 

:CompanyId,

 

:PositionId

 

);

 

End;

 

Else if (OperationType = 'U') then

 

Begin

 

UPDATE

 

UsersAndCompanies

 

SET

 

UserId= :UserId,

 

CompanyId= :CompanyId,

 

PositionId= :PositionId

 

WHERE

 

UsersAndCompaniesId = :UsersAndCompaniesId;

 

End;

 

end if;

 

end if;

 

end;

 

for insert I call the SP with null value for UsersAndCompaniesId because this is auto incremented column.

 

the problem when I call the SP For insert I get the following error

 

feature not supported: feature not supported: insert NULL value for UsersAndCompaniesId

 

 

can someone please help me to solve it .

 

Regard's

Bassam


Viewing all articles
Browse latest Browse all 6745

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>