Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> syntax - query's scalar results to a varible?

syntax - query's scalar results to a varible?

From: <matt_at_mailinator.com>
Date: 3 Jul 2006 14:21:14 -0700
Message-ID: <1151961674.498148.323250@h44g2000cwa.googlegroups.com>


hello,

im an application developer w/ a background in MS SQL Server, but i'm learning oracle pl/sql for a project. im learning quite a bit, but this one still gives me grief.

in MS, when i needed to refer to a sub-query's result, i would often do something like this:

	--ms sql server syntax
	DECLARE @roleID INT
	SET @roleID = SELECT RoleID FROM Foo f WHERE f.RoleName = p_roleName


how is this done in pl/sql? i would have guessed:

        DECLARE v_roleID INTEGER := SELECT RoleID FROM Foo f WHERE f.RoleName = p_roleName

...but that was happy for me. im on oracle 9. have i got my syntax wrong, or is this not how its done?

thanks!
matt Received on Mon Jul 03 2006 - 16:21:14 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US