Subject | Using system tables in stored procedures |
---|---|
Author | |
Post date | 2019-08-12T21:53:03Z |
Hi All,
I have many stored procedures and I'd like to include the code below in each one for doing parameters comparisons between a ps parameters and another table which contains user input settings for each parameter in a ps. I'd like to know please, if such code below will not reduce performance especially with a FOR SELECT because I heard that cursor reduce performance and for I don't know for system tables. Thanks
The code:
FOR SELECT RDB$PROCEDURE_PARAMETERS.RDB$PARAMETER_NAME, RDB$FIELDS.RDB$FIELD_TYPE,
CASE RDB$FIELDS.RDB$FIELD_TYPE
WHEN 7 THEN 'SMALLINT'
WHEN 8 THEN 'INTEGER'
WHEN 9 THEN 'QUAD'
WHEN 10 THEN 'FLOAT'
WHEN 11 THEN 'D_FLOAT'
WHEN 12 THEN 'DATE'
WHEN 13 THEN 'TIME'
WHEN 14 THEN 'CHAR'
WHEN 16 THEN 'INT64'
WHEN 27 THEN 'DOUBLE'
WHEN 35 THEN 'TIMESTAMP'
WHEN 37 THEN 'VARCHAR'
WHEN 40 THEN 'CSTRING'
WHEN 261 THEN 'BLOB'
END AS FIELD_TYPE
FROM RDB$PROCEDURE_PARAMETERS,
RDB$FIELDS
WHERE RDB$FIELDS.RDB$FIELD_NAME = RDB$PROCEDURE_PARAMETERS.RDB$FIELD_SOURCE AND RDB$PROCEDURE_NAME='EMPLOYE_UI'