I need to read the stored procedures parameters type in Firebird database.
I m able to read their name, if they are input or output parameters, but where can I get their type? Or how do you solve this?
I need to read the stored procedures parameters type in Firebird database.
I m able to read their name, if they are input or output parameters, but where can I get their type? Or how do you solve this?
You need to use the combination of the RDB$PROCEDURE_PARAMETERS
and RDB$FIELDS
views, as shown below:
SELECT rdb$procedure_name, rdb$procedure_parameters.rdb$parameter_name,
rdb$fields.rdb$field_name, rdb$fields.rdb$field_type
FROM rdb$procedure_parameters, rdb$fields
WHERE rdb$fields.rdb$field_name = rdb$procedure_parameters.rdb$field_source
The field type values in RDB$FIELDS are defined as follows:
BLOB - 261 CHAR - 14 CSTRING - 40 D_FLOAT - 11 DOUBLE - 27 FLOAT - 10 INT64 - 16 INTEGER - 8 QUAD - 9 SMALLINT - 7 DATE - 12 TIME - 13 TIMESTAMP - 35 VARCHAR - 37
See the Interbase Language Reference for more info on these type definitions.
SELECT rdb$procedure_name,
rdb$procedure_parameters.rdb$parameter_name,
rdb$fields.rdb$field_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
folks. When i belived i was a genius and that metadata was my intelectual property, i developed a procedure in firebird to track changes on a single table, something with id´s and time stamps. So, i´...
I need to read the stored procedures parameters type in Firebird database. I m able to read their name, if they are input or output parameters, but where can I get their type? Or how do you solve ...
I have a queer problem. I was working on a project with firebird 1.5.6 .NET provider and Visual Studio 2005. Everything worked fine. Then I converted the project to a VS2008 project. Now I have the ...
I am extending the data layer of an existing application to work with Firebird 2.5, in addition to MSSQL and SQLite, but I have hit a stumbling block. I have a field called TimeStamp which stores ...
I have recently upgraded from Apache 1.26 and PHP 4.3 to 2.2.11 and 5.2.9 respectively. With my original setup I had a scheduled task set to run every Sunday for a weekly newsletter. It would connect ...
I m migrating from SQL Server to Firebird. In SQL Server CREATE PROCEDURE Departments_GetAll AS SELECT * FROM Departments I try in Firebird CREATE PROCEDURE DEPARTMENTS_DELETEALL AS BEGIN ...
I m looking at porting an Interbase 6 / Delphi 7 application to embedded Firebird in Delphi 2007. One of the problems we have is getting our users (often quite an unskilled bunch, really - though I ...
I want to use parameter for query like this : SELECT * FROM MATABLE WHERE MT_ID IN (368134, 181956) so I think about this SELECT * FROM MATABLE WHERE MT_ID IN (:MYPARAM) but it doesn t work... ...