Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Can't use FUNCTION in SQL?
In Owens' book on PL/SQL, he states that a function "evaluates to the
value of some datatype which can be substituted in any place where a
variable of the same type can be placed."
However, I tried to use a function in an insert statement in place of a variable, and the resulting package would not compile. A simplified example:
CREATE TABLE hlh_psf
(
PSF_ASSY VARCHAR2(20), PSF_PART VARCHAR2(20),
part hlh_psf.psf_part%TYPE; assembly hlh_psf.psf_assy%TYPE;
INSERT INTO hlh_psf
VALUES
(
assembly,
part,
<snip code to end of procedure>
...
The above works fine, but
INSERT INTO hlh_psf
VALUES
(
SplitAssy(part_id_rec.title), SplitPart(part_id_rec.title),
gives a compile error stating that the function may not be used in SQL statement. Is Owens wrong about this, or have I left something important out?
hlh_NOSPAM_at_excite.com is a valid, unmunged address! It is also so full of spam(!) that I don't read it. Received on Sat Aug 28 1999 - 11:31:03 CDT