A loop in a refcursor for the list of dates as a string

Hello
I have a simple procedure that gives me the list of dates and dates
I need to get the dates dates separated by commas
I don't know if this can be done directly by making a loop on the refcursor or I have to go pick her up in a file/table and then concatenate with comma, or is there anything else that can be done.
I tried some stuff like below

PS help out me
the procedure is that returns the list of dates
CREATE OR REPLACE procedure SALUSER.prm_sp_rpt_payslip_lop_dates(p_empid in int,p_tran_year in int,p_tran_month in integer,o_dates out sys_refcursor)
as
begin
 open o_dates for select  to_char(PHL_LOP_FROM,'DD-Mon-YYYY'),to_char(PHL_LOP_TO,'DD-Mon-yyyy') 
                 from prm_h_lop
                 where phl_emp_id=p_empid
                   and phl_tran_year=p_tran_year
                   and phl_Tran_month=p_tran_month;

               
 end;
/
I need my o/p as
dates :<date1>,<date2>...etc
Kind regards

Maybe sth. as

SQL>  var cur refcursor

SQL>  declare
 cr sys_refcursor;
 procedure prm_sp_rpt_payslip_lop_dates (cr in out sys_refcursor)
 as
 begin
   open cr for select hiredate from emp;
 end prm_sp_rpt_payslip_lop_dates;
begin
 prm_sp_rpt_payslip_lop_dates(cr);
 open :cur for select 'Dates: ' || column_value dates from xmltable('string-join(//text(), ", ")' passing xmltype(cr));
end;
/
PL/SQL procedure successfully completed.

SQL>  print cur

DATES
--------------------------------------------------------------------------------
Dates: 17-Dec-1980, 20-Feb-1981, 22-Feb-1981, 02-Apr-1981, 28-Sep-1981, 01-May-1
981, 09-Jun-1981, 19-Apr-1987, 17-Nov-1981, 08-Sep-1981, 23-May-1987, 03-Dec-198
1, 03-Dec-1981, 23-Jan-1982                                                     

1 row selected.

Tags: Database

Similar Questions

  • Query for the list of dates

    Hello

    I have a column called period and there dates with all Fridays in it until the end of October. I want to list all the dates only until last Friday. For example, I have values below

    07/01/11
    08/07/11
    07/15/11
    07/22/11
    07/29/11
    05/08/11
    12/08/11
    19/08/11
    26/08/11
    02/09/11
    09/09/11
    ......

    I want to list all the values until last Friday. For example today it should show me data only until 08/26/11. Next week it should show me data only until 09/02/11 and so on. How to write an application to do?

    Thanks for your time and your help.

    Hello

    Assuming that the time data type is DATE, and this delay is not necessarily a Friday, you can do somehting like:

    WHERE   period <= TRUNC (SYSDATE + 3, 'IW') - 3
    

    This is not your NLS settings.

    If you run this on Friday, 2 September, then he will understand until September 2 itself.

    The 'magic number' 3 reflects makes that your week begins 3 days before the ISO week (which begins Monday).

    If you know this period is always a Friday, then it is simpler:

    WHERE   period <= SYSDATE
    

    I hope that answers your question.
    If not, post a small example data (CREATE TABLE and INSERT statements), some examples of performance dates (include at least a Friday) and results desired of each given rundate data of the sample.
    Explain, using specific examples, how you get these results from these data.
    Always tell what version of Oracle you are using.

  • Restarting a task for the acquisition of data inside a For loop

    Hello

    I need iterate through my acquisition of data. Currently, I'm doing this through the creation, implementation and tasks for the acquisition of data inside a loop For which is iterated according to the needs of compensation. Unfortunately, the creation of these DAQ tasks slow down my code.

    I would like to be able to create the tasks outside the loop, pass them in and revive the tasks at the beginning of each iteration. Is there an easy way to do this?

    Otherwise, is there a way to make the standard DAQmx digital startup trigger trigger several times (so that it starts each pulse data acquisition in a long pulse rather than just the first pulse train)?

    Thank you!

    -Evan

    I whent before and created this example for you (and many others.)

  • FRM-30351: no list items defined for the list item

    Hello
    I used a dynamic list, and when I compile this message appears:
    FRM-30351: no list items defined for the list item.

    If the list is not needed, it's just a warning and you can ignore it.

  • Treo 755 p and Windows - HotSync jumps calendar and Agenda - "Conduit DateCond.dll: no link found for the Creator ID 'date'." Conduit did not run. »

    I've owned a 755 p for almost a year now. For much of this time, my hotsyncs were jumping the Calendar/Contacts and calendar apps. These two work very well on the Palm Desktop and on the Treo itself. I checked the unit and the palm Desktop for corrupt files. There are not. When I was with Palm Desktop 4 (before 6 is available for XP), the lines were always listed as disabled. I could help and do a hotsync, but no data has been synchronized and would return to being disabled. If I tried to set it as enabled by default, the Hotsync application would break! So, I've lived with this absurd situation for 6 months now. Finally, I tried upgrading to Palm Desktop 6.2 and had no problem, but the problem persists. HotSync on the desktop PC simply ignores these lines entirely, even if it does not display error messages after a sync. The lines are listed as enabled.

    I made a full backup and then uninstalled Palm Desktop 6.2 completely. Restarted and re-installed Palm Desktop 6.2 and tried to sync again. The problem persists.

    My next step (and where I am now) would allow to debug and documented in the Hotsync application logging. Once I did, I discovered the specific problem, which apparently is entirely hidden from the end user. Here are the specific journal entries:

    Led DateCond.dll: No association is found for the Creator ID "date." Conduit does not run.

    Led DateCond.dll: No association is found for the Creator ID "SNLT". Conduit does not run.

    Led AddrCond.dll: No association is found for the Creator ID 'addr '. Conduit does not run.

    Led AddrCond.dll: No association is found for the Creator ID "PAdd". Conduit does not run.

    I was not able to find something on the Internet about these errors. Nothing on the Palm site, nothing in these forums. I checked the database files are indeed on the handheld and have good creator ID. I don't understand how a complete re-installation of software still leaves it with a kind of missing association. But clearly there is something that lack prevents Hotsync to understand exactly what it is supposed to do here.

    I can't just wipe my machine and start over. I have a lot of contacts and calendar on the device entries that are not on my PC and vice versa. Find and fix all those differences manually would be months of work with my limited free time. So if anyone has any suggestions on how to solve this problem, please let me know. And no, I'm not going to waste time calling support Palm. I gave up on the phone with Palm years ago support.

    It's part of the problem. You might want to hard reset the device, and then rename the folder to BACKUP on the PC. (CProgram Files/Palm or Palmone / * Hotsync username * / Backup.) Change to the old files then synchronize with your existing username.

    Message relates to: None

  • How will I know if I am being charged for the use of data on the mini2 ipad

    How will I know if I am to be charged or billed for usage on my ipad mini data 2?

    Hello

    You can be charged for the use of data on an ipad, if it has a SIM card

    Cellular data.

    If your home wifi is unlimited you will not be charged more.

    Unless your WiFi has a hat of data ie download limit.

    See you soon

    Brian

  • What type of connections I do for the acquisition of data PCI 619 card pins? What I have to give it to the ground and the CCV on the pins of the connector myself? What should be the value of the SCR I need to give to the PIN?

    I have a PCI 6519 data acquisition card. I want to install it on the PC and use it outputs to control a robot. I have problems with the connections to the terminal block which is attached to the cable.

    What type of connections I do for the acquisition of data PCI 619 card pins? What I have to give it to the ground and the CCV on the pins of the connector myself? What should be the value of the SCR I need to give to the PIN?


  • Use two assistants for the acquisition of data at the same time

    Hello

    I want to read multiple data channels of analog inputs on my DAQ hardware. However, when I try to create two separate data acquisition assistants for each entry, it gives an error saying "is reserved for the specified resource. The operation could not be performed as indicated "." Can't use two assistants for the acquisition of data at the same time?

    I have to add different channels in the same assistant DAQ? I tried, but I couldn't separate the data in different graphs.

    How does this work?

    Kind regards

    Allard

    You can't have multiple tasks of the same type (in this case inputs analog) on the same device.  Just so having 1 DAQ Assistant read all your channels and separate your channels for individual transformation.

  • Get errors for the user input data filter no KB 911895 HID

    OT: iI have windows xp S/P 3 installed also apple i pad I get errors for the user input data filter no KB 911895 HID
    What should I do to get rid of this popup that wizzard windows keeps giving me?

    Hi Graybeard,

    What is the exact error message you get?

    HID Non-User Input data filter is an optional update. I suggest you try the steps from the following link:

    The screen saver does not start after the installation of a wireless pointing device
    http://support.Microsoft.com/kb/913405

    What version of the operating system Windows am I running?
    http://Windows.Microsoft.com/en-us/Windows7/help/which-version-of-the-Windows-operating-system-am-i-running

    Troubleshooting Windows Update or Microsoft Update when you are repeatedly offered an update
    http://support.Microsoft.com/kb/910339

  • How can I get the list of data stores in a cluster data store?

    How can I get the list of data stores in a cluster data store? I mean the command line option.

    Hello

    by command line, you mean PowerCLI?

    If so, you can display data with this warehouses:

    Get-DatastoreCluster-name DSClustername | Get-Datastore

    Tim

    Edit: Moved the thread to the PowerCLI community

  • Anyone know if there is no CC or BC apps or other alternatives that allow a way to create an online survey consisting of 3 questions for the participants to a trade appear to fill out and submit for the purposes of data collection?  Offlin data collection

    Anyone know if there is no CC or BC apps or other alternatives that allow a way to create an online survey consisting of 3 questions for the participants to a trade appear to fill out and submit for the purposes of data collection?  Offline data collection is a must. Ability to export data to Excel would be an added bonus. Thanks for the tips.

    Hi Nathan,

    This link might help: Create PDF fillable, creative forms of PDF form. Adobe Acrobat DC

    Kind regards

    Sheena

  • Vcenter/VSphere/ESX 5.0.0 question: could not download /opt/vmware/www/build/Tenacity.iso for the san-core8 data store. == &gt; Build fails

    I built this different ways now, and I still get this same exact error. I spin as 'Admin' and I have so any available privilege.

    There are no special characters in the password, I tried this file generation and he got away on my computer than this (v-soft bootable with interface).

    Please help me get to the next step, I'm stuck here.

    Everything seems fine until:

    09/10/2013 18:00:25 [info] validation available disk space...
    09/10/2013 18:00:25 [info] prepares the operating system installation files.
    09/10/2013 18:00:25 [info] looking for /opt/vmware/www/ISV/ISO/CentOS-6.4-x86_64-bin-DVD1.iso
    09/10/2013 18:00:25 [info] Validating md5 checksum for /opt/vmware/www/ISV/ISO/CentOS-6.4-x86_64-bin-DVD1.iso (may take a few minutes)
    09/10/2013 18:01:15 [info] verification of repositories of request for the installation of the packages packet...
    09/10/2013 18:01:16 [info] creating package repositories...
    09/10/2013 18:01:16 [info] create the virtual machine model.
    09/10/2013 18:01:17 [info] VM carrying from the Studio to the host configuration. This may take a few minutes...
    09/10/2013 18:02:20 [warn] cannot download /opt/vmware/www/build/Tenacity.1/Tenacity.1_provstart.iso for the s-core9 data store.
    09/10/2013 18:02:20 [warn]
    %3 %7% 11% 15% 19% 23% 26% 30% 34% 38% 42 failure: (22, ' the requested URL returned error: 401')
    09/10/2013 18:02:20 [error] met a unrecoverable build error!

    I am able to use this model for Centos on my computer actually install and build a paralytic with centos on that - unfortunately I do a

    hacks to make it work properly and I cannot get it to install other real applications (perhaps there is a new version for workstation 10?)

    So I went to vsphere, and I KNOW my generation model is ok, at least to get the installed operating system.

    What information can I give you or what can I try, thanks!

    Is it really "sort of" loading ie 42% or which is a total failure?

    OK, I have a build that WORKED, now I see what you mean about watching build/deploy the VM guest.

    Here is the solution to my problem: our vcenter uses names with spaces, we also use the domain names for our connections. In addition, each admin password was 'special characters', that I've debugged meticulously by ALL of them and much more. Basically, it did not matter that I have "URL" code things, used new tools or edited different scripts to encode things one way or another.

    What finally gave us successes was to go to a 'clean' Vcenter implementation that

    (a) use/did not require a domain name (not / credentials)

    (b) all had the "BACK original' legal names, IE no spaces, no special characters, etc..

    (c) the passwords contained NO "special characters".

    (because I changed this way, 'URL' encoding didn't work, tried it)

    Moral of the story: building a new, simply configured Vcenter or get one and use it.

    (Note: I even downloaded a new ovftool and tried every way that I could but it did not success)

  • What is excellent format for the list of postal code at the point card 2011

    Using the map Point 2011, what is the correct format for a list of 'postal code' Excel?  Point card sees only the first postal code in the list and I tried delination comma, cell them, different, spacing etc...  Only see them first zip code and all the territories are multiple zips.  Thank you!

    Ask the question in a forum for Mappoint:

    http://www.Google.com/search?q=MapPoint+Forum&ie=UTF-8

  • How to have Multi-Lang for the list of countries - not in the Simple ADMN list

    Hello

    We have countries that are currently listed in English also listed in Chinese for the data of COO.  We cannot find the icon the ADMN multilingual > > common > > list of countries in order to offer the game to the translation of Chinese characters.  How is configurable to meet the requirement of the company?

    Thank you, Beckie C.

    You are right. There is no user interface.

    He did not appear in the language for a reason packs any. Go ahead and submit an SR on that.

    I'm afraid to write or enter direct database sql scripts is the only way.

  • selection of the dates not used for the list

    OK, the last one for today...

    I'm trying to fill a list with values of the month years between the first entry in the table and the month previous (sysdate - 1 month).

    At the moment I have this, which will select every month between the last entry in the table and sysdate-1.
    select to_char( add_months( start_date, level-1 ), 'MON-YY' ) d, to_char( add_months( start_date, level-1 ), 'MON-YY' ) r
    from (select add_months(max(date_received),1) start_date, add_months(sysdate, -1) end_date from localdata) where start_date < end_date
    connect by level <= months_between(trunc(end_date,'MM'), trunc(start_date,'MM') ) + 1
    But I want it uses the first entry and select all the months between then and sysdate-1 where there is no entry in the table.

    I tried something like that, but it returned no data:
    select to_char( add_months( start_date, level-1 ), 'MON-YY' ) d, to_char( add_months( start_date, level-1 ), 'MON-YY' ) r
    from (select min(date_received) start_date, add_months(sysdate, -1) end_date from localdata) where start_date < end_date and to_char(start_date, 'MON-YY') not in (select to_char(date_received, 'MON-YY') from localdata)
    connect by level <= months_between(trunc(end_date,'MM'), trunc(start_date,'MM') ) + 1

    Hello

    pearlyred wrote:
    Thanks for the comment tip, it works great now. I just need how to sort date wise.

    If missing_month is a string, such as "JAN-2013", then it's not good for sorting, since the string "JAN-2013" come after "FEB-2013"(et aussi après «FEB-2014"et «FEB-2015") because 'J' comes after 'F'. "»»» If you want to sort, and then keep the month as a DATE, like this:

    WITH     got_missing_month_s     AS
    (
         SELECT     ADD_MONTH first_month, LEVEL - 1)     AS missing_month_s
         FROM     (
                   SELECT TRUNC ( MIN (date_received)
                                           , 'MONTH'
                                  )          AS first_month
                   FROM   localdata
              )
         CONNECT BY     LEVEL     <= MONTHS_BETWEEN ( SYSDATE
                                                 , first_month
                                          )
        MINUS
            SELECT  TRUNC (date_received, 'MONTH')
         FROM     localdata
    )
    SELECT       TO_CHAR (missing_month_s, 'MON-YYYY')     AS missing_month_d
    ,       missing_month_s
    FROM       got_missing_month_s
    ORDER BY  missing_month_s
    ;
    

    The main request has 2 columns:
    missing_month_d is for display: it's a string such as "JAN-2013".
    missing_month_s is for sorting: it's a DATE.

Maybe you are looking for