CREATE OR REPLACE PROCEDURE rUSERSX( Pusers IN DBMS_SQL.VARCHAR2_TABLE, Pweights OUT DBMS_SQL.NUMBER_TABLE) AS BEGIN FOR nJ IN 1..Pusers.COUNT LOOP SELECT NVL(Weight, 0) INTO Pweights(nJ) FROM TABLEA WHERE usera = Pusers(nJ); END LOOP; END; /
Igor Neyman, OCP DBA [EMAIL PROTECTED] ----- Original Message ----- To: "Multiple recipients of list ORACLE-L" <[EMAIL PROTECTED]> Sent: Monday, March 25, 2002 12:18 PM > Hi List, > Need your help, I am not a PL/SQL person. > I want to write a function which the number of input parameter is > diffrent(some sort of array), is anybody have any idea about this sort of > FUNCTIONS, here is the example: > > TABLEA( usera varchar2(11),Weight number(3)) this table has 100 users and > some of them may be with weight=null so any time I send the name of user or > users to the function I want to get the weight for each user(s) and if the > users weight is nul return ZERO for that user, > > Function rUSERSX('a','b','c') return 50,10,0 even if user C has null value > in TABLEA the number of input for this function can be diffrent any time > called. > > Thanks allot for your help. > > > Hamid Alavi > Office 818 737-0526 > Cell 818 402-1987 > > The information contained in this message and any attachments is intended > only for the use of the individual or entity to which it is addressed, and > may contain information that is PRIVILEGED, CONFIDENTIAL and exempt from > disclosure under applicable law. If you have received this message in error, > you are prohibited from copying, distributing, or using the information. > Please contact the sender immediately by return e-mail and delete the > original message from your system. > -- > Please see the official ORACLE-L FAQ: http://www.orafaq.com > -- > Author: Hamid Alavi > INET: [EMAIL PROTECTED] > > Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 > San Diego, California -- Public Internet access / Mailing Lists > -------------------------------------------------------------------- > To REMOVE yourself from this mailing list, send an E-Mail message > to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in > the message BODY, include a line containing: UNSUB ORACLE-L > (or the name of mailing list you want to be removed from). You may > also send the HELP command for other information (like subscribing). -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Igor Neyman INET: [EMAIL PROTECTED] Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists -------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).