Articles on Trending Technologies

Technical articles with clear explanations and examples

MySQL stored-procedure: out parameter?

Ankith Reddy
Ankith Reddy
Updated on 30-Jul-2019 1K+ Views

Here is a stored procedure that takes one parameter for input (IN) and second parameter for output (OUT)mysql> delimiter // mysql> create procedure Sp_SQRT(IN Number1 INT, OUT Number2 FLOAT) -> Begin -> set Number2=sqrt(Number1); -> end; -> // Query OK, 0 rows affected (0.24 sec) mysql> delimiter ;Call the stored procedure and send the value to the user variable. The syntax is as followsCALL yourStoredProcedureName(anyIntegerValue, @anyVariableName);Check what value is stored in the variable @anyVariableName. The syntax is as followsSELECT @anyVariableName;Created the stored procedure with the name ‘Sp_SQRT’. The ...

Read More

Does MySQL update with regexp possible?

Arjun Thakur
Arjun Thakur
Updated on 30-Jul-2019 522 Views

You cannot update with regexp i.e. you need to use LIKE operator instead of regexp. MySQL does not provide support for update with regexp. The LIKE operator is as follows:UPDATE yourTableName SET yourColumnName= REPLACE(yourColumnName, yourValue)', '' ) WHERE yourColumnNameLIKE '%yourValueThatWillReplace)%';To understand the above syntax, let us create a table.mysql> create table Replace_Demo    -> (    -> Id int NOT NULL AUTO_INCREMENT,    -> Value varchar(20),    -> PRIMARY KEY(Id)    -> ); Query OK, 0 rows affected (0.62 sec)Insert some records in the table using insert command. The query is as follows:mysql> insert into Replace_Demo(Value) values('221)'); Query OK, 1 ...

Read More

MySQL query to return all records with a datetime older than 1 week

Jennifer Nicholas
Jennifer Nicholas
Updated on 30-Jul-2019 3K+ Views

To get dates older than 1 week, you can use the following syntax −select *from yourTableName where yourColumnName < now() - interval 1 week;To understand the above concept, let us create a table. The query to create a table is as follows −mysql> create table DatesOfOneWeek −> ( −> ArrivalTime datetime −> ); Query OK, 0 rows affected (0.87 sec)Insert some records in the table −mysql> insert into DatesOfOneWeek values(date_add(now(), interval 2 week)); Query OK, 1 row affected (0.11 sec) mysql> insert into DatesOfOneWeek values('2018-11-04'); Query OK, 1 row affected ...

Read More

Email & Phone Validation in Swift

Vrundesha Joshi
Vrundesha Joshi
Updated on 30-Jul-2019 1K+ Views

To validate email and phone in swift language we can use multiple conditional statements like if conditions, but that’s a long process and may contain 50-100s of if statements to validate email.So instead of conditionals we’ll use Regular expression. Swift provides NSPredicates which we can use to evaluate a regular expression and test them.Let’s see how we can use regular expressions to do the same.We’ll create a function which we can use as extension of String class or UIViewController to use through out the project.Add the following code to any class in your Project, or create a separate swift class ...

Read More

MySQL truncate text with ellipsis?

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

You can truncate the text with ellipsis using LENGTH() with CASE statement. If your length is greater than 7 then truncate the text and add some number otherwise print the number as it is.To understand the above syntax, let us create a table. The query to create a table is as follows:mysql> create table TruncateText    -> (    -> Id int NOT NULL AUTO_INCREMENT,    -> Number longtext,    -> PRIMARY KEY(Id)    -> ); Query OK, 0 rows affected (0.66 sec)Insert some records in the table using insert command. The query is as follows:mysql> insert into TruncateText(Number) values('64575868667687'); ...

Read More

Create a table in MySQL that matches another table?

Rishi Rathor
Rishi Rathor
Updated on 30-Jul-2019 309 Views

To create a table in MySQL that matches with another table, use CREATE TABLE command with LIKE operator. The syntax is as follows −create table yourNewTableName like yourOldTableName;The above syntax creates structure of the table.If you want all records then use INSERT INTO…...SELECT *FROM command. The syntax is as follows −insert into yourNewTableName select *from yourOldTableName.I have an old table and some data −mysql> create table WholeWordMatchDemo −> ( −> Words varchar(200) −> ); Query OK, 0 rows affected (0.84 sec)First, we will create a table structure. The query is as ...

Read More

How can I take care of leather articles at home?

Ridhi Arora
Ridhi Arora
Updated on 30-Jul-2019 404 Views

The Leather is undoubtedly an expensive material as compared to its available counterparts. However, its luster and texture often get ruined with time. But we can avoid it if we handle it with a little care... gentlemen!!1. Let It Breathe: When we purchase a new leather belt, it is often packed in polythene. But once you start using it, use a cloth to cover it and wipe it off with a clean dry cloth.2. Hang Straight: Never swirl and bend your leather belt. Indeed hang it straight onto a hanger.3. Store It In Shade: Sunlight or any harsh radiant light tends ...

Read More

What's the most important file on your computer?

Samrat T
Samrat T
Updated on 30-Jul-2019 1K+ Views

The most important and irreplaceable files on your computer are your personal files. The windows system files etc. can be reinstalled, but your applications and your data are the most important files on your computer which have to be backed up periodically according to the changes and need.

Read More

Conditional NOT NULL case MySQL?

George John
George John
Updated on 30-Jul-2019 885 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 table is as follows:mysql> create table ConditionalNotNullDemo -> ( -> Id int NOT NULL AUTO_INCREMENT, -> SendMessage longtext, -> PRIMARY KEY(Id) -> ); Query OK, 0 rows affected (0.62 sec)Insert some records in the table ...

Read More

How women education leads to women empowerment?

Rashmi Iyer
Rashmi Iyer
Updated on 30-Jul-2019 639 Views

“If you educate one man you educate an individual, but, if you educate one woman you educate one whole family. Women empowered means mother India empowered”. - Pandit Jawaharlal NehruWomen Education in India today is not in an ideal state. Today, only 1 out of 100 girls gets access to higher education (College Education). While, women are excelling in different fields today, on one hand, the women in the masses are even today getting limited or no access to education on the other.The following points answer the question - how proper education to women can help in creating the empowerment ...

Read More
Showing 60211–60220 of 61,297 articles
Advertisements