Articles on Trending Technologies

Technical articles with clear explanations and examples

MySQL search if more than one string contains special characters?\\n

Anvi Jain
Anvi Jain
Updated on 30-Jul-2019 3K+ Views

To search if strings contain special characters, you can use REGEXP. Following is the syntax −select * from yourTableName where yourColumnName REGEXP '[^a-zA-Z0-9]';Let us first create a table −mysql> create table specialCharactersDemo    -> (    -> StudentId varchar(100)    -> ); Query OK, 0 rows affected (0.58 sec)Insert records in the table using insert command. Following is the query −mysql> insert into specialCharactersDemo values('STU_1234'); Query OK, 1 row affected (0.15 sec) mysql> insert into specialCharactersDemo values('STU567'); Query OK, 1 row affected (0.14 sec) mysql> insert into specialCharactersDemo values('STU#1234'); Query OK, 1 row affected (0.13 sec) mysql> insert into specialCharactersDemo ...

Read More

How to match underscore in a MySQL String?

George John
George John
Updated on 30-Jul-2019 1K+ Views

To match underscore in a MySQL string, you can use the below syntax −select *from yourTableName where yourColumnName LIKE '%\_%';Let us first create a table −mysql> create table DemoTable (    ClientId varchar(200) ); Query OK, 0 rows affected (0.79 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values('CLI_101'); Query OK, 1 row affected (0.13 sec) mysql> insert into DemoTable values('CLI1110'); Query OK, 1 row affected (0.13 sec) mysql> insert into DemoTable values('_CLI102'); Query OK, 1 row affected (0.16 sec) mysql> insert into DemoTable values('CLI103_'); Query OK, 1 row affected (0.12 sec) mysql> insert into ...

Read More

PPP over ATM (PPPoA)

Krantik Chavan
Krantik Chavan
Updated on 30-Jul-2019 716 Views

PPP over ATM (PPPoA) is a data link layer protocol to transmit PPP data over ATM networks, by encapsulating PPP frames in ATM Adaptation Layer 5 (AAL 5) frames.Point − to − Point Protocol (PPP) is a data link layer protocol that is used to transmit data between two directly connected (point-to-point) computers. It is a byte – oriented protocol that is widely used in broadband communications having heavy loads and high speeds. It is also known as RFC 1661.In Asynchronous Transfer Mode (ATM) networks, the ATM Adaptation Layer (AAL) provides facilities for non-ATM based networks to connect to ATM ...

Read More

How to use unmodifiableSet in Android?

Nitya Raut
Nitya Raut
Updated on 30-Jul-2019 202 Views

This example demonstrate about How to use unmodifiableSet in Android.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 to res/layout/activity_main.xml.                                 In the above code, we have taken name and record number as Edit text, when user click on save button it will store the data into arraylist. Click on refresh button to get the changes of listview.Step 3 ...

Read More

What are the important components of ODBC?

Nancy Den
Nancy Den
Updated on 30-Jul-2019 1K+ Views

Following are the main components of the ODBC architecture.Application: An application which communicates with the databases using ODBC functions is ODBC application.ODBC driver manager: Whenever an application calls a function of ODBC API to communicate with a database, the driver manager accepts and passes it to ODBC driver and accepts the results from the driver and returns it back to the application.ODBC driver: The ODBC driver accepts the application function calls from the driver manager and connects to the specified DataSource, retrieves the required data and returns it to the driver manager.Data source: A DataSource contains a set of data, ...

Read More

How to get current internet connection type in android?

Vrundesha Joshi
Vrundesha Joshi
Updated on 30-Jul-2019 475 Views

This example demonstrate about How to get current internet connection type in android.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 to res/layout/activity_main.xml. In the above code, we have taken text view to show connection type.Step 3 − Add the following code to src/MainActivity.javapackage com.example.myapplication; import android.content.Context; import android.net.ConnectivityManager; import android.net.NetworkInfo; import android.os.Build; import android.os.Bundle; import android.support.annotation.RequiresApi; import android.support.v7.app.AppCompatActivity; import android.widget.TextView; public class MainActivity extends AppCompatActivity { TextView textView; ...

Read More

MongoDB 'count()' is very slow. How do we work around with it?

Smita Kapse
Smita Kapse
Updated on 30-Jul-2019 1K+ Views

You can use ensureIndex() to boost the performance of count() method in MongoDB. To understand the concept, let us create a collection with the document. The query to create a collection with a document is as follows −> db.countPerformanceDemo.insertOne({"StudentName":"John", "StudentCountryName":"US"}); {    "acknowledged" : true,    "insertedId" : ObjectId("5c8ebcf82f684a30fbdfd55f") } > db.countPerformanceDemo.insertOne({"StudentName":"Mike", "StudentCountryName":"UK"}); {    "acknowledged" : true,    "insertedId" : ObjectId("5c8ebd042f684a30fbdfd560") } > db.countPerformanceDemo.insertOne({"StudentName":"David", "StudentCountryName":"AUS"}); {    "acknowledged" : true,    "insertedId" : ObjectId("5c8ebd112f684a30fbdfd561") } > db.countPerformanceDemo.insertOne({"StudentName":"Carol", "StudentCountryName":"US"}); {    "acknowledged" : true,    "insertedId" : ObjectId("5c8ebd1a2f684a30fbdfd562") } > db.countPerformanceDemo.insertOne({"StudentName":"Bob", "StudentCountryName":"UK"}); {    "acknowledged" : true,    "insertedId" : ...

Read More

Resolve MySQL ERROR 1064 (42000): You have an error in your syntax?

Smita Kapse
Smita Kapse
Updated on 30-Jul-2019 8K+ Views

This error occurs if let’s say you used var_char instead of varchar type. To remove this type of error, use, for example, varchar(100) instead of var_char(100).Let us now see how this error occurs −mysql> create table removeErrorDemo    -> (    -> StudentId int,    -> StudentName var_char(50)    -> );The following is the output displaying the error −ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'var_char(50) )' at line 4Now let us remove the error. Here is the query ...

Read More

How to use IF in stored procedure and select in MySQL?

Ankith Reddy
Ankith Reddy
Updated on 30-Jul-2019 645 Views

You can use IF in stored procedure and IF() in select statement as well.IF() in select statementIF() in select statement mysql> select if(0=0, 'Hello MySQL', 'condition is wrong');This will produce the following output −+------------------------------------------------------+ | if('test'='test', 'Hello MySQL', 'condition is wrong') | +------------------------------------------------------+ | Hello MySQL | +------------------------------------------------------+ 1 row in set (0.00 sec)The second case if your condition ...

Read More

Can we select row by DATEPART() in MySQL? Is it possible?

Chandu yadav
Chandu yadav
Updated on 30-Jul-2019 2K+ Views

There is no DATEPART() function in MySQL, you need to use MONTH() function to extract the month name from date column. The syntax is as follows:SELECT *FROM yourTableName WHERE MONTH(yourDateColumnName)=yourValue;To understand the above syntax, let us create a table. The query to create a table is as follows:mysql> create table SelectRowFromDatePart -> ( -> Id int NOT NULL AUTO_INCREMENT, -> LoginDate date, -> PRIMARY KEY(Id) -> ); Query OK, 0 rows affected (2.42 sec)Now you can insert some records in the table using ...

Read More
Showing 58651–58660 of 61,248 articles
Advertisements