I am trying to define a table with a column type of UUID (CHAR(16) CHARACTER SET OCTETS). After reading through the Firebird 3.0 Developer's Guide, I found only context-variables/simple expression/constant are supported. I would like to know if there is a way to define a default constraint on a table to call GEN_UUID() to assign UUID for insertion?
How to create default constraint on the table of Firebird to assign auto-generated UUID value
443 Views Asked by Andrew At
1
There are 1 best solutions below
Related Questions in SQL
- Can MVC.NET prevent SQL-injection at razor or controller level?
- SQL server not returning all rows
- When dealing with databases, does adding a different table when we can use a simple hash a good thing?
- Creating a parametrized field name for a SELECT clause
- Combine two rows based on common ID
- Column displays each count
- Slick query for one to optional one (zero or one) relationship
- Aggregate and count in PostgreSQL
- MAX and GROUP BY - SQL
- SQL statement for a tricky 2 table query
- How to create nested selects with sql?
- Pull and push data from and into sql databases using Excel VBA without pasting the data in Excel sheets
- Best Practice for adding columns to a Table in Oracle database
- SQL FIFO STACK using two tables
- SQL Query - Order by String (which contains number and chars)
Related Questions in FIREBIRD
- Datasnap\FireDAC: Query executed twice
- Firebird and Swift compatibility?
- Mono + embedded firebird
- Generate model classes from Firebird database
- Update a field from one table to another, involving a 3 table join
- Swift and C Interop
- Using index on `LIKE :varname || '%'` in firebird
- Firebird throwing exceptions at simple queries
- Impossible to generate metamodel in spagoBI studio with Firebird
- Sort by where order
- Configuration issues: Codeigniter and Firebird
- PDO firebird and Parameters
- Unable to drop table in Firebird
- Firebird 2.5 and ruby on rails 4.2
- How to gather hierarchical data items and build a tree considering their dependencies
Related Questions in UUID
- wmic csproduct get UUID equivalent for Unix and Mac?
- How deploy an large number iBeacons
- MongoDB insert UUID only using middleware?
- AltBeacon's Android Beacon Library getting major, minor and UUID
- Sortable UUIDs and overriding ActiveRecord::Base
- identifierForVendor changes on reinstall
- Guid as PK of Sql Server Table
- android device.getUuids returns null
- Does two device will have the same 'UUID'
- How to identify iOS device uniquely instead of using UUID and UDID
- How to covert time based java.util.UUID to DateTIme
- cast uuid to varchar in postgres when I use sequelize
- Issues with GRAILS UUID and PSQL
- How to generate a random UUID which is reproducible (with a seed) in Python
- Alternative to bitwise operators in uuid creation
Related Questions in DEFAULT-CONSTRAINT
- SqlBulkCopy into table that Default column values fails when source DataTable row has DBNull.Value
- NULL default constraint on nullable column
- How to override SQL Server default value constraint on a boolean when inserting new entity?
- Drop default constraint which has an illegal name?
- bulk insert with default constraint
- Set field to getdate() automatically without trigger
- How to specify a conditional DEFAULT constraint in SQL Server?
- Where is the default constraint name preserved?
- default a column with empty string
- mysql "datetime NOT NULL DEFAULT '1970-01-01' " gets turned to 0000-00-00 00:00:00
- How to create default constraint on the table of Firebird to assign auto-generated UUID value
- How to check the column default constraint exist?
- How to insert default contraint's value as a column value at the time of Table creation?
- SQL Server Computed Column Error With Multiple Inserts
- Pass a NULL value to DateTime Field in LINQ
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
You cannot do this with a
DEFAULTclause, as that only allows literals and a select number of what the Firebird documentation refers to as 'context variables'.To do what you want, you need to create a before insert trigger to generate the value. Something like this:
Or, if you don't want unconditional generation of the UUID: