Preview random rows of CSV data in place from external object store using a foreign table.
The examples use a sample river flow data set. To use your own data, replace the table and column names, and authorization object. See Variable Substitutions for Examples for the credentials and location values for the sample data set.
- To run NOS-related commands, log on to the database as a user with the required privileges.
- If it does not exist, create the foreign table or ask your database administrator to create the foreign table called riverflow_csv. See Setting Up to Run CSV Examples.
- To see sample records with the attribute names included before each string of values, issue the following command against the foreign table called riverflow_csv:
SELECT TOP 2 * FROM riverflow_csv;
Your results will be similar to the following:
Location /S3/s3.amazonaws.com/td-usgs-public/CSVDATA/09400815/2018/07/10.csv GageHeight2 ? Flow .00 site_no 9400815 datetime 2018-07-10 00:00 Precipitation .00 GageHeight -.01 Location /S3/s3.amazonaws.com/td-usgs-public/CSVDATA/09400815/2018/07/12.csv GageHeight2 ? Flow .00 site_no 9400815 datetime 2018-07-12 00:00 Precipitation .00 GageHeight -.01
The output is displayed vertically for readability.