postgresql calling a function on delete [message #1114098] |
Sun, 22 September 2013 06:45  |
Eclipse User |
|
|
|
Hi,
I created a function in postgresql and I want to run it when an entity is being deleted. I have to use customizer.
@Override
public void customize(ClassDescriptor descriptor) throws Exception
{
descriptor.getQueryManager().setDeleteSQLString("select delete_recursive(#ID)");
}
but when I execute this I get follow exception :
A result was returned when none was expected
my function is
CREATE OR REPLACE FUNCTION delete_recursive(docid bigint)
RETURNS void AS
as you can see function output is VOID I think it's because the way of calling functions in postgresql which starts with select
how can i overcome this issue ?
is this a bug ?
|
|
|
|
|
Re: postgresql calling a function on delete [message #1121396 is a reply to message #1119158] |
Mon, 30 September 2013 15:25  |
Eclipse User |
|
|
|
The example did not show static values - it was defining which fields the parameter value would correspond to. The values get pulled from the objects used in the CRUD operations. So
call.addArgument("P_EMP_ID", "EMP_ID") causes the "P_EMP_ID" call parameter to get passed the value from the "EMP_ID" mapping within the entity.
Best Regards,
Chris
|
|
|
Powered by
FUDForum. Page generated in 0.04588 seconds