Passing multiple values to a parameter
I have a procedure for updating the tables using a slider.In my cursor, I must use the WHERE... IN clause because there is several values that are not in a range.
My question is how can I pass the different values of 'IN' when you call the procedure.
APPLICATION OF WORK MANUALLY
SELECT DISTINCT (TBBESTU_PIDM)
FROM TBBESTU
WHERE TBBESTU_TERM_CODE = PROCESS_TERM
AND TBBESTU_EXEMPTION_CODE IN ('7011', '7022')
AND TBBESTU_DEL_IND IS NULL;
That's how I'm currently calling the procedure, where the following parameter must have two values being passed:l_bill_code = '7011', ' 7020 "
DECLARE
l_message varchar2(1000);
BEGIN
PWT_BILLING_TBBESTU_REC('&l_process_term', '&l_bill_code', l_message);
EXCEPTION
WHEN OTHERS THEN
RAISE_APPLICATION_ERROR (-20001,SQLCODE || ' ' || SUBSTR(SQLERRM,1,200));
END;
I'm looking for a new perspective on how to get this done, please help!
Normally, you would achieve this by
-Declare a collection
CREATE TYPE exemption_code_tbl
IS TABLE OF VARCHAR2(4)
-From the collection of your procedure
-Use of the collection in your SQL statement, i.e.
CREATE PROCEDURE your_procedure_name( p_code_list IN exemption_code_tbl )
AS
BEGIN
FOR x IN (
SELECT distinct( tbbestu_pidm )
FROM tbbestu
WHERE TBBESTU_TERM_CODE = PROCESS_TERM
AND TBBESTU_EXEMPTION_CODE IN (SELECT column_value FROM TABLE( p_code_list ) )
AND TBBESTU_DEL_IND IS NULL )
LOOP
<>
END LOOP;
END;
The call to the procedure would then look like
BEGIN
your_procedure_name( exemption_code_tbl( '7011', '7022' ) );
END;
Justin
Tags: Database
Similar Questions
-
a problem in passing multiple values in the loop settings for
Hi all
I am facing a problem in passing multiple values in the loop settings for.
EX:
CREATE or REPLACE PROCEDURE (pr_id OUT NUMBER) HAVE
tab type is table of NUMBER;
TEMP_TAB TAB;
BEGIN
Select the COLLECT LOOSE pr temp_tab pr_id;
I'm in 1.TEMP_TAB. loop of COUNTING
PR_ID: = temp_tab (i);
end loop;
END TEST;
OUTPUT:-
pr_id = 234578
in the example above, I'm only a value as an out parameter. but I send you PR_ID of the loop.
why I don't get all the values that the parameters.please offer a solution for me.
Thank you my friend.More clarification, let's look at your code...
-- create a procedure and have a single numeric out variable CREATE OR REPLACE PROCEDURE TEST ( pr_id OUT NUMBER ) AS -- declare a type as an array of numbers type tab is table of NUMBER; -- declare a varianble of that array type TEMP_TAB TAB; BEGIN -- query all the values from the table into the array select pr_id BULK COLLECT INTO temp_tab from pr; -- loop through each value in the array for i in 1..TEMP_TAB.COUNT loop -- set the value of the single OUT parameter, OVERWRITING any previous value it has PR_ID := temp_tab(i); -- loop around to the next value end loop; -- end the procedure with the final value of PR_ID END TEST;
-
I want to pass multiple values method AM controller
Hi all
Can someone tell me please how to pass multiple values of AM method to the controller.
Thank youYou can make use of the ArrayList
In CO
OAApplicationModlue am = pageContext.getApplicationModule(webBean); ArrayList values = (ArrayList) am.invokeMethod("PassArray");
In AM
public ArrayList PassArray { ArrayList values = new ArrayList(); values.add("value") values.trimToSize(); return values; }
Thank you
AJ -
How to pass multiple values to a data model parameter
I have a data model, where I put a setting like this.
Select col1, col2, col3 from table1 where col1 =: param1
This works very well for a single value that I pass the param1 parameter.
How can I get this to work when I want to send multiple values for param1. I already checked the box "Multiple values" and tried to change the sql for this code.
Select col1, col2, col3 from table1 where col1 in: param1
Looks like I'm missing something here.
Thanks in advance!
Krisyou need to write it as:
Select col1, col2, col3 from table1 where col1 in (: param1)
It works for me.
Klaus
-
What subprogramme should we prefer to return multiple values with OUT parameter?
Hello
I worked on the procedures and functions, and aware of their differences. Today I have an interview question that - suppose I don't have return multiple values through a subroutine and I want nor run any what DML within this subprogramme and I want to use this subprogramme in the SQL query. What subprogramme I would prefer - "Operating Mode" or "Function" and why?
In my view, both can be used in this case, but want to see your views and opinions.
Kind regards
Sachin jerbi
In terms of software engineering, if you claim something that you expect to "return" something (a value or values) then you use a function. If you call something to "do" something, and then you use a procedure.
THE settings are not good practices in many cases and should not strictly considered "return" of values. Instead, they are assigned values in the code and generally act as pointers to the original variable/structure that was passed as a parameter (the actual internals of Oracle don't quite do it, but in principle this is what they do).
A return value (or structure) of a function is basically push in the battery to the point that the RETURN statement is issued, and then the code calling the stack appears to assign it to a variable or placeholder, it should go in.
If it seems a little difference between procedures and functions to some people, it is recommended to use functions for obtaining values and procedures to do things, in most cases. It is not just "syntactic sugar", as mentioned above.
-
Passing multiple values at the request of the State (no status page)
Hello
[APEX 4.2.4.00.08 on the 11.2.0.3 database]
I didn't know how to explain briefly what I need in the title of the discussion, that's why I added the song "(non page rapport)". " I met a lot of threads associated with passing of selections multiple values from one page to another, or via a URL from one page to another. I know how to do this. The problem I have right now is trying to pass the commas of the values contained in an application to a report query element. Here's where the "(rapport non page) ' comes into play." I refer to the report query at the level of the application (i.e. shared components-> report queries). I wish really it had another name for it. "Report on the application of queries", perhaps?
In any case, my report query has a bind variable, AI_ID_NUMBERS, that is defined correctly in the shared-> components report queries. However, when this item application has multiple values such that AI_ID_NUMBERS = 4, 5, 6, 7 etc., my URL looks like this:
myapexsite.com/f? p = 456:2:1234567890:PRINT_REPORT = report_1:AI_ID_NUMBERS:4, 5, 6, 7
So, this returns only one record for the report where the identification number is 4, one. I tried a string parameter of Substitution of Application (URL_REPORT_1) with the two following variants (for which both return only a single record):
Substitution string = URL_REPORT_1 and Substitution value = f? p = & APP_ID.:0 : & SESSION. : PRINT_REPORT = report_1:AI_ID_NUMBERS: & AI_ID_NUMBERS.
Substitution string = URL_REPORT_1 and Substitution value = f? p = & APP_ID.:0 : & SESSION. : PRINT_REPORT = report_1:AI_ID_NUMBERS:-& AI_ID_NUMBERS. \
returns...
myapexsite.com/f? p = 456:2:1234567890:PRINT_REPORT = report_1:AI_ID_NUMBERS:4, 5, 6, 7
myapexsite.com/f?p=456:2:1234567890:PRINT_REPORT=report_1:::AI_ID_NUMBERS:\4,5,6,7\
.. .respectively
I really thought that the backslashes would have solved the problem. Any ideas why my report request (PDF) returns only one line?
Thank you
-Seth.
Well, too bad. I realized the mistake I did.
When you work with 'request report queries', there is an option to include variable bind, for example the application or page elements. I had already done that, but for some reason, thought that I also had to pass the parameter and its values in the URL. This is not necessary since the report query query already has the issue of the application/page related to it. The following URL works fine:
myapexsite.com/f? p = 456:2:1234567890:PRINT_REPORT = report_1
And, Yes, it's the URL that is provided when you set up a "application report query. I was thinking too hard.
-Seth.
-
passing multiple values of variable presentation to go the url in dashboard
Hi all
I use go url in dashboard in the area of text using html file mark up. We have a guest area which saves the values in the variable of presentation P_REGION. The link to the dashboard works well when we choose to value as a single region. She passes the parameter. However, if we choose multiple values, it fails. Do we need to modify the code below in support of more than the presentation variable value to pass to the report.
Thank you<a href="http://nqrc.cci.edu:7001/analytics/saw.dll?PortalGo&path=%2Fusers%2Faron%2FActionLink%2Fname&Action=Navigate&P0=1&P1=eq&P2=%22Employee%22.%22Region%22&P3=@{variables.P_REGION}">Drill Report</a>
SushilBefore you go to the link, I would say to understand how the variable takes values.
Try to use the link as ay of the column expression in the criteria to see the full url with multiple values.http://nqrc.cci.edu:7001/analytics/saw.dll?PortalGo&path=%2Fusers%2Faron%2FActionLink%2Fname&Action=Navigate&P0=1&P1=eq&P2=%22Employee%22.%22Region%22&P3=@{variables. P_REGION}
If my assumption is not wrong valiables holds as "one, two."
This will give you some ideas to work on.
If need more help to share the url with multiple values.BTW: I don't think that it works with multiple values, give a try, as said.
So much sense mark :)
-
Passing multiple values to the report
Hello
I have a form of parameter. One of the field will have at least one value. When there are multiple values, the values will be separated by a comma and pass on to the State. Please tell me how to separate them and put them in the citation in the report query.
EX: values are: PO, DR
There will be in the where condition as: where code in ('OP', 'DR');
Thank you in advance.
PS. I use 10g
Published by: 945599 on 10 July 2012 14:04Hello
I sent the unit test by mail.
Please note that there are some hardcoded values when you use run_report_object (name of report server and host name).Kind regards
AlexPublished by: AlexDiniasi on 19.07.2012 17:14
-
Hello:
How to configure contextual events publish several values of payload?
On click of a button, I'm declaritively publish a contextual event, which works very well when a single value is passed to the event handler.
My event handler method has the signature of:
eventHandler (String)
But now I also have an oracle.jbo.domain.Number, so my new eventHandler looks like this:
eventHandler (Number, String)
How to pass two values during editing of the event and how to place the payload with multiple values for the new eventHandler?
All article or code would be greatly appreciated.
Thanks for the help.You define a bean holding your values and pass an instance of the bean as a payload...
Timo
-
By passing the value of the parameter?
Hi Rod,
I created a setting for "requsition_number" and I have the parameter 'date', when I pass a value to "requistion_number" and change the value to "dates", iam getting the data.
Now, I don't want the "requisition_number' not yet 'null' value, but I'll give you the date values. The problem is that I have go a value or null to "requisition_number" iam not able to run the report.
I don't want the required "requisition_number" parameter. If I use the standard "null" I won't get more details.
So I don't want to have, how do I manipulate by not passing any value in "req_number" but giving dates?
It should be optional if they wish, they will give the parameter, otherwise it should be left alone and the date value is passed and that I should get all the details. Work around him.
Kind regards
Murielle.Hi murielle
If you build it - they will come. :-) Believe me, it works.In your parameter prompt you ask the user to enter or select a requisition number or ALL instead.
If the user types in the parameter, then the part of the GOLD of the condition will see this and run everything you add using ADD. If she sees not ALL he assumes the user has entered a number of requisition and trying to find. If you only use on its own with no Boolean along then you will get all the application numbers.
To allow users to key all of the TOTALITY or even the whole, you must use a SUPERIOR command, like this:
requistion_number =: req_param
OR
* (Upper(:req_param) = 'ALL' AND requisition_number = fullname) *.Alone, to pull all of the requisitions, it looks like thuis:
requistion_number =: req_param
OR
Upper(:req_param) = "ALL".Best wishes
Michael -
How to pass multiple values in a single parameter
Hi all
I have a setting in my report called dept, this setting takes values in a list. I am using a sql query to populate the list. then the values available for dept are HR, FINANCE, MARKETING.
In the setting column, I checked the option "MULTIPLE SÉLECTION" AND "CAN SELECT ALL" and I select "all THE VALUES PASSED.
Now my data model sql looks like
Select * from emp where Department: dept
When I try to view the report and select ALL the list of values I don't get any results out of it. In short, I want to run my query for all values of the Department and I want that this query to run when I select ALL from the list.
Select * from emp where Department ('HR', 'FINANCE', 'MARKETING')
But I don't get all the data, is it passing null? How to solve this?
Any help will be really appreciated
Thank you
RonnyYou can change the code to sql data model looks like
select * from emp where department in (:dept )
-
passing multiple values of the column to a variable in unix
sqlplus -s $USER_ID@$SID/$PWD<<EOF>sql_1.txt set feedback off set heading off select 114032 as c_1 from dual ; EOF for i in `cat sql_1.txt` do sh script_1.sh $i
Currently I am passing a column value to the single unix variable.
How can I pass values of 2 columns
sqlplus -s $USER_ID@$SID/$PWD<<EOF>sql_1.txt set feedback off set heading off select 114032 as c_1 ,sysdate c_2 from dual ; EOF sh script_1.sh $col_1_value $col_2_value
I'm on SUNOS
You can concatenate the columns in SQL by a delimiter, and then use the cut (for example) under Unix to analyze the production line in chips for the script.
-
passing multiple values from the query in the select statement of the procedure
I am collecting IDS to select education agreement from the date of rental values and then I would pass the result of the query in the statement select to get the result.
data type for the contract id is of type varchar and date of rental there is more than one id to contract for most of the time. Help, please. Thank you
CREATE OR REPLACE PROCEDURE abstract_menu (p_letting IN VARCHAR2, p_results OUT SYS_REFCURSOR) IS v_contractId VARCHAR2 (40); SELECT lcontid INTO v_contractId FROM letprop WHERE datestat IS NOT NULL AND letting = p_letting AND letstat <> 'R'; BEGIN OPEN p_results FOR SELECT DISTINCT SUBSTR (l.letting, 3, 2) || '-' || SUBSTR (l.letting, 5, 2) || '-' || SUBSTR (l.letting, 1, 2) lettingdate, l.lcontid contractid, SUBSTR (q.cprojnum, 1, 10) projectnumber, DECODE (TRIM (MIN (j.route)), NULL, 'N/A', TRIM (MIN (j.route))) routenumber, L.DATESTAT statusdate, L.LETSTAT lettingstatus, (q.cdescr) jobdescription, INITCAP (q.clocat1 || q.clocat2) LOCATION FROM vendor v, vendaddr r, letprop l, planhold p, proposal q, project j, propproj k, bidlet bd WHERE v.vendor = r.vendor AND k.contid = q.contid AND k.pcn = j.pcn AND l.lcontid = k.contid AND p.vendor = v.vendor AND l.letting = p.letting AND l.lcontid IN v_contactid "**************This is where I would like to pass the contract id from the above select statement***********'" AND l.CALL = p.CALL AND r.addrnum = p.billto AND bd.letting = l.letting GROUP BY q.cdescr, q.clocat1, q.clocat2, bd.letting, l.letting, l.lcontid, q.cprojnum, L.LETSTAT, L.DATESTAT ORDER BY lettingdate; end;
user9196150 wrote:
AND l.lcontid IN v_contactid ' * this is where I would like to pass the id of the select statement above contract * ""»CREATE OR REPLACE PROCEDURE abstract_menu (p_letting IN VARCHAR2, p_results OUT SYS_REFCURSOR) IS BEGIN OPEN p_results FOR SELECT DISTINCT SUBSTR (l.letting, 3, 2) || '-' || SUBSTR (l.letting, 5, 2) || '-' || SUBSTR (l.letting, 1, 2) lettingdate, l.lcontid contractid, SUBSTR (q.cprojnum, 1, 10) projectnumber, DECODE (TRIM (MIN (j.route)), NULL, 'N/A', TRIM (MIN (j.route))) routenumber, L.DATESTAT statusdate, L.LETSTAT lettingstatus, (q.cdescr) jobdescription, INITCAP (q.clocat1 || q.clocat2) LOCATION FROM vendor v, vendaddr r, letprop l, planhold p, proposal q, project j, propproj k, bidlet bd WHERE v.vendor = r.vendor AND k.contid = q.contid AND k.pcn = j.pcn AND l.lcontid = k.contid AND p.vendor = v.vendor AND l.letting = p.letting AND l.lcontid IN ( SELECT ll.lcontid FROM letprop ll WHERE ll.datestat IS NOT NULL AND ll.letting = p_letting AND ll.letstat 'R' ) AND l.CALL = p.CALL AND r.addrnum = p.billto AND bd.letting = l.letting GROUP BY q.cdescr, q.clocat1, q.clocat2, bd.letting, l.letting, l.lcontid, q.cprojnum, L.LETSTAT, L.DATESTAT ORDER BY lettingdate; end; /
SY.
-
Action link pass the value of the parameter
Hi all
I have two dashboard trying to use the action link.
First scoreboard has guests - Department and report month, 2nd dash has invited Department, report month and code produced.
Of the first dashboard, there is an answer for monthly sales by product code for reporting Department and the report month. When I put in place measures for the 2nd dash, it does not have the 'product code' value to the dashboard 2nd, 2nd dashboard only inherit value of 1 dashboard guests.
So, how to select the 2nd dashboard "product code"?
Thank you
LingHello
The product code is invited to enter the dashboard of target?
Kind regards
Srikanth -
Passing a value to the parameter variable
Here is a general example (all the code):
_Global.XPosition = {function(whichMc:MovieClip,_xStart:Number,_xEnd:Number):Void}
new Tween (whichMc, "_x", Strong.easeOut, xStart, xEnd, 1, true);
}
function loadFunction(success:Boolean):Void {}
If (success) {}
var image01ClosedPosition:Number = this.firstChild.childNodes [0].attributes.imageChangeX;
hit01.onRollOver = function() {}
xPosition(img01,image01ClosedPosition,0);
}
}
In the XML file, the value in the fact that I'm pulling is - 29.
If I do a trace of imag01ClosedPosition, I get the correct value of-29.
If I change the call to the function to read xPosition(img01,-29,0); This also works
I can't make it work the way I have it above.
(I know that I failed a lot, but I wanted to give you an idea of the part that does not work.)Thank you, kglad. I wondered about this. I thought that the setting of a variable data type: number, it would have been a number, but I never got an error in the debugger so I thought it was ok. I traced the data type and figured out it was actually a string and changed the following line which has transformed the string to an integer and does the job:
var image01ClosedPosition:Number = parseInt (RootNode1.attributes.imageChangeX);
Maybe you are looking for
-
CANNOT IMPORT PHOTOS/CONNECT TO MAC AFTER UPDATE IOS10
Try to import photos or videos of my iphone 6 s to my macbook pro 09. Before the update to ios10, I had no problem doing this. I have chosen to APPROVE this computer, when the notification appears on my phone. Now, here's the problem, I get this mess
-
Re: Recovery disc creator does not work on the Qosmio F50
Hello I recently got my new laptop Qosmio F50. I decided to burn the recovery disk and so I did. But during the burning process, I got an error that is: "Diference were detected between different folders: Source path: (origin)F:\HDDRecovery\SWImg\069
-
Compatibility of drive M8020, Windows 7 64
Hi I am trying to use a large 2nd drive, above. 2.2 TB, I upgraded the drive to an SSD of 500G, the motherboard support he, she, s a TB WD Red 4.0, thanks
-
File extension. $$$ in Windows 8.1 and newer
Hello everyone I have a quick question: I'm running Windows Server 2012R2 and I think that there is a problem with the file extension. $$$ Is this a known issue for more recent versions of Windows, and is there a solution? The application I am runnin
-
Q140060 Center Solutions Windows 7
Having the problem on two disks with files error maessage: disk is not formatted. In notebook have Windows xp professional and internal disk and in the Windows 7 home Premium desktop player, I use external floppy drive. Please try to help me how to o