The SQL Language block enables you to create a dataset using the SQL language SELECT statements in a Workflow.
The following demonstrates now to use the SQL Language block to select the variables Title and In_Stock from the input dataset lib_books.csv (which contains observations that describe a range of books available from a lending library) and output them to a new dataset.
- Import the lib_books.csv dataset into a Workflow using the Text File Import block.
- Expand the Code Blocks group in the Workflow palette, then click and drag an SQL Language block onto the Workflow canvas.
- Click the Output port of the lib_books dataset block and drag a connection towards the Input port of the SQL Language block.
- Double-click on the SQL Language block to display the SQL Language Editor view.
- In the SQL Language Editor view enter the following:
SELECT Title, In_Stock FROM "Working Dataset";
- Close the SQL Language Editor view and save the configuration when prompted.
A green execution status is displayed in the Output ports of the SQL Language block and the new Working Dataset. The dataset contains the title of all books in the library collection and whether those books are available for loan.