Stored Procedures In Snwflake In Hindi | Snwflake Stored Procedures Example
Time Travel In Snowflake In Hindi | Snowflake Time Travel Example
Tasks In Snowflake | What is Task In Snowflake
aws s3 kya hai ? | what is aws s3
Web developer roadmap : How to become web developer ? web development kya hai ?
PHP Form validation | Validate User Input Data In PHP In Hindi
Laravel echo, socket io and redis with example : Laravel socket io with redis
CPU Cores In Hindi | CPU Cores kya hai ?
grep Command in Linux : What is grep Command ?
How to Implement RESTful APIs In NodeJS In Hindi | NodeJS RestFul API Example
If tutorials available on this website are helpful for you, please whitelist this website in your ad blocker😭 or Donate to help us ❤️ pay for the web hosting to keep the website running.
Snowflake में "sequence"
एक database object है जो automatic numeric values generate करता है। ये values एक particular order में increment करते हैं।
Sequences commonly primary keys या unique identifiers generate करने के लिए use किये जाते हैं।
●●●
CREATE [ OR REPLACE ] SEQUENCE [ IF NOT EXISTS ] <name> [ WITH ] [ START [ WITH ] [ = ] <initial_value> ] [ INCREMENT [ BY ] [ = ] <sequence_interval> ] [ { ORDER | NOORDER } ] [ COMMENT = '<string_literal>' ]
नीचे दिए गए example में increase_by_one
नाम से जो हर बार 1 से value increase करेगा।
-- create sequence
CREATE OR REPLACE SEQUENCE increase_by_one START = 1 INCREMENT = 1;
-- show all sequences
show sequences;
increase value get करने के लिए sequence की nextval
property होती है जो हर बार incremental value return करेगी।
SELECT increase_by_one.nextval;
output
+---------+ | NEXTVAL | |---------| | 1 | +---------+
Run again
SELECT increase_by_one.nextval;
Output
+---------+ | NEXTVAL | |---------| | 2 | +---------+
increase_by_one.nextval का use करके किसी table के auto increment field में values insert करते time use कर सकते हो।
single query में आप multiple call भी कर सकते हैं।
SELECT increase_by_one.nextval a, increase_by_one.nextval b, increase_by_one.nextval c;
output
+----+----+----+ | a | b | c | +----+----+----+ | 3 | 4 | 5 | +----+----+----+
●●●
किसी existing sequence को modify करने के लिए ALTER SEQUENCE
statement का use किया जाता है।
Syntax
ALTER SEQUENCE [ IF EXISTS ] <name> RENAME TO <new_name> ALTER SEQUENCE [ IF EXISTS ] <name> [ SET ] [ INCREMENT [ BY ] [ = ] <sequence_interval> ] ALTER SEQUENCE [ IF EXISTS ] <name> SET [ { ORDER | NOORDER } ] [ COMMENT = '<string_literal>' ]
ALTER SEQUENCE increase_by_one RENAME TO increaseByOne;
●●●
किसी existing sequence को modify करने के लिए DROP SEQUENCE
statement का use किया जाता है।
Syntax
DROP SEQUENCE [ IF EXISTS ] <name> [ CASCADE | RESTRICT ]
Example
DROP SEQUENCE IF EXISTS increaseByOne;
I Hope , आपको Snowflake में SEQUENCE
के बारे में अच्छे से समझ आया होगा।
●●●
Loading ...
Hi ! I'm Rahul Kumar Rajput founder of learnhindituts.com. I'm a software developer having more than 4 years of experience. I love to talk about programming as well as writing technical tutorials and blogs that can help to others. I'm here to help you navigate the coding cosmos and turn your ideas into reality, keep coding, keep learning :)
Get connected with me. :) LinkedIn Twitter Instagram Facebook