Social Connect
linkedin
Categories
Uncategorized

Technical

SQL
Overview Of SQL Stored Procedures
Hello Everyone, This Blog is about MySQL Stored Procedure think of it as a beginner guide/ intro towards Stored Procedures. To follow along, you must at least know the basic of MYSQL operations like create a database/ table and simple DML(Data Manipulation Language) queries like INSERT, UPDATE AND DELETE And DQL (Data Query Language)DQL (Data Query Language) SELECT.

I’m not an expert just learned along the way, while I was tackling a problem to optimize my queries ?

Post Author: Swaroop Das, Web Developer

Date: July 6, 2020

What is a Stored Procedure?

In a simple term, it’s just a bunch of SQL instructions (queries) run together, just like a function in other programming languages…

When to use it?

Let’s say, you have a set of instructions that need to run in sequence…

Where to use it?

Periodic updating of data is necessary.

Why use it?

  • They allow modular programming.
  • They allow faster execution.
  • They reduce network traffic.
  • They can be used as a security mechanism.

Understanding Delimiters

A delimiter is a sequence of characters that separate SQL statements…


	DELIMITER $$
	CREATE PROCEDURE PROCEDURE_NAME()
	BEGIN
	  SELECT name FROM customer;
	END $$
	DELIMITER ;
      	

How to Write Your Own Stored Procedure


	DELIMITER $$
	CREATE PROCEDURE PROCEDURE_NAME()
	BEGIN
	  /* Procedure code */
	END $$
	DELIMITER ;
      	

Common Commands

  • CALL PROCEDURE_NAME();
  • DROP PROCEDURE IF EXISTS PROCEDURE_NAME;
  • SHOW PROCEDURE STATUS;

Variables and Conditional Statements


	DECLARE done INT DEFAULT FALSE;

	IF CONDITION THEN
	  /* Statement */
	ELSE
	  /* Alternate */
	ENDIF;
        

Switch Case Example


	SELECT id,
	(
	  CASE
	    WHEN qty > 0 AND stock_status = 1 THEN 'ENABLE'
	    WHEN qty <= 0 AND stock_status = 0 THEN 'DISABLE'
	  END
	) AS product_enable
	FROM products;
        

Loops and Cursors


	DELIMITER $$
	CREATE PROCEDURE updateStatus()
	BEGIN
	  DECLARE done INT DEFAULT FALSE;
	  DECLARE id INT;
	  DECLARE cursor_products CURSOR FOR SELECT Id FROM products;
	  DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE;

	  OPEN cursor_products;

	  read_loop: LOOP
	    FETCH cursor_products INTO id;
	    IF done THEN
	      LEAVE read_loop;
	    END IF;
	    UPDATE products SET stock_status=IF(qty>0,1,0) WHERE Id=id;
	  END LOOP;

	  CLOSE cursor_products;
	END $$
	DELIMITER ;
        

Conclusion:

To conclude the overview of the stored procedure, we have gone through the basics of store procedure to handle conditional, switch case, loop and even cursor to iterate over a row of a table. To learn more about store procedure visit the below reference links as a starting point. > All the Best. To embark on the journey towards the stored procedure. ? ? ### Happy Coding!

Ready to embark on your digital journey with TechSevin?Contact us to discuss how our Adobe-certified experts can elevate your digital presence.

Ready To Redefine Digital Experience?
No matter your region, our specialists provide tailored strategies
to elevate your digital presence.
Categories
Uncategorized

Technical

Heroku
Deploy a Static Website on Heroku Using Command Line

A) Prerequisites

Heroku installed on your machine:

snap install --classic heroku

Check if Heroku is installed properly:

heroku --version

Note: If you see this warning:

The command could not be located because ‘/snap/bin’ is not included in the PATH environment variable

Run this command for a temporary fix:

export PATH=$PATH:/snap/bin

B) Creating a Project

a) Project Folder:

mkdir your_projectname
cd your_projectname

Create the following files:

  • home.html
  • index.php
  • composer.json

b) Project Contents:

home.html

<!DOCTYPE html>
<html>
<head>
  <title>Heroku Website</title>
</head>
<body>
  <h1>My Website</h1>
  <p>This is a static website deployed on heroku.</p>
</body>
</html>

index.php

<?php include_once("home.html"); ?>

composer.json

{

}

C) Pushing the Project on Heroku

a) Initialize the Project Folder with Git:

git init
git add .
git commit -m "My first commit"

b) Deployment:

heroku create
git remote -v
heroku login
git push heroku master

Once done, a URL will be generated indicating the app is deployed. Open the URL in your browser to see your live app.

Conclusion:

TechSevin’s recognition as an Adobe Solution Partner with 9 certified developers is a significant milestone, but it’s just the beginning. We are excited about the opportunities this partnership brings, and we look forward to continuing to provide innovative and impactful digital solutions for our clients.

Ready to embark on your digital journey with TechSevin?Contact us to discuss how our Adobe-certified experts can elevate your digital presence.

Ready To Redefine Digital Experience?
No matter your region, our specialists provide tailored strategies
to elevate your digital presence.
Categories
Uncategorized

Technical

Technical
7 Bad habbit for developer to avoid!

1. NOT ASKING FOR HELP

It’s OK to ask for help! Asking for help doesn’t show weakness. In fact, sometimes you’ll find the solution just by explaining the problem to someone else. (It’s called rubber duck debugging!)

2. YOU ARE ALWAYS RIGHT!

No one is right 100% of the time. Always consider the possibility of being wrong and try to explore different perspectives and ideas.

3. NOT BEING OPEN TO CONSTRUCTIVE CRITICISM

Acting defensive about your code and knowledge is a major flaw. Don’t take constructive criticism as a personal attack. Use it as a tool to grow and improve.

4. IT CAN’T BE DONE!

There’s nothing worse than a developer saying, “It can’t be done!” Don’t give up too soon. There’s almost always a solution — stay curious and persistent.

5. NO CODING ORGANIZATION WHATSOEVER!

Sloppy code and poor architecture are red flags. Learn the principles of clean code and spend time organizing your work thoughtfully.

6. NOT PLANNING, JUST CODING

There’s an old saying: Weeks of coding can save you hours of planning. Take the time to plan your approach before diving in.

7. NOT HELPING OTHERS

The developer community thrives on sharing and collaboration. Don’t hoard knowledge — help others and grow together.

Hashtags:
#appdeveloper #coderlife #codingdays #codinglife #developerlife #educateyourself #fullstackdeveloper #iosdeveloper #lifeofadeveloper #lovecoding #freelancedeveloper #mobiledevelopment #peoplewhocode #programmer #programmerlife #programmerrepublic #programmerslife #programminglife #softwaredeveloper #100daysofcode #workhardanywhere

Conclusion:

TechSevin’s recognition as an Adobe Solution Partner with 9 certified developers is a significant milestone, but it’s just the beginning. We are excited about the opportunities this partnership brings, and we look forward to continuing to provide innovative and impactful digital solutions for our clients.

Ready to embark on your digital journey with TechSevin?Contact us to discuss how our Adobe-certified experts can elevate your digital presence.

Ready To Redefine Digital Experience?
No matter your region, our specialists provide tailored strategies
to elevate your digital presence.
Categories
Uncategorized

Technical

Technical
Overview of Flutter

Flutter:

Well, today’s technology is rapidly advancing and companies demand to build their applications that are platform independent, i.e, those apps that can run on any operating system.

The current market is running on majority 2 platforms which are Android and iOS. And product based company aims to hire those individuals that can develop an app for both of these platforms.

With this consideration, Google came up with their own cross-platform app development language known as FLUTTER.

Flutter is basically a programming language whose output can be run on Android as well as iOS. Prior to flutter, many languages such as Viu,Xamarin and React Native etc. had been introduced in the market which is still in demand.

So what’s new with Flutter? Let’s check it out.

Base Language

The language used in Flutter is Dart programming language. Dart is developed by Google and is used for development of web server, mobile, and desktop applications. It is free and open source.

Application developed for both Android and iOS.

With Flutter, “Write once and run on Android and iOS” concept is used. You need to program in Dart language and those applications can be run on Android as well as iOS. This reduces development time and resources.

User Interface

As per my experience, Flutter seemed to a bunch of new interfaces which are interactive and gives a better feel to the user’s contact. The designs are too good that gives an attractive look to the mobile apps and improves the user experience. The animations and widgets are well setups for developers to easily integrate into the application.

Native Experience

Flutter has features that users won’t notice any difference whether the app is being developed using their native language or cross-platform language. An example for Android users is that they won’t be able to judge whether the respective app is developed using Android Studio or Flutter.

Rapid Development

Flutter is equipped with one best feature of Hot Reload. Hot Reload means the output is given as soon as there are code changes. Means if you edit some text and click on the Run button, its output will be shown dynamically on the Emulator screen.

While working with React Native, I had to stop the app server, make changes and then restart the server to see the output which was time-consuming.

Due to Hot Reload feature of Flutter, debugging is also made easier and application development consumes less time.

Here is a demo which is originally published on its official website https://flutter.io/

After knowing these amazing features, if you want to get started with Flutter development, then follow their official document. If you are interested in learning Flutter with a free course, I’ll recommend Udacity’s course on Flutter which is co-created by Google itself.

Here is the Udacity’s free course on Flutter.

Flutter is recently released and that is why the community support is moderate but with the recent release of Flutter 1.0, this platform has become stable now and the support can be increased. Google always aim to bring the best for the users and will continue the work on Flutter beyond excellence.

This was just an overview of Flutter. To know more in details you can check out their official website https://flutter.io/

Conclusion:

TechSevin’s recognition as an Adobe Solution Partner with 9 certified developers is a significant milestone, but it’s just the beginning. We are excited about the opportunities this partnership brings, and we look forward to continuing to provide innovative and impactful digital solutions for our clients.

Ready to embark on your digital journey with TechSevin?Contact us to discuss how our Adobe-certified experts can elevate your digital presence.

Ready To Redefine Digital Experience?
No matter your region, our specialists provide tailored strategies
to elevate your digital presence.