invantive documentationpart of invantive cloud
Invantive Support ForumsLog In / Sign Up

HTML Table (htmlTable)

Purpose

Data lossy stored in HTML format can be interpreted as a data source using the htmltable keyword.

The expression specifies a master path within the context of which the rows are evaluated using the column specifications.

The passing option specifies the source of the data in HTML format. The source is often the outcome of a read_file() table function or a URL download using httpdownload(). Full adherence to the HTML format is not required; the parser often automatically corrects many HTML format errors.

The columns are specified using their path relative to the master path.

--
-- Retrieve all anchors from a webpage.
--
select htable.*
from   httpdownload@datadictionary('https://www.invantive.com') dld
join   htmltable
( '//a'
passing dld.content_clob
columns href  varchar2 path '@href'
,       rel   varchar2 path '@rel'
,       title varchar2 path '@title'
)
htable

Syntax

%%{init: {
  'theme': 'base',
  'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' },
  'themeVariables': {
    'fontSize': '11px',
    'fontFamily': 'Arial'
  }
}}%%
flowchart TD
    htmlTableSpec_start((START))
    htmlTableSpec_start --> htmlTableSpec_0_0[HTMLTABLE]:::quoted
    htmlTableSpec_0_0 --> htmlTableSpec_0_1["("]:::quoted
    htmlTableSpec_0_1 --> htmlTableSpec_0_2[htmlTableExpression]
    htmlTableSpec_0_2 --> htmlTableSpec_0_3[htmlTablePassing]
    htmlTableSpec_0_3 --> htmlTableSpec_0_4[htmlTableLiteral]
    htmlTableSpec_0_4 --> htmlTableSpec_0_5[htmlTableColumns]
    htmlTableSpec_0_5 --> htmlTableSpec_0_6[")"]:::quoted
    htmlTableSpec_0_6 --> htmlTableSpec_end((END))

htmlTableLiteral

%%{init: {
  'theme': 'base',
  'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' },
  'themeVariables': {
    'fontSize': '11px',
    'fontFamily': 'Arial'
  }
}}%%
flowchart LR
    htmlTableLiteral_start((START))
    htmlTableLiteral_start --> htmlTableLiteral_0_0[LITERAL]:::quoted
    htmlTableLiteral_0_0 --> htmlTableLiteral_0_1[<a href="Invantive UniversalSQL/Grammar/Expression" class="internal-link">expression</a>]
    htmlTableLiteral_0_1 --> htmlTableLiteral_end((END))

htmlTablePassing

%%{init: {
  'theme': 'base',
  'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' },
  'themeVariables': {
    'fontSize': '11px',
    'fontFamily': 'Arial'
  }
}}%%
flowchart LR
    Start((START)) --> htmlTablePassing
    htmlTablePassing -->| | passingSourceOrPathExpression
    passingSourceOrPathExpression --> End((END))

htmlTableExpression

%%{init: {
  'theme': 'base',
  'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' },
  'themeVariables': {
    'fontSize': '11px',
    'fontFamily': 'Arial'
  }
}}%%
flowchart LR
    Start((START)) --> htmlTableExpression
    htmlTableExpression -->| | stringConstant
    stringConstant --> End((END))

htmlTableColumns

%%{init: {
  'theme': 'base',
  'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' },
  'themeVariables': {
    'fontSize': '11px',
    'fontFamily': 'Arial'
  }
}}%%
flowchart TD
    htmlTableColumns_start((START))
    htmlTableColumns_start --> htmlTableColumns_0_0["COLUMNS"]:::quoted
    htmlTableColumns_0_0 --> htmlTableColumns_0_1[htmlTableColumnSpec]
    htmlTableColumns_0_1 --> htmlTableColumns_0_2[","]:::quoted
    htmlTableColumns_0_2 --> htmlTableColumns_0_3[htmlTableColumnSpec]
    htmlTableColumns_0_3 --> htmlTableColumns_end((END))

Purpose

A list of HTML table column specifications.

htmlTableColumnSpec

%%{init: {
  'theme': 'base',
  'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' },
  'themeVariables': {
    'fontSize': '11px',
    'fontFamily': 'Arial'
  }
}}%%
flowchart TD
    htmlTableColumnSpec_start((START))
    htmlTableColumnSpec_start --> htmlTableColumnSpec_0_0[<a href="Invantive UniversalSQL/Grammar/Identifier" class="internal-link">identifier</a>]
    htmlTableColumnSpec_0_0 --> htmlTableColumnSpec_0_1[sqlDataTypeExtended]
    htmlTableColumnSpec_0_1 --> htmlTableColumnSpec_0_2[PATH]:::quoted
    htmlTableColumnSpec_0_2 --> htmlTableColumnSpec_0_3[stringConstant]
    htmlTableColumnSpec_0_3 --> htmlTableColumnSpec_end((END))

Purpose

Each HTML table column is mapped to a data source column using the path relative to the master path.