page251
338
Client
Clients are the consumers of curated data products; in real-world use, you may find
clients are mastered elsewhere and then fed along with entitlements into the data model.
Clients are the entry point to your model and later in this section will be used to drive the
generation of bespoke content.
First set your execution context.
SET tpc_owner_role = 'tpc_owner_role';
SET tpc_database = 'tpc';
SET tpc_owner_schema = 'tpc.tpc_owner';
SET tpc_warehouse_XS = 'tpc_wh_xsmall';
/* Set execution context */
USE ROLE IDENTIFIER ( $tpc_owner_role );
USE DATABASE IDENTIFIER ( $tpc_database );
USE SCHEMA IDENTIFIER ( $tpc_owner_schema );
USE WAREHOUSE IDENTIFIER ( $tpc_warehouse_xs );
Then create a table called
client
along with sequence
seq_client_id
to generate
surrogate keys.
CREATE OR REPLACE TABLE client
(
client_id NUMBER PRIMARY KEY,
name VARCHAR(255),
account VARCHAR(255)
);
CREATE OR REPLACE SEQUENCE seq_client_id START WITH 100000;
Now create your first client and extend the clients to suit your needs.
INSERT INTO client VALUES
( seq_client_id.NEXTVAL, 'POC', 'Proof of Concept Client' );
Chapter 9
Client expeCtations