AssetAccountControl
METADATA
Attribute | Value |
---|---|
Topic | 1630-client-book-risk |
MLink Token | SystemData |
Product | SRControl |
accessType | SELECT,UPDATE,INSERT,DELETE |
Table Definition
Field | Type | Key | Default Value | Comment |
---|---|---|---|---|
accnt | VARCHAR(16) | PRI | '' | |
clientFirm | VARCHAR(16) | PRI | '' | SR client firm |
accountName | TINYTEXT | '' | ||
strategyName | VARCHAR(16) | '' | ||
optStatus | enum - OptStatus | 'Hold' | ||
utilPctTarget | FLOAT | 0 | ||
accntBuyingPower | FLOAT | 0 | ||
modifiedBy | VARCHAR(24) | '' | user who last modified this record | |
modifiedIn | enum - SysEnvironment | 'None' | ||
timestamp | DATETIME(6) | '1900-01-01 00:00:00.000000' | timestamp of last modification |
PRIMARY KEY DEFINITION (Unique)
Field | Sequence |
---|---|
accnt | 1 |
clientFirm | 2 |
CREATE TABLE EXAMPLE QUERY
CREATE TABLE `SRControl`.`MsgAssetAccountControl` (
`accnt` VARCHAR(16) NOT NULL DEFAULT '',
`clientFirm` VARCHAR(16) NOT NULL DEFAULT '' COMMENT 'SR client firm',
`accountName` TINYTEXT NOT NULL DEFAULT '',
`strategyName` VARCHAR(16) NOT NULL DEFAULT '',
`optStatus` ENUM('Hold','TwoWay','BuyOnly','SellOnly','CloseOnly','CloseNow','CloseRisk','BuyCloseOnly','SellCloseOnly') NOT NULL DEFAULT 'Hold',
`utilPctTarget` FLOAT NOT NULL DEFAULT 0,
`accntBuyingPower` FLOAT NOT NULL DEFAULT 0,
`modifiedBy` VARCHAR(24) NOT NULL DEFAULT '' COMMENT 'user who last modified this record',
`modifiedIn` ENUM('None','Neptune','Pluto','V7_Stable','V7_Latest','Saturn','Venus','Mars','SysTest','V7_Current') NOT NULL DEFAULT 'None',
`timestamp` DATETIME(6) NOT NULL DEFAULT '1900-01-01 00:00:00.000000' COMMENT 'timestamp of last modification',
PRIMARY KEY USING HASH (`accnt`,`clientFirm`)
) ENGINE=SRSE DEFAULT CHARSET=LATIN1 COMMENT='';
SELECT TABLE EXAMPLE QUERY
SELECT
`accnt`,
`clientFirm`,
`accountName`,
`strategyName`,
`optStatus`,
`utilPctTarget`,
`accntBuyingPower`,
`timestamp`
FROM `SRControl`.`MsgAssetAccountControl`
WHERE
/* Replace with a VARCHAR(16) */
`accnt` = 'Example_accnt'
AND
/* Replace with a VARCHAR(16) */
`clientFirm` = 'Example_clientFirm';
UPDATE TABLE EXAMPLE QUERY
UPDATE `SRControl`.`MsgAssetAccountControl`
SET
/* Replace with a TINYTEXT */
`accountName` = 'dummy tiny text',
/* Replace with a VARCHAR(16) */
`strategyName` = 'Example_strategyName',
/* Replace with a ENUM('Hold','TwoWay','BuyOnly','SellOnly','CloseOnly','CloseNow','CloseRisk','BuyCloseOnly','SellCloseOnly') */
`optStatus` = 'Hold',
/* Replace with a FLOAT */
`utilPctTarget` = 1.23,
/* Replace with a FLOAT */
`accntBuyingPower` = 1.23,
/* Replace with a DATETIME(6) */
`timestamp` = '2022-01-01 12:34:56.000000'
WHERE
/* Replace with a VARCHAR(16) */
`accnt` = 'Example_accnt'
AND
/* Replace with a VARCHAR(16) */
`clientFirm` = 'Example_clientFirm';
INSERT TABLE EXAMPLE QUERY
INSERT INTO `SRControl`.`MsgAssetAccountControl`(
/* Replace with a VARCHAR(16) */
`accnt`,
/* Replace with a VARCHAR(16) */
`clientFirm`,
/* Replace with a TINYTEXT */
`accountName`,
/* Replace with a VARCHAR(16) */
`strategyName`,
/* Replace with a ENUM('Hold','TwoWay','BuyOnly','SellOnly','CloseOnly','CloseNow','CloseRisk','BuyCloseOnly','SellCloseOnly') */
`optStatus`,
/* Replace with a FLOAT */
`utilPctTarget`,
/* Replace with a FLOAT */
`accntBuyingPower`,
/* Replace with a DATETIME(6) */
`timestamp`
)
VALUES(
'Example_accnt',
'Example_clientFirm',
'dummy tiny text',
'Example_strategyName',
'Hold',
1.23,
1.23,
'2022-01-01 12:34:56.000000'
);
DELETE TABLE EXAMPLE QUERY
DELETE FROM `SRControl`.`MsgAssetAccountControl`
WHERE
/* Replace with a VARCHAR(16) */
`accnt` = 'Example_accnt'
AND
/* Replace with a VARCHAR(16) */
`clientFirm` = 'Example_clientFirm';
Doc Columns Query
SELECT * FROM SRControl.doccolumns WHERE TABLE_NAME='AssetAccountControl' ORDER BY ordinal_position ASC;