Questions tagged as 'default'

1
answer

If the field has DEFAULT should it be NOT NULL?

Situation I was adding a few more columns to a table and fell out of this thought. By default we leave all fields with NULL value, however if it has a DEFAULT it will insert DEFAULT instead of NULL . Question...
asked by 20.10.2015 / 17:12
1
answer

Use ON UPDATE CURRENT_TIMESTAMP when changing specific field

Example scenario Table: usuarios Fields: id , nome , sobrenome , senha , timestamp_alteracao Question The timestamp_alteração field should only be updated when the senha field chan...
asked by 28.11.2018 / 12:29
2
answers

Sql server - default

Good evening, I created a table to test the sql server default: I made a select to see if the default values of the default were entered but you can see in the image that this did not happen. When does it enter these default values? I foun...
asked by 15.03.2016 / 06:23
1
answer

BLOB column 'on' can not have a default value (default)

When trying to keep a column as null, mediumText , and add a value 'as defined', it returns:    BLOB column 'over' can not have a default value Why can not I? What are the implications of this? How can I resolve this to allow an opt...
asked by 21.11.2017 / 18:06
2
answers

Eloquent Laravel - Column user_id

Hello, I'm learning laravel and I do not find this in any forum. I have some tables that have a foreign key called 'user_id', but when I save an object in the database I always have to fill that column. Is there a way to do this? I want to be ab...
asked by 08.05.2018 / 03:36
1
answer

Problem with Segmention fault

I was studying a little, I'm very good at programming, and I came across an error, segmention default , I'll leave my code below, and if possible, someone can figure out why I'm getting this error. p> NOTE: The error comes after typing t...
asked by 23.04.2017 / 15:52
2
answers

Default Value Dropdown AngularJS

In my project I have a dropdown, iterated from an array. Note that in the array I have a key called default that is set to true or false. I would like the dropdown defalt value to come with the key set to true. If I do this: $scope.nfe.nat...
asked by 02.07.2017 / 22:19
1
answer

How to make an INSERT in postgresql with conditional default value?

We have the following simplified table for the example: create table teste( id serial not null ); The following commands cause syntax error: insert into teste( select (case when 1=1 then DEFAULT end) );...
asked by 15.02.2017 / 15:13
2
answers

Android Studio 3.2.1 does not find "Default Activity"

I've been having this problem since Android 3.2. I have already done the following procedures to try to fix the problem: - I've done clean and rebuild of the project - I already cleared the cache and restarted Android Studio - I already sync...
asked by 20.10.2018 / 20:01