SupabaseS
Supabase4y ago
Greg

Failed to run sql query missing FROM-clause entry for table new

Hi, When trying to run this function i get the error in the title and im not sure where i am going wrong
create or replace function createticket("auth" text, "ticketname" text, "issuetype" text, "devicetype" text ,"issuedetails" text, "priority" text) returns void language plpgsql security definer set search_path = public as $$ BEGIN IF (checkifauth(auth)) THEN insert into public.tickets (id, ticketname, issuetype, devicetype, issuedetails,priority) values (new.id,new.ticketname,new.issuetype,new.devicetype,new.issuedetails,new.priority); END IF; END; $$

and this is my other function incase that has issues

BEGIN IF EXISTS (select authkey from public.userprofile where authkey::text = auth) THEN return true; else return false; END IF; END;


and this is thw query i run

select createticket('0d06829a-d271-4dde-b69a-6d16a2254143','test','test','test','test','test');
Was this page helpful?