Snowflake Data Unloading into Json Format
Pre-Requisites:
Snowflake account details
username
password
account name
Step-1:Create database and schema.
Syntax:
create or replace database DATA_UNLOADING;
USE DATABASE DATA_UNLOADING;
USE SCHEMA PUBLIC
Step-2 :creating table and insert the records into it as shown below:
Syntax:
create or replace table EMPLOYEE(Empid number,empname string,region string,contact string);
insert into employee values (1,'sai','EU','sai@123'),(2,'hiteesh','EU','hiteesh@123'),(3,'rishi','EU','rishi@123'),(4,'jaypal','EU','jaypal@123'),(5,'karthik','EU','karthik@123'),
(6,'easwar','EU','easwar@123'),(7,'yasin','EU','yasin@123'),(8,'bhanu','EU','bhanu@123'),(9,'praneeth','EU','praneeth@123'),(10,'sagar','EU','sagar@123');
Step-3:create a file format, which file format we want to load the data like csv,json ..etc...….....
Syntax:
create or replace file format FILE_FORMAT_JSON
type='JSON';
Step-4:Create a Internal stage
syntax:
create or replace stage my_internal_unload_stage
file_format =FILE_FORMAT_JSON;
Step-5:Retrieve the records by using select statement
Comments
Post a Comment