Multiple values for a condition Like
How can I make a condition like for several options of valuefor example
select b.segment1, b.segment2, b.description, c.cross_reference, c.cross_reference_type
from inv.mtl_system_items_b b, inv.mtl_cross_references_b c
where b.inventory_item_id = c.inventory_item_id and
b.ORGANIZATION_ID = 136 and
c.cross_reference like (
'1267801228%',
'1267801230%',
'1500005030%',
'1745%',
'1874106005%',
'2004%',
'2004%',
'232003000000%',
'303681020128%',
'3426441351%',
'489122853014%',
'4894230110%',
'5383800117%',
'5422810701%',
'5422810711%',
'5422810711%',
'70986205105%',
'70986205112%',
'70986205122%',
'70986205131%',
'70986205131%',
'70986205131%',
'70986205142%')
Published by: user8986013 on October 28, 2010 08:19
Or
select distinct b.segment1,
b.segment2,
b.description,
c.cross_reference,
c.cross_reference_type
from inv.mtl_system_items_b b,
inv.mtl_cross_references_b c,
table (
sys.odcivarchar2list ('1267801228%',
'1267801230%',
'1500005030%',
'1745%',
'1874106005%',
'2004%',
'2004%',
'232003000000%',
'303681020128%',
'3426441351%',
'489122853014%',
'4894230110%',
'5383800117%',
'5422810701%',
'5422810711%',
'5422810711%',
'70986205105%',
'70986205112%',
'70986205122%',
'70986205131%',
'70986205131%',
'70986205131%',
'70986205142%'
))
where b.inventory_item_id = c.inventory_item_id
and b.organization_id = 136
and c.cross_reference like column_value
Published by: MichaelS on October 28, 2010 20:07
added separate
Tags: Database
Similar Questions
-
Multiple values for the same column in the columns of diffétent in the same row?
Hi all
I wonder how you can display different values for the same column in different columns on the same line. For example, using a CASE statement, I can:
CASE WHEN CODE IN ('1 ', ' 3') THEN COUNT (ID) AS 'Y '.
CASE WHEN CODE NOT IN ('1 ', am') THEN COUNT (ID) AS "N".
Yes, that will produce two columns but will produce null values to empty and also two separate registers.
Any ideas?
Thank youAre you sure that this code works for you?
Select ID ,CASE WHEN MODE_CODE IN ('1', '3') THEN COUNT( No) END as "Fulltime" ,CASE WHEN MODE_CODE NOT IN ('1', '3') THEN COUNT( No ) END as "Other" From table group by ID
I guess the code above fails because MODE_CODE is not in your group by?
My suggestion would be to put the CASE in the COUNT:
Select ID ,COUNT(CASE WHEN MODE_CODE IN ('1', '3') THEN No END) as "Fulltime" ,COUNT(CASE WHEN MODE_CODE NOT IN ('1', '3') THEN No END) as "Other" From table group by ID
CASE expressions return no. when the respective conditions are true and NULL otherwise.
COUNTY will have non-null values. -
Hello
I have a report that uses apex_item.checkbox (...) to generate the check box. This report correctly displays a check box for each line. The source code that is generated in the html page is:
< input type = "checkbox" name = "f01" value = "202" id = "P1_CHECKBOX" / >
...
...
< input type = "checkbox" name = "f01" value = "220" id = "P1_CHECKBOX" / >
...
...
< input type = "checkbox" name = "f01" value = "210" id = "P1_CHECKBOX" / >
...
...
I want to use the javascript function $v () to get the values of the enabled check box. I thought that the return of this function all the checked values separated by ':' but I noticed that my code alert ($v ('P1_CHECKBOX')); return whenever the value of the first checkbox if it is checked.
It returns '202' if the first box is checked, but nothing, if only the second checkbox is checked and '202' if the box of the first and the second is checked.Hello
first of all, $v, $x and $s are supposed to not work for items on the page, not the columns in a table or manually generated HTML elements.
Secondly, I think that your HTML code is not correct, because each of your boxes has the same ID. But the ID must be unique in the DOM of the browser tree. Thus the different box should actually named P1_CHECKBOX_1... P1_CHECKBOX_3. Just look at what is actually generated for a page element real checkbox. BTW, I think that you should not name the checkbox as part of page elements, because they are not actually page elements. I think that this could be confusing for other developers.
Hope that helps
Patrick
-----------
My Blog: http://www.inside-oracle-apex.com
APEX 4.0 Plug-Ins: http://apex.oracle.com/plugins
Twitter: http://www.twitter.com/patrickwolf -
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
-
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
-
Spend multiple values with parameter of stored procedure
CREATE TABLE VTEST_INSERT)
NUMBER OF MY_ID,
COLUMN1 VARCHAR2 (50)
);
-SELECT * FROM VTEST_INSERT;
INSERT INTO VTEST_INSERT (MY_ID, COLUMN1) VALUES (1, 'TEST1');
INSERT INTO VTEST_INSERT (MY_ID, COLUMN1) VALUES (2, "TEST2");
INSERT INTO VTEST_INSERT (MY_ID, COLUMN1) VALUES (3, "TEST3");
INSERT INTO VTEST_INSERT (MY_ID, COLUMN1) VALUES (4, "TEST4");
INSERT INTO VTEST_INSERT (MY_ID, COLUMN1) VALUES (5, 'TEST5');
INSERT INTO VTEST_INSERT (MY_ID, COLUMN1) VALUES (1, "TEST6");
INSERT INTO VTEST_INSERT (MY_ID, COLUMN1) VALUES (2, 'TEST7');
INSERT INTO VTEST_INSERT (MY_ID, COLUMN1) VALUES (3, "TEST8");
INSERT INTO VTEST_INSERT (MY_ID, COLUMN1) VALUES (4, 'TEST9');
INSERT INTO VTEST_INSERT (MY_ID, COLUMN1) VALUES (5, "TEST10");
CREATE OR REPLACE
PROCEDURE VTEST_INSERT_SP (vid in VARCHAR2, vname IN VARCHAR2)
AS
BEGIN
DELETE FROM VTEST_INSERT WHERE MY_ID IN (vid);
INSERT INTO VTEST_INSERT (MY_ID, COLUMN1) VALUES (vid, vname);
END;
/
EXEC VTEST_INSERT_SP(1,'TEST999');
This set works well above. But I want to be able to pass multiple values VNAME. so, something like:
EXEC VTEST_INSERT_SP(1,'TEST999','TEST888','TEST777');
any help is appreciated. Thank you.
This would make many inserts each with the same vid and values of different VNAME.
Try something like this
- SET SQLBLANKLINES
- ALTER SESSION SET PLSQL_WARNINGS = ' ENABLE: ALL ';
- DROP TABLE vtest_insert;
- CREATE TABLE vtest_insert (vid NUMBER, vname VARCHAR2 (20));
- INSERT ALL
- IN vtest_insert (vid, vname) VALUES (1, "yyyy")
- IN vtest_insert (vid, vname) VALUES (1, "bb")
- IN vtest_insert (vid, vname) VALUES (1, "cccccc")
- IN vtest_insert (vid, vname) VALUES (2, "ddd")
- IN vtest_insert (vid, vname) VALUES (2, 'ee')
- SELECT * FROM .dual 'PUBLIC '.
- SELECT * FROM vtest_insert;
- CREATE or REPLACE TYPE vnames_tab_ty IS TABLE OF VARCHAR2 (20)
- /
- DISPLAY ERRORS;
- CREATE OR REPLACE PROCEDURE vtest_insert_sp
- (
- p_vid IN vtest_insert.vid%TYPE,
- p_vnames IN vnames_tab_ty
- )
- DEFINE AUTHID
- IS
- BEGIN
- DELETE FROM vtest_insert WHERE the vid = p_vid;
- FORALL idx IN p_vnames. FIRST... p_vnames. LAST
- INSERT INTO vtest_insert (vid, vname) VALUES (p_vid, p_vnames (idx));
- END vtest_insert_sp;
- /
- DISPLAY ERRORS;
> - DECLARE
- Vnam vnames_tab_ty;
- vid vtest_insert.vid%TYPE.
- BEGIN
- BK.vid: = 1;
- BK.vnames: is vnames_tab_ty ('vn-01', 'vn-02', 'vn-03');.
- vtest_insert_sp (p_vid-online bk.vid, p_vnames-online bk.vnames).
- COMMIT;
- BK.vid: = 2;
- BK.vnames: is vnames_tab_ty ('vn-04', 'vn-05', 'vn-06', 'vn-07');.
- vtest_insert_sp (p_vid-online bk.vid, p_vnames-online bk.vnames).
- COMMIT;
- END;
- /
- SELECT * FROM vtest_insert;
Which produces the following output
Table created.
5 rows created.
VNAME VID
---------- --------------------
1-aaaa
1 bb
1 cccccc
2 ddd
2 EA
Type of creation.
No errors.
Created procedure.
No errors.
PL/SQL procedure successfully completed.
VNAME VID
---------- --------------------
1 VL-01
1 VL-02
1 VL-03
2 vn-04
2 vn-05
2 vn-06
2 vn-07
7 selected lines.
SQL >
Kind regards
Dariyoosh
-
"expects a single value / corresponds to multiple values" error script New - vm in PowerCLI
I have been responsible for creating some 800 + virtual desktops so, naturally, this is something I want to script. After reading through the large bases of knowledge here, I was able to create what I thought, it was the correct code. It worked when I was just "write-host" ing lines command to see if the variable creation/uasge worked well. When I removed the lines of write-host and tried to use the actual orders new-vm, I started having different "of the specified parameter '$vmhost' expects only one value, but your criteria of name ' xxx - vm53.yyyyyyyyy.com' correspondingponds to several values." errors. Here is my code, marked specificities:
Add-PSSnapin VMWare.VimAutomation.Core # PowerCli add script environmen t
$creds = get-vicredentialstoreitem-'c:\temp\credfile.xml' # chopped access file password to authentice with "sys" service account from the file
connect-viserver-Server $creds.host-$creds.user username-password $creds.password
$host1 = get-cluster "HVD1" | get-vmhost | Tri-objet "memoryusagemb" | Select-object - 1 first | foreach {$_.name} # get the VMWare hosts with less use of the memory of the cluster host "HVD1" registration
$dstore = get-datastore ' vdi_ * ' | Tri-objet 'FreeSpaceMB' - descending | Select-object - 1 first | foreach {$_.name} # Get datastore disk with most freespace to be VDI_ *
$VMBaseName = "XX-P01-HVD" # definition of trade names XenDesktop hosted
$Template = get-model model-CBD-XD-XP | Select-object - 1 first | foreach {$_.name} # Setting for XenDesktop hosted Commercial model
$OSCustSpec = "CBD - XD XP" hosted # Setting for hosted Commercial XenDesktop customization script
$loc = 'Desktop' # configuration for XenDesktop folder
$ResPool = get-resourcepool XX-P01-HVD | Select-object - 1 first | foreach {$_.name} # XenDesktop hosted Commercial resource pool setting
[int] $FirstNumber = 0
[int] $HostTotal = 0
[int] $ctr = 0
$FirstNumber = Read-Host "enter the first digit to the VMWare host range".
$HostTotal = Read-Host "enter the quantity for the VMWare host range".
$HostNumber = $FirstNumber
$HostFinal = $HostNumber + $HostTotal
do {}
$vmname = $vmbasename + $HostNumber
new-vm - vmhost $host1-name $VMName - $ResPool - $loc location ResourcePool - datastore - slim - DiskStorageFormat $dstore model $template - OSCustomizationspec $OSCustSpec # Execute the new VMWare host creation
Start-vm $VMName # start the virtual machine to start the customization process
$HostNumber ++
$ctr += 1
If ($ctr - eq 5) {write-host write-host "break 10 Minutes' sleep s 600; $ctr = 0; write-host} # sleep for 600 seconds every 5 VMs to avoid overloading ESX hosts
} until ($HostNumber - eq $HostFinal)Here are my mistakes:
New - VM: 23/03/2011-17:42:22 new-VM parameter specified "VMHost.
expects a single value, but your criteria of name ' xxx - vm53.yyyyyyyyy.com' corresponding
ponds to multiple values.
To C:\temp\xx_deploy.ps1:31 character: 7
+ new-vm < < < <-vmhost $host1-name $VMName - $ResPool - $l location ResourcePool
OC - datastore - slim - DiskStorageFormat $dstore model $template - OSCustomizat
creating # ionspec $OSCustSpec of the new VMWare host Execute
+ CategoryInfo: InvalidResult: (System.Collecti... dObjectInterop)
(]: List 1) [new-VM], VimException
+ FullyQualifiedErrorId: Core_ObnSelector_SelectObjectByNameCore_MoreResu
ltsThanExpected, VMware.VimAutomation.ViCore.Cmdlets.Commands.NewVM
New - VM: 23/03/2011-17:42:23 new-VM parameter specified ' Resourc
ePool' expects a single value, but your name criteria is "XX-P01-HVD.
multivalued.
To C:\temp\xx_deploy.ps1:31 character: 7
+ new-vm < < < <-vmhost $host1-name $VMName - $ResPool - $l location ResourcePool
OC - datastore - slim - DiskStorageFormat $dstore model $template - OSCustomizat
creating # ionspec $OSCustSpec of the new VMWare host Execute
+ CategoryInfo: InvalidResult: (System.Collecti... dObjectInterop)
(]: List 1) [new-VM], VimException
+ FullyQualifiedErrorId: Core_ObnSelector_SelectObjectByNameCore_MoreResu
ltsThanExpected, VMware.VimAutomation.ViCore.Cmdlets.Commands.NewVM
New - VM: 23/03/2011-17:42:23 new-VM parameter ResourcePool: could not
t find any object specified by its name.
To C:\temp\xx_deploy.ps1:31 character: 7
+ new-vm < < < <-vmhost $host1-name $VMName - $ResPool - $l location ResourcePool
OC - datastore - slim - DiskStorageFormat $dstore model $template - OSCustomizat
creating # ionspec $OSCustSpec of the new VMWare host Execute
+ CategoryInfo: ObjectNotFound: (VMware.VimAutom, ol ResourcePo)
OL:RuntimePropertyInfo) [new-VM], ObnRecordProcessingFailedException
+ FullyQualifiedErrorId: Core_ObnSelector_SetNewParameterValue_ObjectNotF
oundCritical, VMware.VimAutomation.ViCore.Cmdlets.Commands.NewVMI had multiple values for some of the entries, that's why I tried to analyze with the first '-1' and outside the script, the values return very well.
Any help?
And this is the cause of the problem.
You feed the New - VM name in fact only 1, and the cmdlet, by OBN, tries to resolve the name into an object.
But since there are 2 connections, it will get an object returned by each connection.
Where the multiple value message.
Check if you have several Connect-VIServers in the script and maybe close all connections before the script starts.
Or switch to simple mode with the Set-PowerCLIConfiguration cmdlet.
-
Search for multiple values in a single field
Hello
I have this request to get results when the user doing a search query:
select * from ( select "ID", "ID" ID_DISPLAY, "SHIFT_DATE", "SHIFT", "OFFENSE_ID", "DESCRIPTION", "ANALYST", "STATUS", "SUBSTATUS" from "#OWNER#"."IDSIEM_OFFENSES") where OFFENSE_ID IN(:P223_OFFENSES) AND ( instr(upper("DESCRIPTION"),upper(nvl(:P223_DESCRIPTION,"DESCRIPTION"))) > 0 ) AND ( instr(upper("SHIFT"),upper(nvl(:P223_SHIFT,"SHIFT"))) > 0 ) AND ( instr(upper("SUBSTATUS"),upper(nvl(:P223_SUBSTATUS,"SUBSTATUS"))) > 0 ) AND ( instr(upper("ANALYST"),upper(nvl(:P223_ANALYST,"ANALYST"))) > 0 ) AND ( instr(upper("SHIFT_DATE"),upper(nvl(:P223_SHIFTDATE,"SHIFT_DATE"))) > 0 ) AND ( instr(upper("STATUS"),upper(nvl(:P223_STATUS,"STATUS"))) > 0 ) ORDER BY OFFENSE_ID DESC
The thing I want to do is to set multiple values in the P223_OFFENSES field when I search. For example, an offence is a number, so I want to put in the search box 1111, 3333, 4444, 5555 and the report shows me these 4 offences in the report. The search operation only works when I put only 1 offences, but when I put more than 1, separated by commas, it gives me this error: error report: ORA-01722: invalid number. That is why, because is a number and the character point is not allowed, how can I achieve this? Thank you in advance.
Best regards, Bernardo
I solved a problem like this a few times with a utility function of pipeline for extracting the values from the list:
CREATE or REPLACE TYPE split_tbl AS TABLE OF VARCHAR2 (32767).
/
FUNCTION to CREATE or REPLACE split_list
(
p_list VARCHAR2
p_delimiter VARCHAR2: = ', '.
) Split_tbl RETURN
PIPELINED IS
l_idx PLS_INTEGER;
l_list VARCHAR2 (32767): = p_list;
BEGIN
LOOP
l_idx: = instr (l_list, p_delimiter);
IF l_idx > 0
THEN
LINE of CONDUCT (substr (l_list, 1, l_idx - 1));
l_list: = substr (l_list, l_idx + length (p_delimiter));
ELSIF TRIM (l_list) IS NOT NULL
THEN
PIPE ROW (l_list);
EXIT;
ON THE OTHER
EXIT;
END IF;
END LOOP;
RETURN;
END split_list;
/
In this way, you can define SQL like:
SELECT to_number (column_value) FROM TABLE (split_list (' 1, 3, 99', ','))
Or for this specific case: replace the condition
OFFENSE_ID IN(:P223_OFFENSES)
with
OFFENSE_ID IN (SELECT to_number (column_value) FROM TABLE (split_list (: P223_OFFENSES, ',')))
The advantage over using instr or regex is that you can usually always benefit index on OFFENSE_ID
Better also to restrict entry to only numbers and ', ' or you will always get invalid numbers errors if a user enters "1234, 567, ABC"in the field of P233_OFFENSES.
Kind regards
Thierry
-
How default of a multiple selection for all values setting?
I have a setting that allows the user to select multiple values. I want the default to use all values (which means basically just ignore this parameter in the generated SQL code). However, I can't create named on this calculation since it accepts multiple values, and the calculation supports only the first value. Is there a way to do what I need, without selecting all the values in the list (the LOV contains hundreds and hundreds of values so it's not a viable option). I'm not very experienced with the discoverer and don't know all the tips/solutions workaround, if you are looking for expert advice.
Thank you
Hello
You must code the parameter and the condition that he accepts the word ALL.
For example, suppose you are working with ITEM_NUMBER and you have thousands of articles. You want the user to be able to one or more key or access all THE items.
You must create a Boolean condition like this:
ITEM_NUMBER IN: ITEM_PARAMETER
OR
UPPER(:ITEM_PARAMETER) = "ALL".
So if the user key word ALL all all or or any variation of the word to be determined as true by the condition and all items will be selected. If the user does no key ALL, and then the other half of the condition will be applied and the element must be a valid element as contained in the list of all the elements. You can even create your parameter with a default value of all THE
Best wishes
Michael
-
Type/conditional default value for a form element
Hello
I have an interactive report with a form on the table 'A' who 'Who' has columns like 'CREATED_BY', 'LAST_UPDATED_BY '. Now, I'm auto these columns in the form with the & APP_USER. function. The scenario occurs when the 'P' user clicks on the button 'CREATE' on the report, these columns of the report get populated info P. After committing this recording, the "Q" user edit this record even with the link 'Edit' in this folder. The two columns get populated by the Q news, ideally only LAST_UPDATED_BY should get populaed by the news of the Q and not the CREATED_BY column, as it is the 'P', which created this record.
To do this, I guess that in the type of default value for these items, I have to use "Body of the PL/SQL function" instead of "static text with Session of Substitutions in State". Problem is to know how to code the filter: If the user pressed 'create' button or the button "Edit". Help, please
Thank you
MaryHi Mary
Usually, I would do this sort of thing on a trigger. However, you could do the conditional CREATED_BY field on the primary key of the record is null (which is itself a new record, but it must have a value of an existing record). The LAST_UPDATED_BY field should not be conditional, as it should be the name of the user who recorded the record.
Andy
-
Create a table of values for which a condition is met
I have exactly this problem, however connected solution is no longer valid: Re: table to automatically generate values if the condition is met,
Basically I have a table (named 'Master Sheet') that has two columns, one with project names with a status ('Active' or 'pending'). I want a separate table that automatically fills the project names of the leaf of the master for which the status is 'Active '.
For example, from this table:
Project
Status
Red
PENDING
Orange
ASSETS
Yellow
ASSETS
Green
ASSETS
Blue
PENDING
I want to automatically generate this table, which contains only values whose status is 'Active' (not 'pending' and without values null):
Project
Status
Orange
ASSETS
Yellow
ASSETS
Green
ASSETS
Please note that using the filter function does not work in this case, as I need to be able to freely add new lines to the two tables.
Hi Kath,
Here is a pair of similar solutions.
That on background uses a writing ('ACTIVE') of the value in the formula in the master-1 table to create the index in column C.
Above who gets the value of the cell in row 1 (A1) of the table of the single column and lists him only the names of any State were brought to the project.
Index columns can be hidden.
Formulas:
Master: C2 IF (B = C$ 1, ROW (), 999)
Table 1::A3: IF (SMALL (Master: $C, LINE () −2) = MAX (Master: $C),"", INDEX (Master: $A:$ B, SMALL (Maste r: $C, ROW (−2)), COLUMN ()))
Master - 1:C2: IF (B = "ACTIVE", ROW (), 999)
Table 1 - 1:A2: IF (SMALL ("Master-1': C, LINE (−1) ') = MAX ('Master-1': C),' ', index (" Master-1': b, SMA LL('Master-1'::C,ROW()−1),COLUMN()))) ")")
All forms filled up to the last line of their respective columns.
Filled with formulas in column A of the table of two columns to right of column B.
Single column table must be no more than a longer column of its master table.
Double table column must be as long as his master table or less.
Kind regards
Barry
-
How to url using NOT IN (NIN) IR filter for multiple values?
Apex 5.0.1 (but should work for Apex 4.2)
I want to set a url with an IR filter using the filter NOT IN. For example, to get a filter that says: status not in (3,4)
To do this, we can use the url IRNIN_STATUS parameter.
This method works. Problem is how can I set multiple values in the url?
IRNIN_STATUS:3, 4 will give a filter 'status not in (3) '
4 is interpreted as the following for the next parameter value, even if there is no additional parameters.
Find / remember the solution:
We can add the backslashes to values to distinguish them from others.
IRNIN_STATUS:\3, 4
-
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;
-
LRM-00112: multiple values not allowed for the parameter "control".
When I'm passing the following in my cmd, I get the error message:
can someone explain to me what is the cause of the error and pls suggest me the correct syntaxsqlldr scott/tiger control="C:\Documents and Settings\Sandy\My Documents\address.ctl" log="C:\Documents and Settings\Sandy\My Documents\address.log" LRM-00112: multiple values not allowed for parameter 'control' SQL*Loader: Release 10.1.0.2.0 - Production on Tue Mar 22 00:17:18 2011 Copyright (c) 1982, 2004, Oracle. All rights reserved. SQL*Loader-100: Syntax error on command-line
Thanks in advanceReplace the double quotes ("") by single quotes ('). If this does not work also, try a location without spaces in the directory name.
Werner
-
Cannot get 'IN' text field with multiple values.
I have a text field (P11_SERIAL_NUMBERS) someone would use to enter multiple values (i.e. of the serial numbers). I tested various methods but can't seem to get anything working. I used values such as ' 12929', '19191' or ('11919', ' 19192 ', ' 1111') or 12121,121333.»
I have to analyze this area after the entrance is and update P11_SERIAL_NUMBER to something like ("121212 ', 121211', '292929'). The report is a SQL query returning the body of a PL/SQL function. I build the query in an anonymous block to something like the following:
SELECT apex_item.checkbox (1, instance_number) Ins,.
apex_item. Text(2,i.instance_number) instance_number.
apex_item. Text(3,i.item_number) item_number.
description of the apex_item. Text(4,i.Description),
Serial_number apex_item. Text(5,i.serial_number),
i.party_name,
i.status_name
Cycsi_item_details_v I have
WHERE i.item_number IN (SELECT v.item_number FROM cycsi_installed_base_v WHERE v.serial_number = i.serial_number v)
AND i.item_number AS NVL ('%' |') XLA' | ' %','%')
AND NOT EXISTS (SELECT d.item_serial_number FROM cy_fco_d, d WHERE d.fco_id = 2803 AND d.item_serial_number = i.serial_number) AND i.serial_number IN ('61763 ', ' 61621');
However, when I enter several values that nothing ever went back to the SUMMIT even though the SQL query returns more rows. I run the application in debug mode and it seems to show the values correctly.
0.11: show report
0.12: determine the column headings
0.12: analyze the query such as: TRAFFIC
0.15: binding: ": P11_MODEL_NUMBER"= "P11_MODEL_NUMBER" value = "XLA"»
0.16: binding: ": P5_FCO_ID"= "P5_FCO_ID" value = "2803"»
0.17: binding: ": P11_SERIAL_NUMBERS"= "P11_SERIAL_NUMBERS" value = '(' 61621', ' 61763')""
0.19: print the column headings
0.19: loop lines: 15 rows
No data found
If I add only a serial number at a time as the APEX application returns the line correctly.
Does anyone have an idea what I'm doing wrong or what best way to solve this problem?
Thank you
John
Published by: Jennifer on July 13, 2010 15:23Hi John,.
I just tried a report region based on PL/SQL query encoded using your method to refer to element names in the query string of back:
declare q varchar2(100) := 'select ename, job from emp'; begin if :P2_ENAMES is not null then q := q || ' where ename in :P2_ENAMES'; end if; wwv_flow.debug('*** Query: ' || q); return q; end;
As I suspected, he did not work for me P2_ENAMES was ('KING') or ('KING', 'SMITH'). I think it's because of the reason for which I gave in my previous post - ApEx passes off the coast of the dynamic execution of SQL string, it does not automatically replace the mention: P2_ENAMES with the value of the element. I don't know how it can work for you.
If I change the code I proposed:
declare q varchar2(100) := 'select ename, job from emp'; begin if :P2_ENAMES is not null then q := q || ' where ename in ' || :P2_ENAMES; end if; wwv_flow.debug('*** Query: ' || q); return q; end;
It works very well if one or several names are specified.
I took a blow to modify your code for the construction of the query string - does not immediately guarantee, it'll work because I can't test (might be missing a parenthesis or quotation) it but you should get the idea:
-- start with initial valid query that ApEx can parse to determine column names q := 'SELECT apex_item.checkbox(1, instance_number) ins, apex_item.text(2, i.instance_number) instance_number, apex_item.text(3, i.item_number) item_number, apex_item.text(4, i.description) description, apex_item.text(5, i.serial_number) serial_number, i.party_name, i.status_name FROM cycsi_item_details_v i WHERE i.item_number IN (SELECT v.item_number FROM cycsi_installed_base_v v WHERE v.serial_number = i.serial_number)'; -- add model number condition if specified if :P11_MODEL_NUMBER is not null then q := q || ' AND i.item_number LIKE ''%' || :P11_MODEL_NUMBER || '''%'''; end if; -- add serial numbers condition if specified if :P11_SERIAL_NUMBERS is not null then q := q || ' AND i.serial_number IN (' || :P11_SERIAL_NUMBERS || ')'; end if; -- add FCO id condition if specified if :P5_FCO_ID is not null then q := q || ' AND NOT EXISTS (SELECT d.item_serial_number FROM cy_fco_d d WHERE d.fco_id = ' || :P5_FCO_ID || ' AND d.item_serial_number = i.serial_number)';
I know that has focused on getting this code works, but I would be remiss in my duties if I didn't at least mention the risk of SQL injection. You may already know this, but unless you do a good job to validate the values of the element used in the query, you could open yourself up to a SQL injection attack. For example, imagine what that would be returned if a hacker sharp entered "12345) GOLD (1 = 1" in the field of P11_SERIAL_NUMBERS - you would get all that may or may not be a security problem.
Hope this helps,
John
Maybe you are looking for
-
the printer for printing for iPad e code
Hi everyone, I hope you can help me. Im not sure same as that the right edge to post. I have questions about the devices Mac, Apple devices. They are Android? My HP ENVY 4500 E printer works fine on my MacBook Pro. It works wirelessly with no problem
-
Keyboard Satellite A100-906 after spilled drink
Hello I am owner of a Satellite A100-906 and I spilled liquid on the keyboard.As I read on the official website of the product, the keyboard is the spill-resistant.If I have understood correctly, the keyboard is covered by the warranty in case of spi
-
HP Paviliona6700y seems to have a digital camera in the back. Pardon the stupid question but does that mean I can work around the sound chip on board, connect a D/A converter and get better sound, while putting less strain on the CPU, sort of like an
-
Help with a clean install of W7 upgrade DVD on SSD student.
A 32-bit Vista running, upgrading to 64 - bit by doing a clean install on another drive (SSD). It works fine, except that the old man is still "System" drive and I can't start with the SSD as boot drive. And when I boot the old disk I have the opti
-
ASA 5525 x, ASA CX filtering IPS 9.2
Hello Recently, a customer migrated to ASA 5525 x, ASA OS 9.1 (1). The task now is to implement the prevention of intrusions and keep the module ASA CX. What I read do now two software modules integrated and CX can run simultaneously on an ASA, so my