Subject Re: {Disarmed} Re: [firebird-support] Replacement of parameters within a stored procedure
Author SoftTech
I cannot do what I need to do on the client side as you suggest. This must be handled on the server using firebird. A trigger is used to call a stored procedure and then inside this stored procedure I need to replace parameters with actual values.

Thanks,
Mike


----- Original Message -----
From: Boguslaw Brandys
To: firebird-support@yahoogroups.com
Sent: Friday, December 14, 2012 11:18 AM
Subject: {Disarmed} Re: [firebird-support] Replacement of parameters within a stored procedure



W dniu 2012-12-14 17:57, SoftTech pisze:
>
> Firebird v1.5
>
> A SQL statement is stored in a table.
>
> Inside of a stored procedure I need to retrieve this SQL statement,
> replace
> :Param1 and :Param2 with actual values then execute it. I will of course
> know the value, just don't know how to replace the :Param1 and 2 with the
> value.
>
> SELECT DISTINCT 1
> FROM ACCT_CASE
> INNER JOIN DEBT D ON (ACCT_CASE.ACCT_ID=D.ACCT_ID) and
> (ACCT_CASE.CASE_ID=D.CASE_ID)
> INNER JOIN DEBTOR_CASE_DEBT ON (D.ACCT_ID=DEBTOR_CASE_DEBT.ACCT_ID) and
> (D.DEBT_NO=DEBTOR_CASE_DEBT.DEBT_NO) and
> (D.CASE_ID=DEBTOR_CASE_DEBT.CASE_ID)
> INNER JOIN PERSON PD ON (PD.PERSON_ID=DEBTOR_CASE_DEBT.PERSON_ID)
> LEFT OUTER JOIN PER_ADDRESS PDPA ON (PDPA.PERSON_ID=PD.PERSON_ID)
> LEFT OUTER JOIN ADDRESS PDA ON (PDA.ADDR_ID=PDPA.ADDR_ID)
> LEFT OUTER JOIN ZIP_CODE ON (PDA.ZIP_CODE_ID=ZIP_CODE.ZIP_CODE_ID)
> WHERE (ACCT_CASE.ACCT_ID = :Param1 AND
> ACCT_CASE.CASE_ID = :Param2 AND
> PDPA.DEFAULT_ADDRESS = 1 AND
> ZIP_CODE.STATE_CODE = 'AZ')
>
> Can this be done? If so, some guidance would be appreciated.
>
> Thanks,
> Mike
>

Mike

Maybe others have a magic trick for you , but I think your programming
language tool should support the parsing of SQL with replacement of
parameters.

Boguslaw
>
>

[Non-text portions of this message have been removed]




--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

[Non-text portions of this message have been removed]