Data Structures | |
struct | CDB_API_PARAMS |
Input/Output table for the PL/SQL API. More... | |
Functions | |
fwConfigurationDB | getDevicesInRecipe (VARCHAR2 recipeName, VARCHAR2 deviceFilter=null, DATE validAt=NULL) |
fwConfigurationDB | getDevicesInConfiguration (VARCHAR2 configurationName, VARCHAR2 deviceFilter=null) |
fwConfigurationDB | getRecipe2 (VARCHAR2 recipeName, DATE validAt=0, NUMBER dataIntoClob=1) |
fwConfigurationDB | getRecipe (VARCHAR2 recipeName, DATE validAt=0) |
fwConfigurationDB | getRecipesList (VARCHAR2 recipeNameFilter=null, VARCHAR2 deviceFilter=null, VARCHAR2 recipeCommentFilter='*', VARCHAR2 recipeTypeFilter='*') |
fwConfigurationDB | getConfigurationsList (VARCHAR2 configurationNameFilter=null) |
fwConfigurationDB | createRecipe (VARCHAR2 recipeName, VARCHAR2 recipeDescription=null) |
fwConfigurationDB | storeRecipe (VARCHAR2 recipeName, VARCHAR2 versionDescription=null, VARCHAR2 userCreated=null) |
fwConfigurationDB | getReferences (VARCHAR2 configurationName, DATE validAt=null) |
fwConfigurationDB | setReferences (VARCHAR2 configurationName) |
fwConfigurationDB | getReferenceHistory (VARCHAR2 configurationName, DATE startDate=null, DATE endDate=null) |
int fwConfigurationDB | checkInputTable (NUMBER checkS2=1) |
fwConfigurationDB | t_getSequenceNumbers (VARCHAR2 sequenceName, NUMBER n=1) |
fwConfigurationDB getDevicesInRecipe | ( | VARCHAR2 | recipeName, | |
VARCHAR2 | deviceFilter = null , |
|||
DATE | validAt = NULL | |||
) |
Finds devices for which configuration data exists in a given recipe
[in] | recipeName | - the name of the recipe which is queried |
[in] | deviceFilter | (optional, default null) specifies device name(s) to be checked; note that '*' and '' may be used as wildcards, and may be placed at any place within the parameter. |
[in] | validAt | (optional, default null) allows to query historical recipes - null signifies "current recipe", otherwise a recipe as it was at the specified date will be checked. |
ORA-20001 | (input data not consistent) see: checkInputTable | |
ORA-20002 | (no such recipe) the recipe specified in recipeName does not exist |
DELETE FROM CDB_API_PARAMS; BEGIN fwConfigurationDB.getDevicesInRecipe('PHYSICS/RUN','MyDetector/ECAL/%');END; SELECT S1 from CDB_API_PARAMS;
fwConfigurationDB getDevicesInConfiguration | ( | VARCHAR2 | configurationName, | |
VARCHAR2 | deviceFilter = null | |||
) |
Returns device names present in given static configuration
The function returns the list of the names of devices which were saved in specified static configuration, and match specified device filter. Note that the previous contents of the CDB_API_PARAMS table will be wiped out.
[in] | configurationName | - the name of the static configuration to be queried |
[in] | deviceFilter | (optional, default null) - allows to filter the devices; null value means no filtering (all devices in the configuration will be returned). Both: % and * may be used as wildcards. |
ORA-20002 | (no such configuration) the static configuration specified in configurationName does not exist |
BEGIN fwConfigurationDB.getDevicesInConfiguration('MySetup','*:CAEN/%');END;
SELECT s1 FROM CDB_API_PARAMS
fwConfigurationDB getRecipe2 | ( | VARCHAR2 | recipeName, | |
DATE | validAt = 0 , |
|||
NUMBER | dataIntoClob = 1 | |||
) |
Gets recipe data
[in] | recipeName | - the name of recipe to query |
[in] | validAt | (optional, default null) - allows to query historical recipes; null means: current recipe, otherwise the recipe as it was at the specified date will be returned |
[in] | dataIntoClob | (optional, default 1); if set to 1, the values will be returned into the C1 column (of CLOB type); otherwise, the values will be stored into the S8 column (of VARCHAR2(4000) type), as in the original implementation; see also the fwConfigurationDB::getRecipe function |
[in,out] | CDB_API_PARAMS[S1] | (optional) may contain the list of devices for which recipe data is queried; note that the original list will be altered: the order of devices may change, and only the devices for which recipe data exist will be present in this column (see below) |
dataIntoClob
param): datapoint element value(s) ("setting") ORA-20001 | (input data not consistent) see: checkInputTable | |
ORA-20002 | (no such recipe) the recipe specified in recipeName does not exist |
DELETE FROM CDB_API_PARAMS;
BEGIN fwConfigurationDB.getRecipe2('PHYSICS/RUN'); END;
-- only print out the data for which values are defined
SELECT S1||S2, C1 FROM CDB_API_PARAMS WHERE I4=1;
DELETE FROM CDB_API_PARAMS;
BEGIN fwConfigurationDB.getRecipe2('PHYSICS/RUN',NULL,0); END;
-- only print out the data for which values are defined
SELECT S1||S2, S8 FROM CDB_API_PARAMS WHERE I4=1;
DELETE FROM CDB_API_PARAMS;
BEGIN fwConfigurationDB.getRecipe2('PHYSICS/RUN', TO_DATE('2007-04-01','YYYY-MM-DD')); END;
SELECT S1||S2, C1 FROM CDB_API_PARAMS WHERE I4=1;
DELETE FROM CDB_API_PARAMS; INSERT INTO CDB_API_PARAMS(S1) VALUES 'MyDetector/ECAL/HV/chn1'; INSERT INTO CDB_API_PARAMS(S1) VALUES 'MyDetector/ECAL/HV/chn2'; BEGIN fwConfigurationDB.getRecipe2('PHYSICS/RUN');END; SELECT * FROM CDB_API_PARAMS;
fwConfigurationDB getRecipe | ( | VARCHAR2 | recipeName, | |
DATE | validAt = 0 | |||
) |
Gets recipe data
Compatibilty function, replaced by the fwConfigurationDB::getRecipe2 . Returns the values in the S8 column, rather than C1 (clob). Internally, it makes use of the fwConfigurationDB::getRecipe2 function
[in] | recipeName | - the name of recipe to query |
[in] | validAt | (optional, default null) - allows to query historical recipes; null means: current recipe, otherwise the recipe as it was at the specified date will be returned |
[in,out] | CDB_API_PARAMS[S1] | (optional) may contain the list of devices for which recipe data is queried; note that the original list will be altered: the order of devices may change, and only the devices for which recipe data exist will be present in this column (see below) |
fwConfigurationDB getRecipesList | ( | VARCHAR2 | recipeNameFilter = null , |
|
VARCHAR2 | deviceFilter = null , |
|||
VARCHAR2 | recipeCommentFilter = '*' , |
|||
VARCHAR2 | recipeTypeFilter = '*' | |||
) |
Get list of recipes or find a recipe
The function returns the list of names of recipes that fulfil certain criteria. By default (with all parameters set to default values) it returns the list of all recipes in the database. Note that the function wipes out the previous content of the CDB_API_PARAMS table.
[in] | recipeNameFilter | (optional, default null) allows to filter on the recipe name; wildcards ('*' or '' characters) are allowed. Specifying null will disable this selection criteria (i.e. all recipes matching the remaining criteria will be returned). |
[in] | deviceFilter | (optional, default null) allows to search for recipe which contain specified device(s). This parameter may contain wildcards ( '*' or '' characters), so that any device matching the specified filter will be approved. Specifying null will disable this selection criteria (i.e. all recipes matching the remaining criteria will be returned). |
[in] | recipeCommentFilter | (optional, default '*') allows to filter on the recipe comment; wildcards ('*' or '' characters) are allowed. |
[in] | recipeTypeFilter | (optional, default '*') allows to filter on the recipe type; wildcards ('*' or '' characters) are allowed. |
BEGIN fwConfigurationDB.getRecipesList('PHYSICS/%','*CAEN*'); END;
SELECT S1 FROM CDB_API_PARAMS;
fwConfigurationDB getConfigurationsList | ( | VARCHAR2 | configurationNameFilter = null |
) |
Get the list of available static configurations
[in] | configurationNameFilter | (optional, default null) allows to filter on configuration names: the '*' and '' wildcards are allowed; null means: get all configuration names |
fwConfigurationDB createRecipe | ( | VARCHAR2 | recipeName, | |
VARCHAR2 | recipeDescription = null | |||
) |
Creates a new recipe with given name and comment
[in] | recipeName | the name for the recipe |
[in] | recipeDescription | (optional, default null) the comment for the recipe |
ORA-20002 | (recipe already exists) the recipe specified in recipeName already exists |
fwConfigurationDB storeRecipe | ( | VARCHAR2 | recipeName, | |
VARCHAR2 | versionDescription = null , |
|||
VARCHAR2 | userCreated = null | |||
) |
Stores a new version of recipe data
[in] | recipeName | - the name of the recipe |
[in] | versionDescription | (optional, default null) text indicating the reason for this new version |
[in] | userCreated | (optional, default null) the name of the user who created this version |
[in,out] | CDB_API_PARAMS | table needs to be filled with recipe data; each row contains settings for one data point element. The data should be placed in the following columns:
|
ORA-20002 | (no such recipe) the recipe specified in recipeName does not exist | |
ORA-20023 | (no such device) a device has not been stored in any of existing static configurations | |
ORA-20024 | (no such device element) a device has no such element |
fwConfigurationDB getReferences | ( | VARCHAR2 | configurationName, | |
DATE | validAt = null | |||
) |
Returns the mapping between devices and aliases
[in] | configurationName | the name of static configuration from which the mapping should be retrieved |
[in] | validAt | (optional, default null) if not null, allows to query historical mapping. The mapping that is returned is the one that was in the Configuration Database at the time specified using this parameter. |
[in,out] | CDB_API_PARAMS[s1] | (optional) may contain the list of aliases for which the mapping is queried; if CDB_API_PARAMS is empty, the mapping for all devices will be returned. Note that the contents of the CDB_API_PARAMS will be altered - you may not assume the order of items, and the presence of all aliases you placed there on input! |
ORA-20001 | (input data not consistent) see: checkInputTable | |
ORA-20005 | (no such configuration) the static configuration specified in configurationName does not exist |
fwConfigurationDB setReferences | ( | VARCHAR2 | configurationName | ) |
Stores a new mapping between devices and aliases
[in] | configurationName | the name of static configuration to which the mapping should be stored |
CDB_API_PARAMS | needs to be filled in with the following information
|
ORA-20005 | (no such configuration) the static configuration specified in configurationName does not exist | |
ORA-20021 | (device list not unique) one or more devices in S2 column does not exist in the static configuration, or it is given more than once, or it is null | |
ORA-20022 | (alias list not unique) one or more aliases in S1 column does not exist in the static configuration, or it is given more than once, or it is null | |
ORA-20023 | (no such alias) an alias does not exist in any of static configurations | |
ORA-20024 | (no such device) a device does not exist in any of static configurations |
fwConfigurationDB getReferenceHistory | ( | VARCHAR2 | configurationName, | |
DATE | startDate = null , |
|||
DATE | endDate = null | |||
) |
Returns the history of mappings for given aliases
[in] | configurationName | - the name of static configuration to be queried |
[in] | startDate | (optional, default null) the start of the period to query; null means no start limit: get the history starting from the first available entries |
[in] | endDate | (optional, default null) the end of the period to query; null means no end limit: get the history up to the current mapping |
[in] | CDB_API_PARAMS[S1] | (optional) may contain the aliases for which the mapping is being queried; if the table is empty, the mapping for all aliases will be queried (carefully! this may be a lot of data!) |
DELETE FROM CDB_API_PARAMS; INSERT INTO CDB_API_PARAMS(s1) VALUES 'MyDetector/ECAL/chn1'; INSERT INTO CDB_API_PARAMS(s1) VALUES 'MyDetector/ECAL/chn2'; BEGIN fwConfigurationDB.getReferenceHistory('MySetup', TO_DATE('2007-04-01','YYYY-MM-DD'), TO_DATE('2007-04-30','YYYY-MM-DD') ); END; SELECT S1 Alias, S2 Device , D1 Since, D2 Till from CDB_API_PARAMS;
|---------------------|------------------------------|-----------|------------| | Alias | Device | Since | Till | |---------------------|------------------------------|-----------|------------| |MyDetector/ECAL/chn1 |dist_1:CAEN/crate1/bd00/chn00 |2006-10-12 | 2007-04-05 | |MyDetector/ECAL/chn1 |dist_1:CAEN/crate1/bd10/chn05 |2007-04-05 | 2007-04-10 | |MyDetector/ECAL/chn1 |dist_1:CAEN/crate1/bd00/chn00 |2007-04-10 | NULL | |MyDetector/ECAL/chn2 |dist_1:CAEN/crate1/bd00/chn01 |2007-04-03 | 2007-04-05 | |MyDetector/ECAL/chn2 |dist_1:CAEN/crate2/bd12/chn02 |2007-04-10 | 2007-06-20 | |---------------------|------------------------------|-----------|------------|
endDate
set to end of April; one would need to specify null as the endDate
to see the history past the end of April.int fwConfigurationDB checkInputTable | ( | NUMBER | checkS2 = 1 |
) |
Checks the consistency of the data in the CDB_API_PARAMS table
SCOPE OF USE: Internal
The function checks if all columns (except S1, and - depending on checkS2
parameter - also S2) in the CDB_API_PARAMS are empty. This is to make sure that the user did not forget to clean up the CDB_API_PARAMS table after the previous use. This function is called internally by most of the function in the package. The function also returns the number of rows in the CDB_API_PARAMS, i.e. the number of input records.
checkS2 | (default 1) determines if the S2 column should be checked. Passing NULL will result in S2 not being checked (i.e. signifies that S2 contain valid data). |
ORA-20001 | (fwConfigurationDB: Input table CDB_API_PARAM not consistent. Forgot to TRUNC it before use?) is reported if the data is not consistent (i.e. the table contains the data which is not acceptable as input to the procedure - S1 or/and S2 columns are not empty) |
fwConfigurationDB t_getSequenceNumbers | ( | VARCHAR2 | sequenceName, | |
NUMBER | n = 1 | |||
) |
Draws a set of numbers from named sequence
The function draws a set of n
numbers from sequence called sequenceName
.
SCOPE OF USE: Internal
[in] | sequenceName | the name of sequence |
[in] | n | the number of sequence numbers to draw (default: one) |
I1
of table CDB_API_PARAMS
;