George John has Published 1167 Articles

How to share app data with other applications in android?

George John

George John

Updated on 30-Jul-2019 22:30:24

1K+ Views

In android using implicit intent, we can send data with other applications using ACTION_SEND action. We have to call Intent.createChooser() to open default chooser of android mobile to send the data. it may same or different in Android mobiles.This example demonstrates how to share app data with other applications in ... Read More

Android Popup Menu Example

George John

George John

Updated on 30-Jul-2019 22:30:24

2K+ Views

Popup menu just like a menu, it going to be display either above of the view or below of the view according to space on activity. Here is the simple solution to create android popup menu.Step 1 − Create a new project in Android Studio, go to File ⇒ New ... Read More

Can MySQL automatically convert empty strings to NULL?

George John

George John

Updated on 30-Jul-2019 22:30:24

12K+ Views

You need to use NULLIF() function from MySQL. The syntax is as follows:SELECT NULLIF(yourCoumnName, ’ ’) as anyVariableName from yourTableName;In the above syntax, if you compare empty string( ‘ ‘) to empty string( ‘ ‘), the result will always be NULL. However, if you compare with NULL to empty string( ... Read More

What is the difference between int and integer in MySQL?

George John

George John

Updated on 30-Jul-2019 22:30:24

2K+ Views

The int is the synonym of integer in MySQL 5.0. Here is the demo display both int and integer internally represents int(11).Creating a table with int datatypemysql> create table IntDemo    -> (    -> Id int    -> ); Query OK, 0 rows affected (1.04 sec)Here is description of ... Read More

Conditional NOT NULL case MySQL?

George John

George John

Updated on 30-Jul-2019 22:30:24

602 Views

For conditional NOT NULL case, you do not need to use and = operator. You need to use IS NULL and IS NOT NULL property because NULL is a special case in MySQL.To understand the conditional NOT NULL case, let us create a table. The query to create a ... Read More

Sort by order of values in a MySQL select statement IN clause?

George John

George John

Updated on 30-Jul-2019 22:30:24

104 Views

You can use field() function with ORDER BY clause to sort by order of values. The syntax is as followsSELECT *FROM yourTableName WHERE yourColumnName IN(Value1, Value2, Value3, .......N); ORDER BY FIELD(yourColumnName ,Value1, Value2, Value3, .......N);To understand the above syntax, let us create a table. The query to create a table ... Read More

MySQL stored procedure return value?

George John

George John

Updated on 30-Jul-2019 22:30:24

12K+ Views

To return a value from stored procedure, you need to use user defined session specific variable. Add @ symbol before variable name.For example, use @symbol for variable valido. The syntax for the same is as follows:SELECT @valido;Whenever you use select statement, you need to use @anyVariableName. The syntax is as ... Read More

When the MySQL delimiter error occur?

George John

George John

Updated on 30-Jul-2019 22:30:24

1K+ Views

The MySQL delimiter occurs when you are using a pipe delimiter(|) with semicolon (;) and using MySQL version lower than 8.0.12.MySQL treats the pipe (|) as one delimiter and semicolon (;) is another delimiter. Therefore, do not confuse the MySQL delimiter with pipe as well as semicolon.Note: Here, we are ... Read More

How to insert DECIMAL into MySQL database?

George John

George John

Updated on 30-Jul-2019 22:30:24

7K+ Views

To insert decimal into MySQL, you can use DECIMAL() function from MySQL. The syntax is as followsyourColumnName DECIMAL(TotalDigit, DigitAfterDecimalPoint);To understand the above syntax, let us create a table. The query to create a table is as followsmysql> create table DecimalInsert    -> (    -> Id int,    -> Name ... Read More

How to output MySQL query results in CSV format and display it on the screen, not a file?

George John

George John

Updated on 30-Jul-2019 22:30:24

516 Views

To get the output MySQL query result in CSV format, use concat(). The syntax is as follows −mysql> select concat(StudentId, ', ', StudentName, ', ', StudentAge) as CSVFormat from CSVFormatOutputs;To understand the above syntax, let us create a table. The query to create a table is as follows−mysql> create table ... Read More

Advertisements