Chandu yadav has Published 1163 Articles

Can we use stored procedure to insert records into two tables at once in MySQL?

Chandu yadav

Chandu yadav

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

388 Views

Yes, you can use stored procedure to insert into two tables in a single query. Let us first create a table −mysql> create table DemoTable (    StudentId int NOT NULL AUTO_INCREMENT PRIMARY KEY,    StudentFirstName varchar(20) ); Query OK, 0 rows affected (0.56 sec)Here is the query to create ... Read More

ArrayBlockingQueue drainTo() Method in Java

Chandu yadav

Chandu yadav

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

155 Views

The drainTo() method of the ArrayBlockingQueue class removes all available elements from this queue and adds them to the given collection. It returns the number of elements transferred.The syntax is as followsint drainTo(Collection

8086 program to find the factorial of a number

Chandu yadav

Chandu yadav

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

12K+ Views

In this program we will see how to find the factorial of a number.Problem StatementWrite 8086 Assembly language program to find the factorial of a number stored in memory offset 500. Store the result at 600 and 601 memory offset.DiscussionTo find the factorial of a number n we have to ... Read More

Why should we use MySQL CASE Statement?

Chandu yadav

Chandu yadav

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

126 Views

Use MySQL CASE for a fixed number of arguments.The syntax is as followsSELECT *, CASE WHEN yourColumName1>yourColumName2 THEN 'yourMessage1' ELSE 'yourMessage2' END AS anyAliasName FROM yourTableName;To understand the above syntax, let us create a table. The query to create a table is as followsmysql> create table CaseFunctionDemo    -> ( ... Read More

DoubleStream boxed() method in Java

Chandu yadav

Chandu yadav

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

121 Views

The boxed() method of the DoubleStream class returns a Stream consisting of the elements of this stream, boxed to Double.The syntax is as followsStream boxed()Here, Double is the class that wraps a value of the primitive type double in an object. To work with DoubleStream class in Java, import the ... Read More

MySQL query to add 0's to numbers with less than 9 digits?

Chandu yadav

Chandu yadav

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

274 Views

Use LPAD() to add 0's to numbers with less than 9 digits. Let us first create a table −mysql> create table DemoTable (    Value varchar(20) ); Query OK, 0 rows affected (0.55 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values('3646465'); Query OK, 1 ... Read More

MySQL index on column of int type?

Chandu yadav

Chandu yadav

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

479 Views

Adding an index on column of int type is a good choice to run your query faster whenever your table has lots of records.If your table has less records then it is not a good choice to use index on column of int type.To understand the concept, let us create ... Read More

C Program to sum the digits of a given number in single statement

Chandu yadav

Chandu yadav

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

395 Views

In this section we will see how to find the sum of digits without writing multiple statements. In other words, we will find the sum of digits in a single statement.As we know that, to find the sum of digits we cut the last digit by taking the remainder after ... Read More

How to refresh a JSP page at regular interval?

Chandu yadav

Chandu yadav

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

259 Views

Following example would use setIntHeader() method to set Refresh header to simulate a digital clock −           Auto Refresh Header Example                        Auto Refresh Header Example               ... Read More

8086 program to convert binary to Grey code

Chandu yadav

Chandu yadav

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

2K+ Views

In this program we will see how to find the gray code from a binary number.Problem StatementWrite 8086 Assembly language program to find the equivalent gray code from a binary number. The number is stored at location 2500 and store the result at 2600.DiscussionTo convert binary to gray code, we ... Read More

Advertisements