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

User-defined PSQL functions [CORE2047] #2483

Closed
firebird-automations opened this issue Aug 21, 2008 · 13 comments
Closed

User-defined PSQL functions [CORE2047] #2483

firebird-automations opened this issue Aug 21, 2008 · 13 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: Alastair Breingan (alb)

Is related to QA633

Votes: 10

It would seem logical and fairly simple (isn't it always when you are not doing the work?) to allow a PSQL procedure to be defined as a SQL or PSQL function. This would simplify the syntax when incorporating these into select statements etc.
For example it is already possible to
select a.*, (select * from GrossProfit(Item)) from ItemMaster
or
select * from ItemMaster where (select * from GrossProfit(Item)) > 30
This proposal would allow the following code without having to write UDF's, which I prefer to restrict to complex computationally intensive code that does not reference the database.
select a.*, GrossProfit(Item) from ItemMaster
or
select * from ItemMaster where GrossProfit(Item) > 30
While the difference is initially not great, I find that these functions are very useful and rapidly become a major part of a business system, at which point the code looks very unwieldy.

@firebird-automations
Copy link
Collaborator Author

Commented by: lacak (lacak)

There is SQL:2003 CREATE FUNCTION command, which can also solve this issue.
I remember, that there is already open ticket about CREATE FUNCTION, but I can not find it now.

@firebird-automations
Copy link
Collaborator Author

Commented by: @dyemanov

Yes, the project's intention is to add full SQL2003 support for stored functions in FB 3.0. I also remember such a ticket already registered but I cannot find it at the moment either...

However, stored procedures are not going to be supported as functions.

@firebird-automations
Copy link
Collaborator Author

Commented by: Alastair Breingan (alb)

Thank you that would be excellent. I searched though all open tickets referring to function, and did not find anything. Agreed - we still need to distinguish between a stored procedure and a function. (the latter should probably only return a single value etc).

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

status: Open [ 1 ] => Open [ 1 ]

Fix Version: 3.0.0 [ 10048 ]

Component: Engine [ 10000 ]

Planning Status: Unspecified => Considered for inclusion

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

Fix Version: 3.0 Alpha 1 [ 10331 ]

Fix Version: 3.0.0 [ 10048 ] =>

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

assignee: Dmitry Yemanov [ dimitr ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Fixed [ 1 ]

@firebird-automations
Copy link
Collaborator Author

Commented by: Cosmin Apreutesei (cosmin_ap2)

awsome!!!

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

summary: Allow PSQL procedures to be defined as "SQL Functions" that can be used in a similar way to UDF's => User-defined PSQL functions

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

Link: This issue is related to QA633 [ QA633 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

QA Status: No test

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

status: Resolved [ 5 ] => Resolved [ 5 ]

QA Status: No test => Covered by another test(s)

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

status: Resolved [ 5 ] => Closed [ 6 ]

Fix Version: 3.0.0 [ 10740 ]

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