Step 2. Create Stage Objects

Note

In regular use, this step is not required if you are staging data files in the default user or table stage. For information, see Bulk Loading from a Local File System.

Execute CREATE STAGE to create a named internal stage. This step is recommended when you plan to load data files regularly from the same source.

The following examples create internal stages that specify the file formats you created in Step 1. Note that if you specify file format options (or a named file format object) for the stage, it isn’t necessary to later specify the same file format options in the COPY command used to load data from the stage.

Stage for CSV Data Files

The following example creates an internal stage named my_csv_stage. Parameter values that aren’t specified use the default values (DATE_FORMAT = AUTO, COMPRESSION = AUTO, etc.).

CREATE OR REPLACE STAGE my_csv_stage
  FILE_FORMAT = mycsvformat;

Stage for JSON Data Files

The following example creates an internal stage named my_json_stage. Parameter values that aren’t specified use the default values (DATE_FORMAT = AUTO, COMPRESSION = AUTO, etc.).

CREATE OR REPLACE STAGE my_json_stage
  FILE_FORMAT = myjsonformat;

Next: Step 3. Stage the Data Files