Subject | Re: [firebird-support] stored procedure issue |
---|---|
Author | Dimitry Sibiryakov |
Post date | 2005-12-13T05:10:40Z |
On 12 Dec 2005 at 17:06, d_dude_2003 wrote:
one record, so your check for EXISTS is completely pointless.
HRM_GRADE
ON hrm_applicationsubject.gradeid = HRM_GRADE.ID
WHERE hrm_applicationsubject.applicationid = :applicationid
INTO :subjectpoints;
IF(subjectpoints IS NULL) THEN
subjectpoints = 0;
--
SY, Dimitry Sibiryakov.
>if there are no detail records in HRM_APPLICATIONSUBJECT table,Because aggregate query with MIN() always return one and exactly
>TOTALPOINTS is set to NULL value, regardless of RELEVANTEXPERIENCE and
>RELEVANTQUALIFICATION field values (they are NOT NULL).
>
>Why?
one record, so your check for EXISTS is completely pointless.
> How do i correct the procedure to calculate total points even ifSELECT SUM(HRM_GRADE.POINTS) FROM hrm_applicationsubject INNER JOIN
>no detail records are found?
HRM_GRADE
ON hrm_applicationsubject.gradeid = HRM_GRADE.ID
WHERE hrm_applicationsubject.applicationid = :applicationid
INTO :subjectpoints;
IF(subjectpoints IS NULL) THEN
subjectpoints = 0;
--
SY, Dimitry Sibiryakov.