Want to Elimate 'SYS. ODCIVARCHAR2LIST"by the result of query

Hello

Oracle Version installed is 11.0.2r6. I have a dummy table with data as below:

STID ADDRESS Type_de_fichier
-------- ------------------ ----------------
SALES of ABC 9927 has 0
TRANSFER of XYZ 9927 b 0
TRANSFER of ABC 9927 has 0
TRANSFER of XYZ 9927 b 0

I want that the output voltage:

STID ADDRESS Type_de_fichier
-------- ------------------ ----------------
9927-0 ABC SALES, TRANSFER
TRANSFER of XYZ 9927 b 0

I used 2 methods to achieve the same result, but face some problems.

Method 1:
--------------
SELECT STID, ADDRESS, LISTAGG (File_Type, ',') within THE GROUP (ORDER BY Type_de_fichier) AS file_type
MODELING
STID GROUP, ADDRESS;

I got the output as:

STID ADDRESS Type_de_fichier
-------- ------------------ ----------------
9927-0 ABC SALES, TRANSFER
9927b 0 XYZ, TRANSFER

Method 2:
-------------
SELECT STID,
ADDRESS,
CAST (COLLECT (SEPARATE File_Type) AS SYS. ODCIVARCHAR2LIST) AS File_Type
FROM (SELECT STID, ADDRESS, MODEL Type_de_fichier)
STID GROUP, ADDRESS;

I got the output as:

STID ADDRESS Type_de_fichier
-------- ------------------ ----------------
9927-0 ABC SYS. ODCIVARCHAR2LIST (SALES, TRANSFER)
9927b 0 XYZ SYS. ODCIVARCHAR2LIST (TRANSFER)

Same method 2 gave good result which I like, "SYS. ODCIVARCHAR2LIST"is coming as a prefix in the result. I tried to use the replace, but it does not work. I tried to use the "wm_concat" method, but it does not work.

Can someone help me please to get there? I want a simple Select statement, not the functions/procedures etc.

Thank you
Stéphane.

And what about:

SELECT STID, ADDRESS, LISTAGG(File_Type, ',') WITHIN GROUP (ORDER BY File_Type) AS file_type
FROM (
     SELECT DISTINCT STID, ADDRESS, File_Type
     FROM DUMMY
     )
GROUP BY STID, ADDRESS;

Tags: Database

Similar Questions

  • JavaScript Confirm box depends on the results of query

    Hello

    I use Apex version 3.2.1 and I'm looking for a way to do the following, any help much appreciated:

    A javascript confirm will appear when the user sends a page if the result of a query returns something, the query should look like this...

    SELECT * FROM LINKEDPROJECTS
    WHERE ENV_ID =: P18_ENV_ID
    AND ID_COMP =: P18_COMP_ID
    AND DATE_FROM < = to_date (: P18_DATE_TO, 'DD-MON-YY')
    AND DATE_TO > = to_date (: P18_DATE_FROM, 'DD-MON-YY')

    If it returns no data page will present as usual, if it does not return the data from the confirmation box will appear, and the message will be also the result of a query-driven.

    If the message would be something like...

    Project (s) + "select the NAME OF PROJECTS WHERE ID IN (SELECT PROJ_ID FROM LINKEDPROJECTS WHERE ENV_ID =: P18_ENV_ID +)"
    + AND IDENTIFIANT_COMPOSANT =: P18_COMP_ID +.
    + AND DATE_FROM < = to_date(:P18_DATE_TO, 'DD-MON-YY') +.
    + AND DATE_TO > = to_date (: P18_DATE_FROM, ' MON-JJ-AA "") "+ have this environment for the dates you selected.  Do you want to continue with the reservation?

    By selecting Yes submits the page, select no hands it to the page.

    Had this work now, if it can help someone else out there that's what looked like my javascript in the end...

  • To access the results of query XML MSSQL



    I use MS SQL Server with a query of the form: SELECT * FROM tablename FOR XML AUTO [, XMLDATA]
    (The brackets above to indicate optional use of the XMLDATA option and are not explicit)
    I'm capable of outputting the result in passing the name of the query to CFDUMP so I know that the SQL statement returns the correct information. However, I want to store the XML in a string variable, in the end to go to XMLParse (for example).

    How to access the ResultSet? Columns in the table are not relevant in the case of XML output.

    Nevermind, sorted it.

    For anyone interested, the answer is that the query can be serialized to a string via CFWDDX.

  • In the results of query with consecutive Dates

    I have a table like this:

    volume of queue data_date
    01/09/01 2324, 353
    01/09/03 2324, 34
    2324 01/09/04 43
    2325 01/09/01 53
    01/09/02 2325, 66


    I want to have output like this:

    volume of queue data_date
    01/09/01 2324, 353
    * 2324 01/09/02 0 *.
    01/09/03 2324, 34
    2324 01/09/04 43
    2325 01/09/01 53
    01/09/02 2325, 66

    Note the filled in date 01/09/02.

    What I'm doing now is using a function table in select pipeline than iteratates the date of the execution of a statement range for each date and make a current output. A little slow, but faster than the old solution below.

    I also define operations using a single query that contains trade unions and disadvantages. This has proved to be slow.

    The only thing I have not tried is to have a stored proc popuate the value 0 for the missing date.

    Is there another way to do that is effective?

    I use a 10g database, but soon the data will be brought to a 11g.

    Welcome to the forums!

    I would say that one of the best ways on the latest versions of Oracle using the PARTITION OUTER JOIN.

    See the following link for examples/explanation: partition outer join in oracle 10 g

  • Display of the results of query in Excel on the Web

    Hello

    I try to display data from a query in excel on the web without creating an existing file. I know I can create a CSV using UTL_FILE and post it but I was hoping there was a way to do it without actually creating the file. I have a procedure that resembles

    PROCEDURE displayAsCSV is
    cursor STUD_CURS is
    Select * from students;

    BEGIN
    for STUD_REC loop STUD_CURS
    HTP. Print (' "' |") STUD_REC. FIRST_NAME. » " , " '|| STUD_REC. LAST_NAME. » " ');
    end loop;
    END;

    Anyone know if it is possible to display these results in excel in the browser by altering the MIME types or something similar?

    Thank you

    Check Tom owa_sylk utility with the appropriate mime type.

  • How to use the result of widget radio selection to 'show' a text box?

    Hello again,

    I have a question about widgets.

    What I want to do is to take the result of radio button widgets (in this case 1 2 rather long sentences that were available) and which will display a text box on another screen.

    Background: I have a series of slides where I ask the questions of the learner through Radio button widgets and so I get a number of variables (= penalty) they choose.

    The question I have is that I want to display all the choices they made on 1 page. Because the possible answers are relatively long I have run out of space if I simply inserts

    variables to shown as such and/or the police gets too small.

    So my idea is to use the answer that they choose to make a text box with a shorter version of the same appearo of sentence on this slide 'results '.

    So my idea is to have the learner to make their selection, then use a tip action to check what answer (= the option button), they clicked on.

    What I would do through "If XYZ variable ' 'contains (a keyword of the long sentence)' then 'show textbox YZ' etc.

    Question 1: Is this the most simple/more convenient way or I can save me time somwhow?

    2 "contain" a medium of action adv. the exact text or it may be just one of the words (out of the long sentence that could be selected)? I ask because then I have to use the same long exact phrase in the NOA that seems awkward.

    3. I need to create a separate fast action for each radio widget, I've used. Is this correct?

    4 if I then say 5 adv. actions for different questions, I asked what should trigger these advanc. action? The goal is just to shorten the long sentences in the selections made?

    If I use ' enter' for all the screen I just started one, I haven´t?

    Many probably incorrect assumptions, on my part, I guess...

    Any help is greatly appreciated!

    In my example the var who will get the short sentence is v_class. It's always the variable associated with the interaction of radio buttons. You have as much of these variables to be inserted on the last slide you have interactions button radio please never enter the variable to insert, but use the X button in the role of composition of the properties panel for the text container. Variables are case sensitive, in this way, you will avoid typos.

  • Send the results of the script by email

    OK, time to reach out for a little help;

    I'm looking to receive a daily report or weekly at the time stated on all of my guests. I restored code (below), but at this point, I get an empty email for each host. The script runs and displays in the ok command window, but I want to receive an email, with the result declared all hosts. When executing this now, the command window reports 'Time on $host1 in the allowed range' if it is understood naturally, or offer lag.

    I have serached and tried various methods of the call to this function to send mail, but can someone take a look and recommend a better way?

    script:

    > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >

    $allowedDifferenceSeconds = 20

    Notice-EEG - ViewType HostSystem-Property Name, ConfigManager.DateTimeSystem. %{
    datetime #get host system
    $dts = get-view $_. ConfigManager.DateTimeSystem

    time to host #get
    $t = $dts. QueryDateTime()

    #calculate time difference in seconds
    $s = ($t - [DateTime]: UtcNow). TotalSeconds

    #check so lag is too much
    {if ([Math]: ABS ($s) - gt $allowedDifferenceSeconds)}
    #print host difference and the time in seconds
    $row = "" | Select the host name, seconds
    $row. Hostname = $_. Name
    $row. Seconds = $s
    $row
    }
    else {}
    Write-Host "time on" $_. Name "to the bosom of the beach permit"

    $smtpSrv = "SMTP.domaine.com".
    $from = "[email protected]".
    $to = "[email protected]".
    $subject = "VM host time report.


    $msg = new-object Net.Mail.MailMessage ($from, $to, $subject, $body)

    $smtp = new-object Net.Mail.SMTPclient ($smtpSrv)

    $smtp.send ($msg)

    }

    > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >

    Try something like this

    $allowedDifferenceSeconds = 20 $body = $null 
    
    get-view -ViewType HostSystem -Property Name, ConfigManager.DateTimeSystem  | %{
        #get host datetime system    $dts = get-view $_.ConfigManager.DateTimeSystem
    
        #get host time    $t = $dts.QueryDateTime()
    
        #calculate time difference in seconds    $s = ( $t - [DateTime]::UtcNow).TotalSeconds
    
        #check if time difference is too much    if([math]::abs($s) -gt $allowedDifferenceSeconds){
            #print host and time difference in seconds        $body += ("On " + $_.Name + " the time difference is "  + $s + " seconds`r" | Out-String)
        }
        else{
            $body +=  ("Time on " + $_.Name + " within allowed range`r" | Out-String)
        }
    }
    
    $smtpSrv = "smtp.domain.com"$from = "[email protected]"$to = "[email protected]"$subject = "VM Host Time Report"
    $msg = new-object Net.Mail.MailMessage($from,$to,$subject,$body)
    
    $smtp = new-object Net.Mail.SMTPclient($smtpSrv)
    
    $smtp.send($msg)
    
  • In the query in Oracle 11 g, how can I refer to the results of different column...

    I want to be able to view the results of C1 to another expression of the column C2. I get ORA-00904: identifier not valid "C1", which makes sense. I know that I can repeat the WHOLE very long in my C2 DECODER, but I was wondering if I can register the server many additional cycles to assess the CASE once again.

    SELECT [long nested CASE statements] as C1, C2 OF table DECODE(C1,1,'YES','NO')

    Thank you very much
    AK

    Hello

    Impossible to refer to the alias at the same or another must therefore repeat the instruction BOX or wrap it in a view online and refer to the alias in that. i.e.

    SELECT
        c1,
        DECODE(C1,1,'YES','NO') as C2
    FROM
        (
            SELECT
                [very long nested CASE statements] as C1
            FROM
                FROM TABLE
        )
    

    HTH

    David

  • I use google search. When I click on a suggestion contained in the results tab of the search, I want it to open in a new tab and keep the search results in the original tab. How?

    For example, when I enter the search term "cabinets" and get a page/tab search results with suggestions such as Sears, JCPenney, or Amazon, I want to be able to click on Sears and open the Sears page in a new tab/page. I want to be able to close the tab to Sears and use the search results tab.

    Google offers a framework for this. What it does, it adds a HTML (target = "blank") statement to every result link, which causes Firefox to open in a new tab. If you uncheck the preference to divert new windows in new tabs, Firefox will then open the result in a new separate window.

    This preference is stored in a cookie, if you clear your Google cookies often, so you'll need to reset every time. You can do so here:

    https://www.Google.com/preferences

    (On this page, Google refers to a new window.)

  • Delete the results if the user wants to redo the last test

    Hello

    I'm trying to implement a local user to ask them if they want to repeat the last test that failed. So then... Delete the result, and then rerun the sequence.

    Can you see what I'm doing wrong?

    Chris

    Have you seen this example?  It works for you?

    http://www.NI.com/example/27153/en/

  • I want to uninstall a toolbar that has been the result of the search for something specific

    Hello

    I want to uninstall a toolbar that has been the result of the search for printable piano music.
    I uninstalled the stuff accompanying this research but I can't get rid of the toolbar. Can I just download an another toolbar as C.NET or what?

    I have a Dell dimension 4700 desktop, XP and I have ' yet to learn through this forum help and everyone.

    Thank you

    Gina Davis

    Original title: how to uninstall toolbat Inbox

    (IE unknown version)

    Hello

    Tools are what bar you referring? That's a browser or another program?


    Method 1:
    Run this fixit to remove it completely.

    http://support.Microsoft.com/mats/Program_Install_and_Uninstall/

    Method 2:
    You can uninstall the toolbar by following the steps below:
    a. open your Internet browser.
    b. click on 'Tools' then 'Add-ons' in IE; Click on "Tools" and "Manage Add-ons."
    c. find the add-on "Toolbar" in the list of available modules.
    d. remove the add-on toolbar in Internet Explorer, select the toolbar and click "disable".
    If you want to remove the toolbar, you can do this by uninstalling it in Add or remove programs.


    Also visit these links to learn more:
    http://TechNet.Microsoft.com/en-us/magazine/dd364987.aspx
  • How can I preview my photo on the second monitor fullscreen? I mean I want to live broadcast the result without saving the file

    I want to see the result of my editing on the second monitor for broadcasting

    Click on the new window to make it active and go view > screen mode > full screen or press the f button a couple of times.

    [EDIT]  CTRL 0 will make the zoom image to fit the screen.  CTRL Alt 0 will make the image zoom to actual pixels size.  Note that these are zeros, not the letter O.

  • A search criterion and the result as a table in the header. Wanted to bind the result table to bean to access the value of the key

    The search criteria and the result is displayed in the table in a group header.  I want to get the value of the selected row and analyze the value of Vo in the next page for a variable binding. So I need to manage the value biniding to the bean tbal, but there is no option to bind the table to a bean. So, how can I get the selected value.

    Kind regards

    K M Krishna.

    First tell us your version of jdev, please.

    to get to the selected line you need not to link the table to a managed bean. You can for example drag the necessary attributes of the VO on the page and drop them as components of a inputText. the framework then generated the attribute bindings and sets the values of the current row for them. As you do not really need the inputText elements switch to source view (! it is essential!), then remove them. This will eliminate the Visual component, but attribute bindings are stored.

    Know you can access the values through their EL or as you get the value of an attribute via it's mandatory.

    Timo

  • You want to include spaces in the results in the text field.

    Hi all

    Please help with possible means.
    I want to ge the output of a test classified in the results as such.
    I need to get a < space > then the names.
    for example I want < space > < space > and then test on the ground in my report of responses.
    Currently, when I give ' ' and concat it with the name column it provides two spaces at the beginning.

    Other ways to do it.

    Kind regards
    Bla

    Hi Kim,

    Try this, go to the properties of column-> change-> Dataformat treat text as drop down-> text gross (do not break spaces).
    This will allow spaces.

    Thank you
    Vino

  • Want to write the results to submit the login form to log on the server

    I cooked up a little family site to share memories and old photos. This is a members only site and I use a PHP login script that compares the user name and password to a list.

    I would like to know
    (a) if someone tries to guess their way in.
    (b) If a member is having connection problems... We have a few not so computer savvy family members which eventually get frustrated and give up.
    (c) whose members are logging... It is a new effort, to run one year on a trial basis... and it is worth.

    To do this, I add code to take the results of any shipment (on my login form) and to add the results of this to some sort of log file that I can periodically review. Because the foundations are in place this (I think) not an otherwise difficult task. But I have no idea on how to do this and hope someone can show me.

    Thank you for your time and help

    Ralph

    If it helps, it's the PHP code that I guess deals with the connection.

    / Repairable none by the user under this item. */

    $php_self = $_SERVER ['PHP_SELF'];

    / * Clean up variables: we only do $user and $password of the form. */
    $submit = $_POST ['submit'];
    $user = ";
    $password = ";
    If ($_GET ['user']) {}
    $user = $_GET ['user'];
    $password = $_GET ["password"];
    }
    If ($_POST ['user']) {}
    $user = $_POST ['user'];
    $password = $_POST ["password"];
    }

    session_start();

    / * Check the couple login/password until you find the one that is correct, or re-display the login form. */
    $loginsuccessful = FALSE;

    {foreach ($authorization as $loginpair)}
    {If (($user == $loginpair[0]) & & ($password == {$loginpair [1]}))}
    $_SESSION ['user'] = $user;
    $_SESSION ["password"] = $password;
    $loginsuccessful = TRUE;
    }
    {If (($_SESSION ['user'] == $loginpair[0]) & & ($_SESSION ['password'] == {$loginpair [1]}))}
    $loginsuccessful = TRUE;
    }
    }

    If ($loginsuccessful = TRUE) {}
    / * The user is connected, go on our merry way. */
    echo $loginmsg;
    } else {}
    / * User does not match our valid connection, their decline to the form. */
    $loginmsg = "invalid username or password";
    require ($indexphp);
    "exit";
    }

    No, it's not particularly difficult. Of course, you use a login script you obtained, because the code is very different from the one generated by Dreamweaver. Judging from the code, you do not use a database to store the usernames and passwords. Thus, you probably want to save the details of an external text file.

    Add the following code where indicated:

    if ($_POST['user']) {
        $user = $_POST['user'];
        $password = $_POST['password'];
    }
    
    // New code goes here
    
    $logfile = 'log.txt';
    $date = date('j M Y H:i:s');
    $address = 'Unknown';
    if (isset($_SERVER['REMOTE_ADDR'])) {
         $address = $_SERVER['REMOTE_ADDR'];
    }
    if ($file = fopen($logfile, 'a')) {
      fwrite($file, "\r\n$date $address $user $password");
      fclose($file);
    }
    
    // end of new code
    
    session_start();
    

    This will create a text file named log.txt in the same folder as the logon script. Since it is a text file, it should ideally be outside the root of the web server, then you must change the value of $logfile to point to a file outside of the root of the server, but in a folder where the script is allowed to write.

    Whenever someone tries to connect, it will record the date and time, IP address, if known, and the user name and password submitted.

    Once you got this job, I suggest you change the following line:

    if ($file = fopen($logfile, 'a')) {
    

    Change to this:

    if ($file = @fopen($logfile, 'a')) {
    

    This will remove any error message if the script is unable to open the log file. However, you should not do that change until you have things market, because deleting an error will prevent you to discover what the problem is if this does not work.

Maybe you are looking for

  • Use WAN connected airport Time Capsule as a wireless access point

    I had to replace a failed 4 Gen Time Capsule. I tried to install a new Gen 5 airport TimeCapsule via WAN and set up the airport to act as a wireless access point. It is installed in an area of my house with wireless coverage. In the network of AirPor

  • Need drivers for Satellite s1900 704

    Hello I need to all drivers and utilities for my Satellite 1900-704.The operating system is windows xp and I can't find the drivers on the home page.

  • HP mini 110-3605tu: bios of hp mini 110-3605tu

    My mini hp laptop number 110-3605tu model is oriented stuck after windows 7 installation charge. However, there is no hard drive hard drive recovery being entirely formatted. I want to Flash my bios because I know the bios is damaged. Please give me

  • cannot attach files on hotmail on mac lion

    I have an iMac and recently upgraded to the Lion operating system. But now we cannot attach files on our hotmail account. Pls help

  • I lost my saved games in the game menu pop-up list.

    I'm on Vista my games menu would let me do a right click on a game and that I would see my saved games. I could just click on it and it would launch the game using this saved game. After I upgraded to Win7 (pro), it seems to be lost.  Is there some s