Last active
May 27, 2016 12:23
-
-
Save wellington1993/512259fffb7765413c1eeb2330479100 to your computer and use it in GitHub Desktop.
Procedure to Create Domain if not exist (Firebird) - By Fabiano P.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
create or alter procedure DOM | |
as | |
declare variable COMANDO varchar(200); | |
begin | |
if (not exists(select | |
RDB$FIELD_NAME | |
from | |
RDB$FIELDS | |
where | |
upper(RDB$FIELD_NAME) = 'VARCHAR_70')) then | |
begin | |
COMANDO = 'CREATE DOMAIN VARCHAR_70 AS VARCHAR(70)'; | |
execute statement COMANDO; | |
end | |
end; | |
GRANT EXECUTE ON PROCEDURE DOM TO SYSDBA; | |
commit; | |
execute procedure DOM; | |
commit; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment