question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to update column value to null?

See original GitHub issue

How can I set a column value to null? there’s absolutely no documentation about how to work with null values in columns and I start to think that it’s impossible to do with DBFlow.

@Column var token: String? = null

SQLite.update(User::class.java).set(User_Table.token.?)

can’t find any method that would allow me to set it as null.

DBFlow 3

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
agrosnercommented, May 21, 2018

you probably will have to cast it to a type, use cast type of downloadedAt

0reactions
agrosnercommented, May 21, 2018

yes its because we have multiple methods to enforce typesafety within calling code so you place objects of proper type on a specific Property instance. I may think of better way in future instead of using null. if you predeclared date as: val date: Date? = null then pass it in, you wouldn’t need casting.

On Mon, May 21, 2018 at 2:41 PM, Hartmut Glücker notifications@github.com wrote:

Thanks for the swift reply, the cast was the crucial bit of information (as .eq(null) itself would not compile and I somehow didn’t get the idea of casting null).

For further reference: In my case, I used: SQLite.update(Area.class).set(Area_Table.downloadedAt.eq((Date) null).execute();

Thanks again!!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Raizlabs/DBFlow/issues/748#issuecomment-390744722, or mute the thread https://github.com/notifications/unsubscribe-auth/ACBQ487E7Q-lLltWHz3Q2cu2pCIfQwJbks5t0wpOgaJpZM4IHJ6s .

Read more comments on GitHub >

github_iconTop Results From Across the Web

How do I set a column value to NULL in SQL Server ...
If you've opened a table and you want to clear an existing value to NULL, click on the value ...
Read more >
How to Set a Column Value to Null in SQL? - GeeksforGeeks
To UPDATE Column value, use the below command: UPDATE TABLE [TABLE_NAME]. To set column value to NULL use syntax: update [TABLE_NAME] set ...
Read more >
Updating a Column to NULL - IBM
Use the NULL keyword to modify a column value when you use the UPDATE statement. For example, for a customer whose previous address...
Read more >
How to Replace Nulls with 0s in SQL - The Data School
Null Values can be replaced in SQL by using UPDATE, SET, and WHERE to search a column in a table for nulls and...
Read more >
Altering a Column from Null to Not Null in SQL Server - Chartio
Most critically, all existing NULL values within the column must be updated to a non-null value before the ALTER command can be successfully...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found