From 608f63e778877e583bb746fd924de07fa72a3376 Mon Sep 17 00:00:00 2001 From: Daniele Teti Date: Thu, 4 Apr 2024 16:24:07 +0200 Subject: [PATCH] Added FirebirdSQL DDL for db logger --- .../150_DB_appender_firedac/firebird_ddl.sql | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 lib/loggerpro/samples/150_DB_appender_firedac/firebird_ddl.sql diff --git a/lib/loggerpro/samples/150_DB_appender_firedac/firebird_ddl.sql b/lib/loggerpro/samples/150_DB_appender_firedac/firebird_ddl.sql new file mode 100644 index 00000000..0f4dfc84 --- /dev/null +++ b/lib/loggerpro/samples/150_DB_appender_firedac/firebird_ddl.sql @@ -0,0 +1,37 @@ +SET term ^; + +EXECUTE BLOCK +AS +BEGIN + if (exists(select 1 from RDB$PROCEDURES where upper(rdb$procedure_name) = 'SP_LOGGERPRO_WRITER')) THEN + begin + execute statement 'drop procedure SP_LOGGERPRO_WRITER;'; + END +END^ + +RECREATE table loggerpro_logs ( + id int generated by default as identity, + log_type integer, + log_tag varchar(20), + log_message varchar(1024), + log_timestamp timestamp, + log_thread_id integer +)^ + + +CREATE procedure sp_loggerpro_writer( + p_log_type int, + p_log_tag varchar(20), + p_log_message varchar(1024), + p_log_timestamp timestamp, + p_log_thread_id integer +) +as +begin + INSERT INTO + loggerpro_logs(log_type, log_tag, log_message, log_timestamp, log_thread_id) + values + (:p_log_type, :p_log_tag, :p_log_message, :p_log_timestamp, :p_log_thread_id); +END^ + +SET term ;^