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

NOT NULL constraint for procedure parameters and variables [CORE1316] #1735

Closed
firebird-automations opened this issue Jun 9, 2007 · 8 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: Alexander Tyutik (tut)

Is related to QA265

Now we able to use domains in PSQL code and this is greate!
But what if we need to use same domain as NULLABLE in one case and as NOT NULL in other case?
It's very simple for tables, but for procedure parameters and variables we should create two diffirent domains or write manual checking.
As we already have such checking for domains i think it is possible to add equal checking for explicit declaration, such as:

DECLARE ID INTEGER NOT NULL;

OR

CREATE PROCEDURE GET_SOMETHING (
ID INTEGER NOT NULL,
...

@firebird-automations
Copy link
Collaborator Author

Commented by: Sean Leyne (seanleyne)

Alexander,

You seem to be logging a large number of feature requests which have already been discussed and rejected (in the support list) or are not always appropriate (as in this case).

I would suggest that you post a discussion message to the developer list before creating these entries. In this way, the requests can be publically discussed, and perhaps improved upon, before an entry is added to the tracker.

@firebird-automations
Copy link
Collaborator Author

Commented by: Alexander Tyutik (tut)

Sorry.

I started read developers list only a few months ago, so i haven't read discussion about this feature.
And, from other side, in some fb newsgroups i saw such dialogs:
User: Why this feature was not implemented?
Developer: I don't see any feature request in tracker about this feature, so why it should be implemented?

In feature i will be more careful with requests like this...

@firebird-automations
Copy link
Collaborator Author

Commented by: Claudio Valderrama C. (robocop)

The feature has been implemented by Adriano. This is the result of an isql session:

SQL> create database 'mydearnull.fdb';
SQL> create procedure get_something(id integer not null) as begin end;
SQL> execute procedure get_something(NULL);
Statement failed, SQLCODE = -625
validation error for variable ID, value "*** null ***"
-At procedure 'GET_SOMETHING'
SQL> execute procedure get_something(1);

SQL> set term ^;
SQL> create procedure p0(inp int) as declare i int not null; begin i = inp; end^
SQL> set term ;^
SQL> execute procedure p0(null);
Statement failed, SQLCODE = -625
validation error for variable I, value "*** null ***"
-At procedure 'P0' line: 1, col: 63
SQL> execute procedure p0(1);

The only improvement could be that in the first case, the message can say "validation error for parameter ID, ..." instead of "variable".

@firebird-automations
Copy link
Collaborator Author

Modified by: Claudio Valderrama C. (robocop)

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

resolution: Fixed [ 1 ]

Fix Version: 2.1 RC1 [ 10201 ]

assignee: Adriano dos Santos Fernandes [ asfernandes ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

Workflow: jira [ 12290 ] => Firebird [ 14796 ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @pmakowski

Q/A test ok

@firebird-automations
Copy link
Collaborator Author

Modified by: @pmakowski

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

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

Link: This issue is related to QA265 [ QA265 ]

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