|
-
If I was a betting man, I'd say the culprit is
SELECT COUNT(*)
INTO bcount
FROM vam_ledger
WHERE party = tparty
AND vchtype IN('BA', 'CA')
AND vchno = c2.vchno;
Since you are only interested in whether there are zero rows or not, do a simple
SELECT count(*) INTO bcount
FROM DUAL WHERE EXISTS (SELECT 1 FROM vam_ledger
WHERE party = tparty
AND vchtype IN('BA', 'CA')
AND vchno = c2.vchno);
[There are other ways of writing that, but this has the smallest impact]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|