Oracle Machine Learning allows preformat query output in Notebooks.
Syntax:-
%script
SET SQLFORMAT format_option
Note: – This format is available for the script interpreter and must add prefix %script
1.. ANSICONSOLE format resizes the columns to the width of the data to save space and underlines the columns, instead of separate line of output.
%script
SET SQLFORMAT ANSICONSOLE
2.. CSV format produces standard comma-separated variable output, with string values enclosed in double quotes.
%script
SET SQLFORMAT CSV
3.. HTML format produces the HTML for a responsive table and content of the table changes dynamically to match the search string entered in the text field.
%sql
SET SQLFORMAT HTML
4.. JSON format produces a JSON document containing the definitions od the columns along with the data that it contains.
%script
SET SQLFORMAT JSON
5.. INSERT format produces the INSERT statements that could be used to recreate the rows in a table.
%script
SET SQLFORMAT INSERT
6.. LOADER format produces pipe delimited output with string values enclosed in double quotes and column names are not included in the output.
%script
SET SQLFORMAT LOADER
7.. FIXED is default option and it clears all previous SQLFORMAT settings and returns to the default output.
%script
SET SQLFORMAT FIXED
8.. XML format produces a tag-based XML document and all data is presented as CDATA tags.
%script
SET SQLFORMAT XML
9.. Delimited format allows you to manually define the delimiter string, and the characters that are enclosed in the strings values.
%sql
SQLFORMAT DELIMITED delimiter left_enclosure right_enclosure
10.. Default option clears all previous SQLFORMAT settings and returns to the default output.
%script
SET SQLFORMAT DEFAULT
Note :- Notebook version can be reverted ,delete selected version of your notebook, create new notebook from selected version of your notebook and version of notebook can be created or maintained .
Happy Learning !!!!