skip to Main Content

How to return data in login function in PL/pgSQL? I want to return table where email and password matches. Email is unique – Postgresql

The function doesn't throw any error nor does it show any return value. CREATE OR REPLACE FUNCTION login(iemail VARCHAR,ipassword VARCHAR) RETURNS TABLE(id INTEGER, name VARCHAR, lastName VARCHAR, age INTEGER, mobile VARCHAR,email VARCHAR) LANGUAGE 'plpgsql' AS $$ #variable_conflict use_variable BEGIN RETURN…

VIEW QUESTION

PostgreSQL CASE statement syntax issues

I receive a syntax error for the following: CREATE OR REPLACE FUNCTION my_function(old_num INTEGER) returns INTEGER language plpgsql AS $$ DECLARE new_num INTEGER; BEGIN CASE WHEN (old_num IN (1, 2, 3, 4)) THEN new_num = 10 WHEN (old_num IN (5,…

VIEW QUESTION
Back To Top
Search