History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: CORE-696
Type: New Feature New Feature
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Alexander Peshkov
Reporter: Pavel Cisar
Votes: 5
Watchers: 3
Operations

If you were logged in you would be able to see more operations.
Firebird Core

User Account maintanance in SQL

Created: 17/Sep/03 12:00 AM   Updated: 09/Jun/08 09:24 AM
Component/s: Engine
Affects Version/s: None
Fix Version/s: 2.5 Alpha 1

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown

SF_ID: 807879
Resolution Date: 27/Dec/07


 Description  « Hide
SFID: 807879#
Submitted By: pcisar

I think it a good idea to have the ability in the sql
interface to Create, Edit and Delete User Accounts.

E.G.

Create User "MyUsername" "MyPassword";

Delete User "MyUsername";

Alter User "MyUsername" "MyPassword" "NewPassword";

 All   Comments   Work Log   Change History   Version Control      Sort Order:
Alexander Peshkov - [27/Dec/07 11:06 AM ]
Added SQL operators:

CREATE USER name PASSWORD 'pass' [FIRSTNAME 'text'] [MIDDLENAME 'text'] [LASTNAME 'text'];

ALTER USER name [SET] [PASSWORD 'pass'] [FIRSTNAME 'text'] [MIDDLENAME 'text'] [LASTNAME 'text']; -- at least one of PASSWORD / FIRSTNAME / MIDDLENAME / LASTNAME is required

DROP USER name;

Non-privileged (non-SYSDBA) user can use only:

ALTER USER my_name ....

Vsevolod Migdisov - [09/Jun/08 09:00 AM ]
Is it possible to use it in PSQL with parameters?

e.g.

declare variable USER_NAME char(32);
declare variable PASSWD char(32);

for select USER_NAME, PASSWD from MY_USERS
into :USER_NAME, :PASSWD
do begin
CREATE USER :USER_NAME PASSWORD :PASSWD;
end

Thank you!

Alexander Peshkov - [09/Jun/08 09:12 AM ]
No. It was not planned to be used in PSQL, even without parameters (exactly like the rest of DDL).
But if you want/need, you can prepare text string with operator, and use EXECUTE STATEMENT, which can run DDL. EXECUTE STATEMENT overhead can be treated as minor compared with DDL itself.
Remember no to expect users to arrive before whole transaction commit!

Vsevolod Migdisov - [09/Jun/08 09:24 AM ]
Thank you very much?
Could you please give a short example of how to prepare SQL statement and use EXECUTE STATEMENT in procedure?