Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Firebird templates for object creation #33200

Open
tonne1 opened this issue May 17, 2024 · 1 comment
Open

Firebird templates for object creation #33200

tonne1 opened this issue May 17, 2024 · 1 comment

Comments

@tonne1
Copy link

tonne1 commented May 17, 2024

"If you want to help - you can recommend a dummy function create statement. I have only for procedures:

create procedure sample_procedure
as
begin
end

Originally posted by @LonwoLonwo in #14225 (comment)

Certainly I'd like to help. The following templates are taken from the Firebird 5 language reference, https://firebirdsql.org/file/documentation/html/en/refdocs/fblangref50/firebird-50-language-reference.html#fblangref50-ddl-func-create, here we go:

section 7.3.1

-- stored function
CREATE FUNCTION ADD_INT (A INT, B INT DEFAULT 0)
RETURNS INT
AS
BEGIN
  RETURN A + B;
END
-- deterministic stored function
CREATE FUNCTION FN_E()
RETURNS DOUBLE PRECISION DETERMINISTIC
AS
BEGIN
  RETURN EXP(1);
END
-- external stored function
CREATE FUNCTION wait_event (
  event_name varchar (31) CHARACTER SET ascii
) RETURNS INTEGER
EXTERNAL NAME 'udrcpp_example!Wait_event'
ENGINE udr

A template for sequence creation:

-- stored function
CREATE SEQUENCE EMP_NO_GEN;

Btw, the "create view" template in DBeaver is not a valid statement in Firebird:

instead of

CREATE VIEW NEWVIEW AS 
  SELECT 1 as A;

it must be

CREATE VIEW NEWVIEW AS 
  SELECT 1 AS A FROM RDB$DATABASE;
@LonwoLonwo
Copy link
Member

Hello @tonne1
I do not see any reason to have this information as a separate ticket. Please move your comment to the original ticket: #14225

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants