Sai Nath

Sai Nath

15 Articles Published

Articles by Sai Nath

15 articles

What is the usage of oninput event in JavaScript?

Sai Nath
Sai Nath
Updated on 23-Jun-2020 407 Views

When a value is added in an input box, then the oninput event occurs. You can try to run the following code to learn how to implement oninput event in JavaScript −Example           Write below:                            function inputFunc() {             var a = document.getElementById("newInput").value;             document.write("Typed: " + a);          }          

Read More

How can we ENABLE AND DISABLE a particular MySQL event?

Sai Nath
Sai Nath
Updated on 22-Jun-2020 3K+ Views

With the help of ALTER EVENT statement along with the ENABLE and DISABLE keyword, we can ENABLE and DISABLE the event. To illustrate it we are having the following example −Examplemysql> ALTER EVENT hello DISABLE; Query OK, 0 rows affected (0.00 sec)The above query will DISABLE the event named ‘Hello’ and the query below will enable it.mysql> ALTER EVENT hello ENABLE; Query OK, 0 rows affected (0.00 sec)

Read More

How can we convert subqueries to LEFT JOIN?

Sai Nath
Sai Nath
Updated on 22-Jun-2020 2K+ Views

To make it understand we are using the data from the following tables −mysql> Select * from customers; +-------------+----------+ | Customer_Id | Name     | +-------------+----------+ | 1           | Rahul    | | 2           | Yashpal  | | 3           | Gaurav   | | 4           | Virender | +-------------+----------+ 4 rows in set (0.00 sec) mysql> Select * from reserve; +------+------------+ | ID   | Day        | +------+------------+ | 1    | 2017-12-30 | | ...

Read More

What is the use of MySQL NULLIF() control flow function?

Sai Nath
Sai Nath
Updated on 22-Jun-2020 269 Views

MySQL NULLIF() control flow function will return NULL if both the arguments are the same, otherwise, it returns the first argument.SyntaxNULLIF(expression1, expression2)Here if expression1 = expression2, NULL will be returned by NULLIF() otherwise expression1 will be returned. Following example will exhibit this −mysql> Select NULLIF('Ram','Ram'); +---------------------+ | NULLIF('Ram','Ram') | +---------------------+ | NULL                | +---------------------+ 1 row in set (0.00 sec) mysql> Select NULLIF('Ram','Shyam'); +-----------------------+ | NULLIF('Ram','Shyam') | +-----------------------+ | Ram                   | +-----------------------+ 1 row in set (0.00 sec)

Read More

What is the method with the help of which the hexadecimal value can be treated as a number?

Sai Nath
Sai Nath
Updated on 22-Jun-2020 128 Views

For treating the hexadecimal value as a number, we can use the CAST(… AS UNSIGNED) function. Following example will demonstrate it −mysql> Select 0x54, CAST(0x54 AS UNSIGNED); +------+------------------------+ | 0x54 | CAST(0x54 AS UNSIGNED) | +------+------------------------+ | T    |                     84 | +------+------------------------+ 1 row in set (0.01 sec)

Read More

How can we divide the result set returned by MySQL into groups?

Sai Nath
Sai Nath
Updated on 20-Jun-2020 1K+ Views

It can be done by using GROUP BY clause in the SELECT statement. We can specify a column as grouping criteria with the help of GROUP BY clause. Due to the specified grouping criteria, rows with the same value in a particular column are considered as a single group. In this way, the result set returned by MySQL SELECT statement will be divided into groups.ExampleFollowing is a good example to understand it −We have a table named ‘employees’ as follows −mysql> Select * from employees; +------+-------------+--------+------------+ | id   | designation | Salary | DoJ        | +------+-------------+--------+------------+ ...

Read More

What is the usage of onunload event in JavaScript?

Sai Nath
Sai Nath
Updated on 21-May-2020 397 Views

The unload event trigger when you unload (or refresh) a page. You can try to run the following code to learn how to implement onunload event in JavaScript.Example           Close the page and see what happens!       This event may give unexpected results.                function newFunc() {             alert("Thank you!");          }          

Read More

What is the usage of an abort event in JavaScript?

Sai Nath
Sai Nath
Updated on 21-May-2020 467 Views

Use the on abort event to abort the loading of an image. You can try to run the following code to learn how to implement an abort event in JavaScript.Example                    function abortFunc() {             alert('Error- Loading of the image aborted');          }                

Read More

Java String toCharArray() method example.

Sai Nath
Sai Nath
Updated on 26-Feb-2020 133 Views

The toCharArray() method of a String class converts this string to a character array.ExampleLive Demoimport java.lang.*; public class StringDemo {    public static void main(String[] args) {       // converts String value to character array type value       String str = " Java was developed by James Gosling";       char retval[] = str.toCharArray();       // displays the converted value       System.out.println("Converted value to character array = ");       System.out.println(retval);    } }OutputConverted value to character array = Java was developed by James Gosling

Read More

Handling Exception and use of CX_ROOT directly and subclasses

Sai Nath
Sai Nath
Updated on 14-Feb-2020 429 Views

It is not advisable to use CX_ROOT directly and you would require using one of its direct subclasses. Also, the propagation depends upon the exception subclass hierarchy.Subclasses of CX_STATIC_CHECK – these do not propagate automatically. You will need to do the handling yourself or there will be a syntax error in the program.Subclasses of CX_DYNAMIC_CHECK – these do not require any handling. But the program that does not handle the exception will be aborted with these subclasses.Subclasses of CX_NO_CHECK – These will get propagated automatically if the exception is not handled.

Read More
Showing 1–10 of 15 articles
« Prev 1 2 Next »
Advertisements