The ftp_systype() function returns the system type identifier of the FTP server.Syntaxftp_systype(con);Parameterscon − The FTP connectionReturnThe ftp_systype() function returns the system type on success, or FALSE on failure.ExampleThe following is an example −
To split a string and loop through all values in MySQL procedure, you do not need to use REPLACE() function. To understand, first create a stored procedure and after that create a table and call the stored procedure with some values. The value will be inserted into the table.The query to create a stored procedure is as follows:mysql> DELIMITER // mysql> CREATE PROCEDURE SP_SplitString(Value longtext) -> BEGIN -> DECLARE front TEXT DEFAULT NULL; -> DECLARE frontlen INT DEFAULT NULL; -> DECLARE TempValue TEXT DEFAULT NULL; -> iterator: -> LOOP -> IF LENGTH(TRIM(Value)) ... Read More
In order to get all characters before space in MySQL, you can use left() function from the MySQL. The syntax is as follows −select left(yourColumnName, LOCATE(' ', yourColumnName) - 1) as anyVariableName from yourTableName;To understand the above concept, let us create a table.The query to create a table is as follows −mysql> create table AllCharacterBeforeSpace −> ( −> FirstNameAndLastName varchar(200) −> ); Query OK, 0 rows affected (0.51 sec)Now you can insert some records in the table.The query to insert records is as follows −mysql> insert into AllCharacterBeforeSpace values('John Smith'); Query ... Read More
The DDL stands for Data Definition Language. To generate the table DDL via query, you can use show create command.The syntax is as followsSHOW CREATE TABLE yourTableName;The above syntax is MySQL specific. Suppose, we have a table with the name ‘DDLOfTableStudent’.First, create a table with the name ‘DDLOfTableStudent’. The query to create a table is as followsmysql> create table DDLOfTableStudent -> ( -> StudentId int, -> StudentFirstName varchar(100), -> StudentLastName varchar(100), -> StudentAddress varchar(200), -> StudentAge int, -> StudentMarks ... Read More
Before getting into the example, we should know what is view pager in android. View pager found in Support Library in Android, using view pager we can switch the fragments.This example demonstrates how to use android view pager.Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.Step 2 − Add the following code in build.gradle.apply plugin: 'com.android.application' android { compileSdkVersion 28 defaultConfig { applicationId "com.example.andy.myapplication" minSdkVersion 19 targetSdkVersion 28 versionCode ... Read More
Statistics show that in 1980 the economies of China and India were almost the same in terms of gross domestic product (GDP). But China has crossed India and continuing to run ahead. China is ahead of India economically because it has initiated economic reforms at least 1 decade earlier.Chinese are currently obsessed with technological leadership and their economy is growing at an average rate of 10% every year. In fact, the Chinese manufacturing sector is presently eight times the size of India's. There are many reasons for their rapid growth in technology.Chinese Government has initiated Business-friendly Special Economic Zones and ... Read More
To retrieve large select by chunks, you need to use ORDER BY LIMIT. The syntax is as follows:SELECT *FROM yourTableName ORDER BY yourColumnName LIMIT 0, 10;From the above syntax, you will get 10 rows from the table. In the above syntax, 0 represents the first row from the result set of a table that means it is zero index based. The second value of LIMIT represents the maximum number of rows that can be retrieved from the table.If you want the next rows after 10 to 30, then use in LIMIT like this. The syntax is as follows:SELECT *FROM yourTableName ... Read More
TimeZone can be formatted in z, Z or zzzz formats.The following is an example that displays how to implement SimpleDateFormat('zzzz') −Example Live Demoimport java.text.Format; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Calendar; public class Demo { public static void main(String[] args) throws Exception { // displaying current date and time Calendar cal = Calendar.getInstance(); SimpleDateFormat simpleformat = new SimpleDateFormat("dd/MMMM/yyyy hh:mm:s zzzz"); System.out.println("Today's date = "+simpleformat.format(cal.getTime())); // displaying hour ... Read More
To add a day to a DATETIME format value, you can use DATE_ADD() function from MySQL.The syntax is as follows −select date_add(now(), interval 1 day) as anyVariableName;Now you can implement the above syntax in order to add a day to a datetime format.mysql> select date_add(now(), interval 1 day) as Adding1DayDemo;The following is the output −+---------------------+ | Adding1DayDemo | +---------------------+ | 2018-12-07 20:06:59 | +---------------------+ 1 row in set (0.00 sec)If you want to add a day only to a date, you can use curdate() function. The query is as follows −mysql> select date_add(curdate(), interval 1 ... Read More
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 is as followsmysql> create table SelectInDemo -> ( -> StudentId int, -> StudentName varchar(100), -> StudentAge int -> ); Query OK, 0 rows affected (1.04 sec)Insert records in the table using insert command. The query is as followsmysql> insert into SelectInDemo values(1, 'Mike', 23); Query ... Read More