ANTON KADACH

Generation

text to sql syntaxWed, 01 Feb 2023

функция, которая сохраняет результат запроса в файл. plpgsql

CREATE OR REPLACE FUNCTION write_query_to_file(n integer, q text) RETURNS integer AS $$ DECLARE file_name text; BEGIN file_name := 'file_' || n || '.txt'; EXECUTE q INTO file_name; RETURN 1; END; $$ LANGUAGE plpgsql;

Questions about programming?Chat with your personal AI assistant