Subject | Re: [firebird-support] Can I retreive parameters from a stored procedure? Part 2 |
---|---|
Author | Marsupilami79 |
Post date | 2013-05-07T14:26:45Z |
Hello Mike,
if I remember correctly, the parameters of a stored procedure are also
handeled as system domains. The name of that domain can be found in the
RDB$FIELD_SOURCE column of RDB$PROCEDURE_PARAMETERS. So - with
RDB$FIELD_SOURCE, you can ask RDB$FIELDS for the domain definition:
select RDB$FIELD_NAME, RDB$DEFAULT_SOURCE, RDB$FIELD_SCALE, RDB$FIELD_TYPE,
RDB$FIELD_SUB_TYPE, RDB$FIELD_PRECISION, RDB$CHARACTER_LENGTH,
RDB$NULL_FLAG,
RDB$CHARACTER_SET_ID, RDB$COLLATION_ID
from RDB$FIELDS
where RDB$FIELD_NAME = ?
RDB$FIELD_TYPE will be the type of the field as a number. For a list of
the possible numbers you might want to check the part 2.2 - Column
specifications of this document:
http://www.felix-colibri.com/papers/db/interbase/using_interbase_system_tables/using_interbase_system_tables.html
This document also helped me a great deal in understanding the system
tables as well as Helen Borries Firebird Book.
Best regards,
Jan
Am 03.05.2013 16:29, schrieb Softtech Support:
if I remember correctly, the parameters of a stored procedure are also
handeled as system domains. The name of that domain can be found in the
RDB$FIELD_SOURCE column of RDB$PROCEDURE_PARAMETERS. So - with
RDB$FIELD_SOURCE, you can ask RDB$FIELDS for the domain definition:
select RDB$FIELD_NAME, RDB$DEFAULT_SOURCE, RDB$FIELD_SCALE, RDB$FIELD_TYPE,
RDB$FIELD_SUB_TYPE, RDB$FIELD_PRECISION, RDB$CHARACTER_LENGTH,
RDB$NULL_FLAG,
RDB$CHARACTER_SET_ID, RDB$COLLATION_ID
from RDB$FIELDS
where RDB$FIELD_NAME = ?
RDB$FIELD_TYPE will be the type of the field as a number. For a list of
the possible numbers you might want to check the part 2.2 - Column
specifications of this document:
http://www.felix-colibri.com/papers/db/interbase/using_interbase_system_tables/using_interbase_system_tables.html
This document also helped me a great deal in understanding the system
tables as well as Helen Borries Firebird Book.
Best regards,
Jan
Am 03.05.2013 16:29, schrieb Softtech Support:
>[Non-text portions of this message have been removed]
>
> How do I determine what type the parameter is? Is it a date, or a varchar
>
> Any help with this appreciated.
>
> Thanks,
> Mike
>
> I figured it out...
>
> SELECT P.RDB$PARAMETER_NUMBER,
> P.RDB$PARAMETER_NAME
> FROM RDB$PROCEDURE_PARAMETERS P
> WHERE P.RDB$PROCEDURE_NAME = 'SPS_COTM_ACTIVITY_RPT'
> AND P.RDB$PARAMETER_TYPE = 0
> ----- Original Message -----
> From: Softtech Support
> To: Firebird Support
> Sent: Friday, May 03, 2013 8:55 AM
> Subject: Can I retreive parameters from a stored procedure?
>
> Greetings All,
>
> Firebird v1.53
>
> I need to programatically (Using Delphi) retreive the input parameters
> from a stored procedure. Is this possible?
>
> Thanks,
> Mike
>
> [Non-text portions of this message have been removed]
>
>