`do $$declare temp_id integer;
begin;
insert INTO public.logindetails(email, pass, dept, designation, status) VALUES($1, $2, $3, $4, $5);
select login_id into temp_id from public.logindetails where email = $1;
INSERT INTO public.studentdetails(login_id, curr_year, enroll_no,full_name) VALUES (temp_id, $6, $7, $8);
end $$;`
This is my sql statement that I am trying to execute in my express application.
This is my server-side post endpoint.
Below is my client-side js:
and the error I am getting is :
I have tried doing it in gui of postgreSQL and it works fine:
Can any one figure out a work through or the part where I am going wrong and a solution to it.