Skip to main content

Questions tagged [default-value]

For questions relating to DBMS-supplied values that are generated when none are explicitly provided.

1 vote
2 answers
233 views

What I'm trying to do is to have an optional parameter in my stored procedure that gets the default value defined in the table if not provided. create table primates ( id int identity(1,1) ...
Shahriar's user avatar
  • 121
0 votes
0 answers
762 views

In Snowflake, what are the implications of having a default value of null on a non-nullable column? Also, when I describe a particular table in Snowflake, I see a default value of NULL in all columns. ...
Jimbo's user avatar
  • 65
0 votes
1 answer
138 views

I have a couple of audit columns in my table: modified_by modified_date I have an AFTER trigger set up to automatically update these columns whenever data is inserted or modified, with current_user ...
greenandblue's user avatar
1 vote
1 answer
44 views

I am a complete novice, I hope my terminology is correct. I have a database created long ago. It helps keep track of visitors. The visitor’s data is entered manually, but some fields are calculated ...
Arthur's user avatar
  • 11
1 vote
4 answers
6k views

When I use show create table Posts I see this column: `Slug` varchar(400) NOT NULL DEFAULT 'uuid()' This means that the default value is a string. I want the default string to be a real uuid() ...
Mohammad Miras's user avatar
0 votes
1 answer
74 views

Cassandra has added guardrails feature some time ago, bust none of the guardrails have any default value set in the configuration file (see cassandra.yaml). I generally wonder how can a db admin know ...
Piotr Smaroń's user avatar
1 vote
1 answer
744 views

I have a database with a table whose primary key is a serial column, or a column with a locally-computed default value that prevents conflicts, for instance: CREATE TABLE foo ( foo_id serial ...
user2233709's user avatar
0 votes
1 answer
275 views

Before all, sorry my very bad english level. Here's my problem. If i have two tables: 'Products' |id | product | |---|---------| |1 | "Fork" | |2 | "Spoon" | |3 | "Knife&...
Matt Ross's user avatar
4 votes
2 answers
6k views

I'm trying to generate dummy tables with dummy data for testing performance with some SQL tasks. Based on this old thread: Is there a way to insert multiple rows into a table with default values for ...
s.k's user avatar
  • 444
7 votes
1 answer
20k views

We have a Rails app powered by Postgresql v11.4 where I want to add a new column with a default value and a not null constraint like below: ALTER TABLE "blogs" ADD "published" ...
ogirginc's user avatar
  • 275
2 votes
0 answers
97 views

When creating a new login via the GUI: In the User Mapping section, certain databases will have some roles pre-ticked in the Database Role Membership section. What controls this behavior? It's ...
soapy smith's user avatar
3 votes
1 answer
11k views

I have a table definition in Postgres that use now() for timestamp and current_user() for auditing. date_created date NULL DEFAULT now(), edited_by varchar NULL DEFAULT "current_user"(), ...
geogrow's user avatar
  • 384
0 votes
0 answers
238 views

Is there any way I can just say once that the default type should be TEXT, and the default value should be '' for all CREATE TABLEs? Currently I must do: CREATE TABLE "t" (dbm TEXT DEFAULT ''...
Dan Jacobson's user avatar
0 votes
1 answer
5k views

The table T has this field +---------------+--------------+------+-----+-------------------+-----------------------------+ | Field | Type | Null | Key | Default | Extra ...
Déjà vu's user avatar
  • 555
0 votes
1 answer
531 views

I have an account table which is laid out in 3NF: CREATE TABLE account ( account_id INT AUTO_INCREMENT, customer_id INT NOT NULL, account_type_id VARCHAR(15) NOT NULL, is_active ...
Mj _'s user avatar
  • 13

15 30 50 per page
1
2 3 4 5
7