Quickupdate

  • Home
  • Top Trending
    • Top Android Apps
    • Top Ios Apps
  • Featured
  • About Us
  • Contact us
  • Privacy Policy and Disclaimer

Saturday, 21 January 2023

Parameters in the MySQL Stored Procedures.

 Developers     January 21, 2023     SQL     No comments   

# In this tutorial you will about the parameters in the MySQL Stored Procedures.

1. With the parameters you can make the stored procedure more useful & reuseable.

2. There are 3 mods of parameters
IN, OUT, INOUT

I will explain these 3 mods in detail in this video so be with me.

1. IN Parameters.
1. IN is the default mode.
2. When you you define IN parameter in the stored procedure, while calling the SP you have to pass the parameter else you will get an error. like this "Error Code: 1318. Incorrect number of arguments for PROCEDURE classicmodels.GetOfficeByCountry; expected 1, got 0"

3. IN parameter is protected. it means even when you change the value of IN parameter inside the SP, its og value is unchanged after SP ends.

2. OUT parameters.
1. VALUE of the OUT parameter can be changed in the SP. & its new value will be returned to where it has been called.

2. Stored Procedure cannot access the initial value of OUT parameter when it starts.

3. OUT is basically same as return statement as JS. look at the following example.
```
DELIMITER $$

CREATE PROCEDURE GetOrderCountByStatus (
IN orderStatus VARCHAR(25),
OUT total INT
)
BEGIN
SELECT COUNT(orderNumber)
INTO total
FROM orders
WHERE status = orderStatus;
END$$

DELIMITER ;
```
4. if you see above example we are using OUT parameter & we are setting count of the "total" orders based on the status passed & then returning total to the location where the SP is called.

You can call above stored procedure like this.

CALL GetOrderCountByStatus('in process',@total);
SELECT @total AS total_in_process;


3. INOUT Parameter.
```
DELIMITER $$

CREATE PROCEDURE SetCounter(
INOUT counter INT,
IN inc INT
)
BEGIN
SET counter = counter + inc;
END$$

DELIMITER ;

```

If you see above example we are accepting 2 parameters 1st if of INOUT mode & 2nd is of IN mode. in order to get any value back from the sp you have to use the OUT or INOUT parameter.


# IMP TO Note.
1. You cannot hold returned VALUE of SP like this.

SET @totalCountOfUsers = 0;
SET @totalCountOfUsers = CALL SP_GET_ALL_USERS();

assigning like this is not allowed in Stored procedures. that's why you have to use OUT OR INOUT mode.

2. IN the SP you cannot assign VALUE to incoming parameters of any mode.

CREATE PROCEDURE `SP_GET_ALL_USERS`(INOUT total INT)
BEGIN
total = 5;
END

Error: This will give you an error of Invalid syntax. please check your mysql syntax.

3. Now you will get question like how i can assign the new value to incoming parameter. you should use "SELECT INTO" syntax to assign value to incoming params.

Query:- "SELECT COUNT(orderNumber) INTO total FROM orders";

This is equal to "total = :anyNumber"
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Sunday, 30 January 2022

Things to keep in mind while starting new project. || This is For Developers ||

 Developers     January 30, 2022     Project Management     No comments   

  1. Be clear with requirements.

  2. get reference websites from the client

  3. Be very clear with the end of requirements. (How your website will look & how it will function at last.)

  4. Start with creating masters of the website, because they are the base of the project. masters like (Country, State, City), etc. (Masters according to projects)

  5. Masters are the base of the website. Be careful, clear with your masters.

  6. Developers must have meetings with clients at least once a week.

  7. Developer should not worry about the cost of the project  & should ask Any questions about the project, features, no of expected users, High-end features (even if the client is not paying that much. dev should not worry about that. developers should worry about code, scalability)

  8. Ask client / Project manager if you want this feature, that features, roles and permission, delete options, etc.


  9. While understanding the requirements always go with real-life scenarios. (Like SRK, Salma, Amir Khan).

  10. Get Project Documentation from Manger / Co-ordinator OR form the responsible person

Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Wednesday, 17 November 2021

How to introduce yourself?

 Developers     November 17, 2021     No comments   

Introduce yourself
Q. Interviewer Question: Do i want to hire this person? Give reasons why interviewer should hire you?

    ---> Your name, Tech Stack you have worked on
    ---> Don't add clg name, place
    ---> YOu can add your frameworks
    ---> Avoid grammatical error
    ---> Add your load at very top.
    ---> Be very specific to the roles you are interviewing
    ---> Mentioned Few hobbies
    ---> Add things which can add value, so interview can talk to you more
    ---> Make your intro more intresting!
    ---> Add background if related
    ---> Try for 1 Mark Answer!
    ---> Also talk outside of tech at the end of intro. people want to work with          intresting people.

    Q.) How to showcase project? ( 19 Nov 2021 )
    1) Make a story on your project as well.     2) MVP     3) Can you explain your project in 30-40 sec. ( Showcase basic idea. )     4) Give Contetx About project     5) Login / Register basic Crud is present (add/edit/property) present     6) Show how the added property Looks like     7) Describe about map.     8) At last talk about your stack! talk imp
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Saturday, 13 November 2021

How to host website on AWS

 Developers     November 13, 2021     No comments   

Launch an Instance

Choose Amazon Machine Image (AMI)

Choose EC2 Instance Types (General Purpose t2)

Configure Security Groups (Security Groups are like firewalls that define what
type of traffic we want to allow.)

Add InBound rules.

Review Instances

Click on Download Key Pair to download key pair and keep it safe.

After a successful launch of instance, you will be taken to the Instance screen.

When the status of Server change from pending to running, you can SSH into
your Server to perform access.

SSH into our machine and install the webserver.

Check your public address from instance details or assign an elastic IP.

you will get a .pem (Privacy Enhanced Maifile )

connect with ssh from a terminal

Now install apache on AWS & database

Install Nodejs ( node -v )

Install MongoDB

Install Pm2

Install Git

Host React JS App or other

After everything is installed Connect with Gitlab
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Wednesday, 3 November 2021

DSA With JavaScript resources

 Developers     November 03, 2021     No comments   

  1. ( Paid 455 ) https://www.udemy.com/course/js-algorithms-and-data-structures-masterclass/ 

  2. (FreeCodeCamp : ) https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/

  3. 30 Seconds:- https://www.30secondsofcode.org/js/t/algorithm/p/1

Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Sunday, 17 October 2021

What is Redux? Why use Redux? When use Redux?

 Developers     October 17, 2021     No comments   

Why use Redux?

  1.  Redux helps us to avoid the problem of prop drilling!
  2. Instead of asking data to parent components, you can directly get that from the store.
  3. Create Big apps with Redux if your app shares a lot of data between components you should use Redux.
  4. Store, Reducers, Actions, Constants
  5. Data can be separated using `Multiple reducers` & will be stored in a single Store.
  6. in Index.js import Provider & Store. And then Wrap <App /> component with Provider.

Redux Devtools Extension.
  1. To view states in our dev tools. you can see state movements. 
  2. you have to add/connect your app redux dev tools extension.
  3. const store = createStore(rootReducer, composeWithDevTools());

Add to Cart Example:

  1.  What is Action: Send data from React to Store. if you click on the `Add to cart` button data will be shown to the cart.
  2.  Reducer:  Gets data from action & pushes data to store. check for the action & push data accordingly!
  3. container: 
  4. Connect React with Redux: (mapStateToProps & mapDispatchToProps)
    1. Shopping Types
    2. Shopping Actions
    3. Shopping Reducers
  5. Get to know about Connect function in Redux.

Amazed:
  1. By just adding `+`  before `action.payload.qty` type `string` value has been converted to type `number`

console.log("action.payload.qty ===> ", action.payload, " type ===>", typeof +action.payload.qty)




Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Friday, 15 October 2021

Hoisting In JavaScript

 Developers     October 15, 2021     No comments   

  1. Before saying anything checkout the below example.

    var x = 8;

    function getName(){
        console.log('My name in Rahul More');
    }
    getName();
    console.log(x)

  2. What do you think is the output of the above code?



    Yes, you guess that right. you will get output as you guessed it right.
  3. But here is a trick. what if we do something like this?

    getName();
    console.log(x)

    var x = 8;

    function getName(){
        console.log('My name in Rahul More');
    }


  4. Now can you guess what the will be the output?


    It's running Function getName but we got `undefined` for x
  5. But if we remove `x = 8` from we will get an error that `x is not defined`.

Undefined Vs Not Defined


  1. Accessing variables & functions before declaring is known as Hoisting in JS.
  2. the function is working as it is even if we moved that at TOP but Variable is not working properly.
  3. Even before executing the code memory got allocated for variables, functions for other things.



Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg
Older Posts Home

Popular Posts

  • How to upload the existing folder on GitHub Or GitLab?
    These are the steps to upload the existing folder on GitHub Or GitLab. Whenever you want to push your existing folder to git or GitHub you m...

Categories

  • FAANG (2)
  • Javascript (6)
  • Node (1)
  • Project Management (1)
  • React (9)
  • SQL (1)
  • Testing (1)

Blog Archive

  • January 2023 (1)
  • January 2022 (1)
  • November 2021 (3)
  • October 2021 (3)
  • August 2021 (1)
  • July 2021 (7)
  • June 2021 (12)
  • February 2021 (1)
  • January 2021 (1)
  • January 2020 (3)
  • August 2019 (3)