Is there a way to enter a list of expressions in one variable?

I have a query like this:

SQL > select distinct t1.name of people join t1 t2 on t1.id = t2.people_id join who_likes_what leisure t3 on t3.id = t2.hobbies_id and t3.text ("music", "horses") Group of t1.name having count (t3.text) = 2;

NAME

--------------------

Bob

Amy

(2 is the number of elements in ('music', 'Horses'))

1. is there a way to set the list of expression in a single variable?

"Having my brain turns off I had thought that if I created a (unique) string variable that contains the value '('Musique', 'Chevaux') ' I would be done.

I understand why it may not work, but I don't know how to replace it with a single variable.

I may not want to use (: var_1,: var_2,: var_n) because the number of items in the list expression is variable, and I use a prepared statement SQL.

In the other thread, I've already been advised to use a single as string "music ~ horses and the following construction:"

Select regexp_substr(:set_1 ||) (' ~ ',' [^ ~] +', 1, level) double txt

but is there a way to do this directly?

2. is there a function that returns the number of items in a list of expression?

(to get 2 for 1 entry).

Thanks for any suggestions.

[Update: new tests, it seems that the PL/SQL function is not necessary!] I could link a collection directly to SQL, at least in 12 c. See my post below with details].

Here is a simple example of a PL/SQL function that receives a collection, it uses SQL and passes the result to the caller.

First of all, I'll use a collection type that is already defined: SYS.dbms_debug_vc2coll, which is defined as follows:

create or replace TYPE dbms_debug_vc2coll is table of varchar2(1000)

Now, here's a function that takes as input a collection of that type, and returns a REF CURSOR over the result set.

create or replace function get_rset (
  p_inset in SYS.dbms_debug_vc2coll
)
return sys_refcursor is
  l_refcur sys_refcursor;
begin
  open l_refcur for select * from table(p_inset);
  return l_refcur;
end get_rset;
/

We can test this function in SQL * longer or Oracle SQL Developer:

var v_refcur refcursor;

exec :v_refcur := get_rset(SYS.dbms_debug_vc2coll('Music', 'Horses'));
print :v_refcur;

COLUMN_VALUE

------------

Music

Horses

Tags: Database

Similar Questions

  • Is there a way to get a list of all applications / updates that are cached on your server?

    Is there a way to get a list of all applications / updates that are cached on your server?  Of course, we see the space that contains each category.  But I would like a detailed list of the individual items that are actually cached.

    ITD be even better if I could get a scoreboard that showed me how many times a particular point was served to customers.

    Yes.  But you need a little magic Terminal to get the desired data.  Caching server is managed by a sqlite database.  To examine the contents, follow these basic steps:

    1: connect to the database using the following command:

    sudo sqlite3 /Library/Server/Caching/Data/AssetInfo.db

    2: to structure the data, run these two commands to the sqlite command-line prompt:

    .blog column

    . Headers on

    3: to find everything that is stored, run this command (you'll get iCloud cached documents, books, iOS apps, etc.):

    Select * from ZASSET;

    4: to narrow the results down to elements called by software updates, try this:

    Select * from ZASSET where ZURI as "content %";

    You could get a line that looks similar to the following:

    403 2 6 0 2012986793 474949928.477396 476912032.644505 e03448847909547fb8c7d4ecd5a7b6dd FAB32A72-DE33-469D-A7DF-3CE1A1F9A4D2 on Wednesday, August 5, 2015 18:00:30 GMT

    / Content/downloads/42/44/031-30888/bhrkylcnycxmtug9daw3g4magqb7dl7hba/OSXUpdComb o10.1

    (added the newline for readability)

    It is an OS X Combo update.  It is located on the drive to library/server/cache/Data/FAB32A72-DE33-469D-A7DF-3CE1A1F9A4D2 / the file is probably named 0, but if you want to use it, just add at the end of the .pkg file.

    I hope this helps.  Put server cache saves a lot of data.

    Oh, to quit the sqlite command line tool, simply type .quit and press return.

    Reid

    Apple Consultants Network

    Author - "El Capitan Server - Foundation Services.

    Author - "El Capitan Server - Collaboration & control»

    Author - "El Capitan Server - Advanced Services '.

    : IBooks exclusively available in Apple store

  • Is there a way to get a list of all installed applications?

    Is there a way to get a list of all installed applications?

    You can submit a request to have such an API and provided good use. It also helps to get other developers can vote on it.

  • Is there a way to sort the list of subscribers by last name?

    Is there a way to sort the list of subscribers by last name?

    CurrentY it is sorted by full name, sort alphabetically by first name. I would prefer to sort by last name.

    Hello

    Not within the system, unfortunately.  The solution is to export the report and manually separating full names into first and last name columns to get what you're after.

    It is currently on our wish list to improve in the future.

    Kind regards

    -Sidney

  • Is there a way to copy properties to disable conditional from one project to another?

    I have a bit of code in a project that I want to back off to a colleague and want to do a new 'reduced' project with only a few subvis.  I don't want to necessarily or need him for the entire project, but only access to a privileged few.  Is there a way to copy the conditional disable properties from one project to another?

    Thank you

    Tech12

    Thanks, it works, but I couldn't get the symbols will appear in the 'project' "Properties..."

    Tech12

  • Is there a way I can recover my Outlook Express email. I hate Windows live mail and want to come back to Outlook Express. I have Windows 7.

    Is there a way I can recover my Outlook Express e-mail account.  I downloaded Windows Live Mail and don't like it at all.  I can't understand how to add a new contact.

    You post in a forum of Vista and Outlook Express last used in XP. If you mean Vista Windows Mail, unless you have removed the account, just open the program and use it. You can remove WLMail whenever you want. It is a part of the programs in the window Live Essentials Control Panel uninstall section.

  • I have 300 pictures in the section 'develop' Edition. I would like to make all B & W. is there a way to make all B & W rather than one by one?

    I have 300 pictures in the section 'develop' Edition. I would like to make all B & W. is there a way to make all B & W rather than one by one?

    Hi Kates,

    You can always apply the same develop settings of an image at all.

    Please follow this link and it should be useful:

    https://helpx.Adobe.com/Lightroom/help/develop-module-options.html

    Please let us know if this helps

    Kind regards

    Tanuj

  • Is there a way to copy / transfer / export existing assets from one site to the other?

    Is there a way to copy / transfer / export existing assets from one site to the other?

    I have like 20 + documents in one of my sites that I need to transfer to another site... What is a quick way to do without re - upload all my new Web site?

    Anyway, you would still re - download.

    If they are both sites of Muse you can open sites in Muse and copy and paste the desired content moved above.

  • Is there a way to force the list of databases Access, rather than having the giant icons in my taskbar?

    When I have a few databases open, my taskbar has an icon for each file that is opened in a sloppy "battery."  Naturally, when I hover over the battery, miniature windows display each file.  After that I have a good number of them open (for example, around 10, 11 or 12), stacked icons convert a vertical list.  Is there a way to force this vertical list, even with also open some two or more db?

    If you have Windows 7 Pro or Ultimate, you can use Group Policy.  Otherwise, you will need to perform a small registry change.

    For Pro or Ultimate, see method 1 here--> http://helpdeskgeek.com/windows-7/disable-taskbar-thumbnail-previews-windows-7/

    For any version of Windows 7 (also allows you to set the number of preview windows that appear before moving on to the list), see--> http://www.sevenforums.com/tutorials/75804-taskbar-list-thumbnail-previews-mode-change.html

  • Is there a way to get the list of hosts and its groups of belonging to the vCenter folder level in 5.5 web vsphere client plugin development?

    Hello

    I need to get the list of all hosts and its groups of belonging to the vcenter folder level.

    1. I created a view giving the extension point: vsphere.core.folder.monitorViews.

    2. After this step, I wrote the constraint as in my class of mediator,

    var ListConstraint:Constraint =

    QuerySpecUtil.createConstraintForRelationship ( _contextObject, 'childEntity');

    I was expecting a list of all child entities such as hosts, dc, cluster... But I have only the immediate child object which is only the Datacenter as my result.

    Is it possible to get all hosts and vCenter folder level Clusters because I need the entire list to vCenter (highest level).

    Other info:

    Object file has only two properties:

    1 childEntity - list of entities

    2 childType in-kind folder ('Virtual Machine', 'Data center'...)

    Is it possible to write a constraint specifying which list of childEntities I need using childType in.

    Example: Make Me childEntities that has a 'Host' and 'Cluster' childType but childType in doesn't have these two types.

    In addition, at this level, I could see the 'Associated objects' tab which has all the information I need, such as Clusters and Cluster tab hosts and host tab respectively.

    So, I think its possible to get this list to vCenter folder level.

    I have attached a screenshot representing the need. Kindly ignore the Conventions of naming in there since I edited the example comes with the sdk program.


    Query:

    1. How can I get the host and Cluster (table of relationship) list to vCenter folder level or even at the level of the vise.global.view?

    2. once I get this list, is it possible for me to manipulate that list and send the new list to IU?

    3. is there another way to do the same thing without the help of model classes and mediator?


    Pointers to this will be very useful.

    It is not possible to obtain all hosts a folder specific vCenter from a single query Data Manager.  You need to get the list of centers of data first and then get a list of data center hosts.

    It is best to make these repeated requests to the java level and return only the list that you want to the user interface.

    You can get all the objects in the host of the system with a simple query using a constraint with targetType = 'HostSystem', but you will need to eliminate those from other vCenter servers.  See how this chassis example queries all hosts the Java later in the getHosts() method: samples/chassis-app/chassisRackVSphere-service/src/main/java/com/vmware/samples/chassisRackVSphere/ChassisRackVSphereDataAdapter.java

    Another option is to use the vSphere Web Services SDK to browse vCenter. See the vSphere management forum for help on these APIs.  See this plugin of the sample using this SDK

    samples/vsphereviews/vsphere-wssdk-provider/src/main/java/com/vmware/samples/wssdkprovider/VmDataProviderImpl.java

  • Is there a way to get a list of tables with multi-column primary keys?

    I have a model over 1000 tables, each containing primary and some keys with unique indexes.  I need a list of multi-column primary keys and a list of the unique indexes that are not the primary key.  Is there a way this information easily?

    I have a generator that creates the merge instructions and I needed a way to retrieve the PK, if any, UK and otherwise the first Unique Index.  This comes from a cursor, so there are some variables for the schema and the name of the table and a constant for pk 'P' and 'U '.

    -- Primary/Unique Key
    SELECT   *
    FROM     dba_cons_columns concol, dba_constraints con
    WHERE    concol.owner = UPPER ( pv_schema )
    AND      concol.table_name = UPPER ( pv_table_name )
    AND      ( con.constraint_type = const.v_constraint_primary
    OR        ( con.constraint_type = const.v_constraint_unique
    AND        NOT EXISTS
                 (SELECT NULL
                  FROM   dba_constraints conx
                  WHERE  conx.constraint_type = const.v_constraint_primary
                  AND    conx.owner = con.owner
                  AND    conx.table_name = con.table_name
                  AND    conx.constraint_name = con.constraint_name) ) )
    AND      concol.owner = con.owner
    AND      concol.table_name = con.table_name
    AND      concol.constraint_name = con.constraint_name;
    
    -- Unique Index
    SELECT *
    FROM   dba_ind_columns indcol,
           (SELECT   indcol.table_owner,
                     indcol.table_name,
                     indcol.index_owner,
                     MIN ( indcol.index_name ) min_index_name
            FROM     dba_ind_columns indcol, dba_indexes ind
            WHERE    ind.index_type = 'NORMAL'
            AND      ind.uniqueness = 'UNIQUE'
            AND      indcol.table_owner = UPPER ( pv_schema )
            AND      indcol.table_name = UPPER ( pv_table_name )
            AND      indcol.table_owner = ind.table_owner
            AND      indcol.table_name = ind.table_name
            AND      indcol.index_owner = ind.owner
            AND      indcol.index_owner = indcol.table_owner
            AND      indcol.index_name = ind.index_name
            GROUP BY indcol.table_owner,
                     indcol.table_name,
                     indcol.index_owner) ind
    WHERE  indcol.table_owner = ind.table_owner
    AND    indcol.table_name = ind.table_name
    AND    indcol.index_owner = ind.index_owner
    AND    indcol.index_name = ind.min_index_name;
    
  • Is there a way to generate a list of names of files in an album?

    I want to generate a list of the contents in an album (photos in the album are spread over various issues). I need the full path names, such as:

    C:\ThisFolder\Thatpic.jpg

    C:\ThatFolder\Thispic.jpg

    etc.

    Is there a way to do it or should I go through the tedious process of manually check the location of the file for each photo in the album?

    function() {return A.apply (null, [this] .concat ($A (arguments)))}

    Is the "file_albums.csv" file... contain data that lookes like it (give a full path to the file name):

    Yes.

    The file "file.csv" includes a column of Album name for each file?

    He did a 'Albums' column, giving the list of albums that each file is current.  And it has a 'Positions of the Album' column, giving to the corresponding locations of the file to each of these albums.

    I have attached sample output for a 4-photo catalog with two albums.

  • Is there a way to get the list of open URL of file (.dmp) incident, mdmp [NOT BE]

    Hello

    My Firefox session crashed, which was little in private meetings. I have the mdmp (.dmp file) dump file saved. Is there anyway that I can get the list of URLS open in private in windows.

    If so, how to read the file OR open it for debugging.

    Kind regards
    bnrsubs

    All data are kept in memory during the session in incognito mode and will never be saved on the hard disk, so these data are available for normal use and things like restore closed tabs and windows and cookies still function as in a normal session, but this data is deleted from all the private browsing mode Windows Open (tabs) are closed.

  • Is there a way to see that list under a contact is a member of the address book?

    I would like to know that a contact in the list. IE Test of Contact is in the personal address book. Do you want to be able to look at the details of the Test and that the Test is in the friends list and the list of the golfer, but not in the list of others I might have.

    I think that this module will allow you to do.

    https://freeshell.de/~kaosmos/morecols-en.html

  • Is there a way to sort the list of the split view icon?

    When I try to choose an application in split view, I am presented with a huge list of icons I have to travel to get to that I want to use.

    Is it possible to exclude applications from this list, or to specify the sort order?

    The only setting I could find is to turn multitasking off altogether, but this isn't what I want. I want to just limit the size of this list.

    Currently no.

Maybe you are looking for

  • Toshiba 55WL768 - slow change of channel SAT + no signal message

    Hello forum,. I need help because television 55wl768 responding really slow down usually when I change the channel. Often, I see the black channels with the message 'lack of signal', but there is.What can I do to solve my problem? Thank you very much

  • Cannot install the FPGA

    Hi, we fall 2012 Labview, Labview from the iso so that iso 1-4 of the tools additional xilinux compilation. We have installed labview OK and then tried to install module FPGA, but it can't find the module on one of the iso. Can you please advise. Tha

  • Start up and close down jingles disappeared

    Sounds related to Microsoft Windows (opening jingle, e-mail alert, etc.) have stopped. Speakers work fully.

  • I get error scanner in my HP solutions

    I have recently updated from Windows XP to Windows 7 Pro 64 and now my Hp Officejet 6300 all-in-one does not have to be analysed as before in pdf format - I downloaded the new drivers and comprehensive on the HP site and installed software, but when

  • OfficeJet 4500 All in one, fatal error during installation

    G510g, model CB867A, OS is Windows Vista, USB connection I tried installing and uninstalling 3 times now and reached the point of frustration, of research and try to solve problems on my own. Fatal error, Installer has sufficient privileges to modify