Questions tagged [notnull]

This tag refers to an object or type that is not null (none).

Use this tag for questions related to not-null types or objects (i.e. detecting them, handling them, etc.).

295 questions
0
votes
1 answer

Postgresql: Trying to Understand the Information Schema Table Constraints Info for a NOT NULL Contstraint

In Postgresql, You can obtain information about the constraints on a table by using a query such as: SELECT * FROM information_schema.table_constraints WHERE table_name='table_name'; When I do this, columns that have a NOT NULL constraint will show…
0
votes
2 answers

Finding Not null on multiple columns using COALESCE

I have a query to find not null on 2 columns on a table which is a view , hence it is taking a lot of time for execution. The query is : Query1 SELECT [Table1].M, [[Table1]].B, [Table1].P FROM [Table1] WHERE ((([[Table1]].B) Is Not Null) AND…
WiredTheories
  • 231
  • 7
  • 18
0
votes
2 answers

Grails Domain class constraint 'Not Null'

I have a domain class: class ProgramArea { String programCd String programArea String description static constraints = { programCd(nullable: false, unique: true) programArea(nullable:…
0
votes
1 answer

I want to check whether all the values set of an object are null or not

String var_a = null; String var_b = null; Xyz obj1 = new Xyz(); Abc obj2 = new Abc(); if(var_a != null){ obj1.setValue1(var_a); } if(var_b != null){ obj1.setvalue2(var_b); } if(obj1 != null ){ …
0
votes
0 answers

Is there a way to annotate a class to apply an annotation to every inner element in java?

Specifically a class annotation to apply a NotNull annotations(like those presented in Which @NotNull Java annotation should I use?) by default to all fields, method return and parameters in the class. Or a package annotation to apply NotNull…
Roman A. Taycher
  • 18,619
  • 19
  • 86
  • 141
0
votes
1 answer

Preserving not null when changing datatype of column in SQL Server - Java

I need to change datatype of all columns in database where datatype is char(255) to nvarchar(255). To do that, I need to remove P/F keys and then recreate them again. But on datatype change, I loose not null information. Some columns may be…
Aleksandar
  • 1,163
  • 22
  • 41
0
votes
4 answers

BufferedReader Null Deference

Here at the line while((anInt=bufferedReader.read())!=-1) iam getting Null Dereference issue when i do my XSS validation on the below code. For this is this enough to check not null or do we have any other check or solution to resolve…
Mdhar9e
  • 1,376
  • 4
  • 23
  • 46
0
votes
2 answers

Creation Failed: Key column 'name' doesn't exist in table:

I am trying to create a series of tables using Foreign Keys of Primary Keys from other tables, however I always get the error Table Creation Failed: Key column 'PACId' doesn't exist in table: Here is the first case it appears: CREATE TABLE…
Ben
  • 2,433
  • 5
  • 39
  • 69
0
votes
2 answers

Would a Mandatory be a useful addition alongside Guava's Optional?

I was looking at Guava's Optional class and its justification, and I wondered whether a similar class to fail-fast when representing values that must not be null would be helpful. I can't find any discussion of this idea so I thought I'd ask…
brabster
  • 42,504
  • 27
  • 146
  • 186
0
votes
2 answers

Notnull and empty string in My SQL

Hy I have problem. I wanna to create table with some atributes, and some of them shoud be specified as NOT NULL.. And here comes the problem. When I insert some data into table, and when I insert '' (empty single string) it input data into table,…
Turbo
  • 21
  • 4
0
votes
2 answers

How to avoid inserting a field that is not null from csv to mysql using Perl?

I am inserting a csv file into MySQL using Perl. I have successfully inserted some data into MySQL. However, some fields in the csv file are null and the code cannot continue to run. What is the correct way to express if statement to check if…
0
votes
1 answer

Hide fields if it is empty

I am using this code, I want to just those field there is no empty if any fields is empty then not open the image from my sql server, $Query = "SELECT * FROM movie_post WHERE id=$id AND NOT IS…
0
votes
0 answers

Why am I getting "Possible 'null' assignment to entity marked with 'NotNull' attribute" here from Resharper, and how can I appease it?

In code like so: DataSet dsDuckbill = new DataSet(); DataTable dtDuckbill = dsDuckbill.Tables.Add("DSD"); dtDuckbill.Columns.Add("line_id", Type.GetType("System.Int32")); dtDuckbill.Columns["line_id"].AutoIncrement =…
B. Clay Shannon-B. Crow Raven
  • 8,547
  • 144
  • 472
  • 862
0
votes
2 answers

Generic method to display error for a not null input box

Desired Result I'm attempting to create a generic method in Javascript (JQUERY) which checks the page for any and every element whether it is nullable or not. As a example I'm using a login. Both the username and password are not nullable. In my…
Theun Arbeider
  • 5,259
  • 11
  • 45
  • 68
0
votes
2 answers

"Where" method with "not nil" checking

How can I check if my variable is not nil when I use the "where" method ? I tried these on a Product model that has a borrower_id field, but it didn't worked properly : > Product.where("borrower_id.nil?") > Product.where("borrower_id != nil") >…
Flo Rahl
  • 1,044
  • 1
  • 16
  • 33