Table A has Field 1 as a reference, & Field 2 as a VALUE.
Table B has the same Field 1 reference, with a "Link Reference" in Field 2.
I need to write a Stored Procedure which accepts Field 1 as a run-time variable, and returns the total VALUE, including all linked accounts.
ie Field 1 Field 2
TABLE A 12 20
13 30
14 40
TABLE B 12 13
12 14
The Stored Procedure would be run with "12" as a variable, &
would return an answer of 90 (20 + 30 + 40).
This is probably dead-easy, but I am new to this game !
I would prefer not to use a VIEW.
We use SYBASE.
Please help !
+
Table B has the same Field 1 reference, with a "Link Reference" in Field 2.
I need to write a Stored Procedure which accepts Field 1 as a run-time variable, and returns the total VALUE, including all linked accounts.
ie Field 1 Field 2
TABLE A 12 20
13 30
14 40
TABLE B 12 13
12 14
The Stored Procedure would be run with "12" as a variable, &
would return an answer of 90 (20 + 30 + 40).
This is probably dead-easy, but I am new to this game !
I would prefer not to use a VIEW.
We use SYBASE.
Please help !
+