cancel
Showing results for 
Search instead for 
Did you mean: 

Executing an insert/update stored procedure in an UDF

Former Member
0 Kudos

Hi,

Is it possible to execute a stored procedure that performs insert/update operations on a database using an UDF with DataBaseAccessor class?

As per my knowledge, this can be done without a DataBaseAccessor class by connecting to the database directly without the communication channel. But wanted to know if the same can be acheived through a communication channel in the UDF.

Any kind of help is appreciated. Thanks.

-Amit

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Thanks for the info Shabarish. Just wanted to know if it is possbile to execute a stored procedure that only reads data from a table in an UDF with DBAccessor class.

Former Member
0 Kudos

Shabarish, I already visited the blog that describes executing a stored proc without DBAccessor class. And as you rightly said, it is not the recommended approach. However, I wanted to know if it is possbile to execute stored procedure (that performs insert/update/select) through an UDF using the DBAccessor class i.e. through a communication channel.

Shabarish_Nair
Active Contributor
0 Kudos

The accessor does not support transactional behaviour. Therefore, the method should not be used to execute insert or update statements on the database which can lead to inconsistencies. The accessor should only be used to read data from a database table.

http://help.sap.com/javadocs/NW04S/current/pi/com/sap/aii/mapping/lookup/DataBaseAccessor.html

i guess that answers your question

sunilchandra007
Active Contributor
0 Kudos

Hi,

Yes, insert/update operations on a database can be done through a communication channel in the UDF.

But, It is not advisable to do that. Suppose something goes wrong, and you resend the message then , the insert/update operations would be repeated.

Regards,

Chandra

Shabarish_Nair
Active Contributor
0 Kudos

this is not recommended but FYI

/people/arpil.gupta/blog/2008/11/03/workaround-for-jdbc-scenarios - DB Lookup via Stored procedure