Subject | Re: [Firebird-Java] jdbc driver issue |
---|---|
Author | Mark Rotteveel |
Post date | 2008-10-21T19:26:02Z |
Pruteanu Dragos wrote:
information. You might also want to consult the Interbase 6.0 Language
Reference and the Firebird 2.0 Language Referene Update (both available
on http://www.firebirdsql.org/index.php?op=doc)
Note: I saw that Roman already answered, but I already invested some
time in it, so here it is:
INDEX ON {table} ( {columns} )
ALTER TABLE {table} ADD {text}
{name} RESTART WITH {new value} to give it another start value
ALTER TABLE {table} DROP {plep}
ALTER TABLE {table} ALTER {column} TYPE {type}
or
ALTER TABLE {table} ALTER COLUMN {column} TYPE {type}
ALTER TABLE {table} ALTER {column} SET DEFAULT {default}
or
ALTER TABLE {table} ALTER COLUMN {column} SET DEFAULT {default}
ALTER TABLE {table} ADD CONSTRAINT {name} CHECK ( {text} )
or
ALTER TABLE {table} ADD CONSTRAINT {name} CHECK ( {text} )
ALTER TABLE {table} ADD CHECK ( {text} )
or
ALTER TABLE {table} ADD CHECK ( {text} )
ALTER TABLE {table} ALTER {column} DROP DEFAULT
or
ALTER TABLE {table} ALTER COLUMN {column} DROP DEFAULT
ALTER TABLE {table} DROP CONSTRAINT {constraint}
correct, but Roman probably knows better.
--
Mark Rotteveel <Avalanche1979@...>
> It is fine, we can deal this situation too ( using no catalog and no schema - null for bought ).I'll only comment if there is something wrong or if there is additional
> I wanted to be sure about how this method works. We will pass null than to each other methods ( getTables(), getColumns(), getExportedKeys, etc. ).
> Could you also please review the 'alter statement...' list below ? It would be a great help since you know the best the right commands.
information. You might also want to consult the Interbase 6.0 Language
Reference and the Firebird 2.0 Language Referene Update (both available
on http://www.firebirdsql.org/index.php?op=doc)
Note: I saw that Roman already answered, but I already invested some
time in it, so here it is:
> Create View CREATE VIEW {name} AS {text}Full specification is CREATE INDEX [UNIQUE] [ASC[ENDING] | DESC[ENDING]]
> Create Primary Key ALTER TABLE {table} ADD CONSTRAINT {name} PRIMARY KEY( {columns} )
> Create Unique Index ALTER TABLE {table} ADD CONSTRAINT {name} UNIQUE( {columns} )
> Create Index CREATE INDEX {name} ON {table} ( {columns} )
INDEX ON {table} ( {columns} )
> Create Column ALTER TABLE {table} ADD COLUMN {text}Incorrect, should be:
ALTER TABLE {table} ADD {text}
> Create Sequence CREATE SEQUENCE {name} START WITH {text}Incorrect, use CREATE SEQUENCE {name} to create it, and ALTER SEQUENCE
{name} RESTART WITH {new value} to give it another start value
> Create Constraint ALTER TABLE {table} ADD CONSTRAINT {name} ( {text} )Incorrect, should be:
> Drop table DROP TABLE {name}
> Drop Column ALTER TABLE {table} DROP COLUMN {column}
ALTER TABLE {table} DROP {plep}
> Drop Index DROP INDEX {name}Incorrect,
> Drop view DROP VIEW {name}
> Drop Foreign Key ALTER TABLE {table} DROP CONSTRAINT {name}
> Drop Constraint ALTER TABLE {table} DROP CONSTRAINT {name}
> Drop Sequence DROP SEQUENCE {name}
> Change Column data type ALTER TABLE {table} MODIFY {column} {text}
ALTER TABLE {table} ALTER {column} TYPE {type}
or
ALTER TABLE {table} ALTER COLUMN {column} TYPE {type}
> Change Index to Primary Key ALTER INDEX {name} PRIMARY KEYUnsupported, use ALTER TABLE (drop index and recreate constraint)
> Change Index to Unique ALTER INDEX {name} UNIQUEUnsupported, use DROP INDEX and CREATE INDEX
> Change Index to non-unique ALTER INDEX {name} NONUNIQUEUnsupported, use DROP INDEX and CREATE INDEX
> Change Foreign Key action ALTER CONSTRAINT {name} ON DELETE {delete_action} ON UPDATE {update_action}Unsupported (AFAIK), use ALTER TABLE (drop and recreate constraint)
> Rename Index RENAME INDEX {name} TO {newname}Unsupported (or you have to use metadata 'hacking')
> Rename Foreign Key RENAME {name} TO {newname}Unsupported (or you have to use metadata 'hacking')
> Rename Constraint ALTER TABLE {table} RENAME CONSTRAINT {name} TO {newname}Unsupported (or you have to use metadata 'hacking')
> Set Table comment COMMENT ON TABLE {table} IS '{comment}'Unsupported, only on creation
> Set Column comment COMMENT ON COLUMN {table}.{name} IS '{comment}'
> Set Column mandatory ALTER TABLE {table} MODIFY {column} NOT NULL
> Set Column unsigned ALTER TABLE {table} MODIFY {column} UNSIGNEDUnsupported
> Set Column autoincrement ALTER TABLE {table} MODIFY {column} AUTOINCREMENTUnsupported, use a trigger in combination with a sequence
> Set Column default ALTER TABLE {table} MODIFY {column} DEFAULT {defo}Incorrect,
ALTER TABLE {table} ALTER {column} SET DEFAULT {default}
or
ALTER TABLE {table} ALTER COLUMN {column} SET DEFAULT {default}
> Set Column check constraint ALTER TABLE {table} MODIFY {column} CONSTRAINT {name} CHECK ( {text} )Incorrect, is:
ALTER TABLE {table} ADD CONSTRAINT {name} CHECK ( {text} )
or
ALTER TABLE {table} ADD CONSTRAINT {name} CHECK ( {text} )
> Set Column unnamed check constraint ALTER TABLE {table} MODIFY {column} CHECK ( {text} )Incorrect, is:
ALTER TABLE {table} ADD CHECK ( {text} )
or
ALTER TABLE {table} ADD CHECK ( {text} )
> Set Column enumeration ALTER TABLE {table} MODIFY {column} ENUMERATION ( {text} )Unsupported
> Unset Column mandatory ALTER TABLE {table} MODIFY {column} NULLUnsupported, only on creation
> Unset Column unsigned ALTER TABLE {table} MODIFY {column} SIGNEDUnsupported
> Unset Column autoincrement ALTER TABLE {table} MODIFY {column} NOAUTOINCREMENTUnsupported
> Unset Column default ALTER TABLE {table} MODIFY {column} DEFAULT nullIncorrect,
ALTER TABLE {table} ALTER {column} DROP DEFAULT
or
ALTER TABLE {table} ALTER COLUMN {column} DROP DEFAULT
> Unset Column check constraint ALTER TABLE {table} MODIFY {column} DROP CONSTRAINT {table}Incorrect,
ALTER TABLE {table} DROP CONSTRAINT {constraint}
> Unset Column enumeration ALTER TABLE {table} MODIFY {column} NOENUMERATIONUnsupported
> default date function -> sysdateIncorrect, is: current_date
> default time function -> systimeIncorrect, is: current_time
> date format -> dd-MMM-yyI have no idea, maybe someone else can answer that.
> When connecting, we got this data types. Is this list correct ?As far as I know, the datatypes metadata returned by the driver is
>
> <type name="BIGINT" java="-5" precision="NONE" />
> <type name="BLOB SUB_TYPE 0" java="-4" precision="NONE" />
> <type name="BLOB SUB_TYPE 1" java="-1" precision="NONE" />
> <type name="CHAR" java="1" precision="LENGTH" />
> <type name="NUMERIC" java="2" precision="DECIMAL" />
> <type name="DECIMAL" java="3" precision="PRECISION" />
> <type name="INTEGER" java="4" precision="NONE" />
> <type name="SMALLINT" java="5" precision="NONE" />
> <type name="FLOAT" java="6" precision="NONE" />
> <type name="DOUBLE PRECISION" java="8" precision="NONE" />
> <type name="VARCHAR" java="12" precision="LENGTH" />
> <type name="DATE" java="91" precision="NONE" />
> <type name="TIME" java="92" precision="NONE" />
> <type name="TIMESTAMP" java="93" precision="NONE" />
> <type name="BLOB SUB_TYPE <0 " java="2004" precision="NONE" />
correct, but Roman probably knows better.
--
Mark Rotteveel <Avalanche1979@...>