Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: different SQL approaches
>
> And then, of course, there is the issue of bind variables as neither
> statement should ever be written for any reason. What should be written
> is:
>
> DECLARE
>
> rtype sc.rec_type%TYPE;
> ctype sc.code_type%TYPE;
>
> BEGIN
> rtype := 'S';
> ctype := '502';
>
> SELECT ...
> FROM ...
> WHERE ...
> AND sc_rec_type = rtype
> AND sc.code_type = ctype;
>
> END;
> /
what do you mean by "neither statement should ever be written for any
reason"?
(if you wrote 'usually' rather than 'ever', I would completely agree)
let's recall that there are quite a few exceptions: