Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error calling a postgres function #1

Open
HectorMG02 opened this issue Oct 27, 2020 · 0 comments
Open

Error calling a postgres function #1

HectorMG02 opened this issue Oct 27, 2020 · 0 comments

Comments

@HectorMG02
Copy link

Hi, i have a postgres function in my db, im using dbeaver and i have my function which is something like this:

CREATE OR REPLACE FUNCTION public.jr_ver_res_partner_4()
 RETURNS TABLE(myData)
 LANGUAGE plpgsql
AS $function$
	BEGIN
		return query select * from res_partner rp where RP.ID=4;
	END;
$function$;

it works in my sql execute, but in my website im trying to call this function with something like this:

// Connect to Odoo
odoo.connect(function(err) {
    if (err) { return console.log(err); }

    console.log('conectado a odoo');

    // View Delivery Order
    odoo.rpc_call('public.jr_ver_res_partner_4()', '', function(err, result) {
        if (err) {
            console.log(err);
            return;
        }
        console.log(result);

    });
});

But it doesnt work, i recive a 404 code, how can i call one of my functions?? in the sql i execute it like this:

SELECT * FROM public.MyFunction()

but with node-odoo it doesnt works, what can i do?? thanks so much

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant