[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index]
[Date Index]
[Thread Index]
[SQR-USERS Info]
[SQRUG Home Page]
Problem with SQR procedure using MAX in select
- Subject: Problem with SQR procedure using MAX in select
- From: "He who is satisfied....fails" <NMOSCARITOLO@APOLLO.BENTLEY.EDU>
- Date: Tue, 2 Apr 1996 13:38:56 -0400
Question:
What does this procedure return? After running this procedure, it returns
NULL to the variable $max_seqno. I think it should return the character '0'.
The WHERE brings back NO rows but the MAX function seems to put NULL in
&col_max_seqno and in turn MOVES NULL to $max_seqno. Is this right ?
BEGIN-PROCEDURE get_seqno
move '0' to $max_seqno
BEGIN-SELECT
max(sarappd_seq_no) + 1 &col_max_seqno
move &col_max_seqno to $max_seqno
FROM saturn.sarappd
WHERE sarappd_pidm = $pidm
AND sarappd_term_code_entry = $term
AND sarappd_appl_no = $appl_no
END-SELECT
END-PROCEDURE
Please let me know !
NICK MOSCARITOLO
Sr P/A II
Bentley College