Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

To show the currently configured connection information for the sources in the Longview adapter, run the following query on the configuration database:

QUERY 1

Code Block
languagesql
select  s.Name, 
        Type = CASE 
             WHEN s.Type =  1 THEN 'Longview Close'
             WHEN s.Type =  2 THEN 'Longview Tax'
             ELSE 'Unknown'
        END,
        sc.Url,
        sc.UserName,
        sc.Password,
        sc.ListenerPort,
        sc.Access, 
        sc.UserGroup,
        sc.InstanceId
from    Source s
join    LVSourceConfiguration sc on sc.SourceId = s.Id

...

To update the connection fields, run the following query with the correct values and source name. When certain values do not need to be replaced, remove the particular lines from the query.

QUERY 2

Code Block
languagesql
update  sc
set     sc.Url = '...',
        sc.UserName = '...',
        sc.Password = '...',
        sc.ListenerPort = 0,
        sc.Access = '...',
        sc.UserGroup = '...',
        sc.InstanceId = '...'
from    LVSourceConfiguration sc
join    Source s on sc.SourceId = s.Id
where   s.Name = 'SOURCE NAME HERE'

...

Code Block
languagesql
update  sc
set     sc.Url = 'https://example-url-to-longview-source.com',
        sc.UserName = 'Administrator',
        sc.Password = 'secret_password'
from    LVSourceConfiguration sc
join    Source s on sc.SourceId = s.Id
where   s.Name = 'MyLongviewSource'

Showing Dimension Configuration for a Source

To show the currently configured dimension mappings for a given source, run the following query with the correct source name:

QUERY 3

Code Block
languagesql
select  dm.LVSourceConfigurationId, 
        dm.CxoDimension, 
        dm.LVDimensionName 
from    Source s
join    LVSourceConfiguration sc on sc.SourceId = s.Id
join    DimensionMapping dm on dm.LVSourceConfigurationId = sc.Id
where   s.Name = 'SOURCE NAME HERE'

This shows which Longview dimension is mapped to which CXO dimension. If the LVDimensionName column has a NULL value, nothing is mapped to this CXO dimension.

For each Longview dimension we also have to configure:To update a dimension mapping for a given source

  • The symbol names to extract

  • The symbol attributes to extract

  • The description of the Longview dimension

To show the currently configured values for these fields run the following query:

QUERY 4

Code Block
languagesql
select  dec.LVSourceConfigurationId, 
        dec.DimensionName,
        dec.DimensionDescription,
        dec.SymbolNames, 
        dec.SymbolAttributes        
from    Source s
join    LVSourceConfiguration sc on sc.SourceId = s.Id
join    LVDimensionsExtractionConfiguration dec on dec.LVSourceConfigurationId = sc.Id
where   s.Name = 'SOURCE NAME HERE'

Updating Dimension Configuration for a Source

For updating dimension configuration of a Longview source we identify the following scenarios:

  1. Create a new dimension mapping from a Longview dimension to a CXO dimension

  2. Remove an existing dimension mapping from a Longview dimension to a CXO dimension

  3. Update symbol names, symbol attributes and/or dimension description for a mapped Longview dimension.

NOTE: if you want to map a Longview dimension mapping to a CXO dimension that already has a Longview dimension mapped to it, first remove the existing mapping before adding the new mapping.

Create a Dimension Mapping

To create a new dimension mapping from a Longview dimension to a CXO dimension, run the following query with correct values for LVSourceConfigurationId and CxoDimension (you get these from running the select query aboveQUERY 3) plus the name of the LV Dimension you want to map.

QUERY 5

Code Block
languagesql
update  DimensionMapping
set     LVDimensionName = '...'
where   LVSourceConfigurationIddeclare @lv_dimension_name varchar(255) = 'LV DIMENSION NAME HERE';
declare @lv_source_configuration_id uniqueidentifier = 'LV SOURCE CONFIGURATION ID HERE';
declare @cxo_dimension varchar(50) = 'CXO DIMENSION HERE';

update	DimensionMapping
set		LVDimensionName = @lv_dimension_name
where	LVSourceConfigurationId = @lv_source_configuration_id
and		CxoDimension = @cxo_dimension

insert into LVDimensionsExtractionConfiguration (
    Id, DimensionName, LVSourceConfigurationId, SymbolNames, 
    DimensionDescription, SymbolAttributes)
values (newid(), @lv_dimension_name, @lv_source_configuration_id, '', '', '')

After running this query, there will be no symbol names, symbol attributes or dimension description configured yet. Proceed to update these by following Scenario 3: Update Symbol Names, Symbol Attributes and Dimension Description

Remove a Dimension Mapping

To remove a dimension mapping from a Longview dimension to a CXO dimension, run the following query with correct values for LVSourceConfigurationId and CxoDimension (you get these from running QUERY 3).

Code Block
languagesql
declare @lv_source_configuration_id uniqueidentifier = 'LV SOURCE CONFIGURATION ID HERE';
declare @cxo_dimension varchar(50) = 'CXO DIMENSION HERE';
declare @lv_dimension_name varchar(255) = (
    select LVDimensionName 
    from DimensionMapping 
    where LVSourceConfigurationId = @lv_source_configuration_id 
    and CxoDimension = @cxo_dimension
);

update  DimensionMapping
set     LVDimensionName = NULL
where   LVSourceConfigurationId = @lv_source_configuration_id
and     CxoDimension = 'CXO DIMENSION HERE' @cxo_dimension

delete from LVDimensionsExtractionConfiguration
where   LVSourceConfigurationId = @lv_source_configuration_id 
and     DimensionName = @lv_dimension_name

Update Symbol Names, Symbol Attributes and Dimension Description