During the week to Daily Record Explosion?

Hello

I'm looking for a way to take a set of documents stamped with a weekend date and explode in a recordset for each day of this week. The data of the entire file would be identical, except for the date column. Here is an example.
item_id  week_end_date   some_value
1        2009-12-05      5
1        2009-12-12      10
1        2009-12-19      15
2        2009-12-05      20
2        2009-12-12      25
2        2009-12-19      30
What I want on the other end is something like this (I'll do only the first two records from above). I put an asterisk on the 'source' folder
item_id  week_end_date   some_value
1        2009-11-29      5
1        2009-11-30      5
1        2009-12-01      5
1        2009-12-02      5
1        2009-12-03      5
1        2009-12-04      5
1        2009-12-05      5*
1        2009-12-06      10
1        2009-12-07      10
1        2009-12-08      10
1        2009-12-09      10
1        2009-12-10      10
1        2009-12-11      10
1        2009-12-12      10*
I know I could do with a PL/SQL loop, but I am interested in more than one pure solution of SQL.

My thought was to do a temp of sorts with 7 rows table and a column. It would basically be numbers between 0 and -6. Then in my SQL I assemble and simply add the value of the temporary table to the week_end_date blew up the records on. I would like to know if I'm crazy or on the right track. If I'm heading in the right direction, I would need a little help with the implementation.

Thanks in advance.

Hello

Welcome to the forum!

You have the right idea, with a table 7-row 1-column, but there is no need to create an actual table.
You can use a subquery, as cntr below, created within the application itself and then join the result set of the subquery as if it were a table:

WITH     cntr     AS
(
     SELECT     LEVEL - 1     AS n
     FROM     dual
     CONNECT BY     LEVEL <= 7
)
SELECT     item_id
,     week_end_date - n     AS a_date
,     some_value
FROM          table_x
CROSS JOIN     cntr
;

In Oracle, it is rarely necessary to create temporary tables.

Tags: Database

Similar Questions

  • Request: keep view zoomfactor during the week (and a day)

    Dear developers,

    I started using the calendar stock Sony having been confronted with the awful Google Calendar 'facelift', which went from great to unusable in one day!
    When the pinch of hours to have a better overview a blow to another week resets the zoom set :'(

    C6903 14.4.A.0.157
    Calendar 14.3.A.1.2

    Try contacting Sony Xperia support, about that.
    http://support.sonymobile.com/global-en/contactus/

  • Updated tables during the weekly load?

    All,
    We are running Oracle 10 g. We try to identify the tables that updated operating expenses of our weekly or monthly. I did Internet searches including this forum, but have not yet found anything useful. I tried the trigger option; It works, but increases significantly at run time. For example, a stored procedure that would run between 1-2 minutes to load approximately 6 500 lines, it took 12 minutes to complete. For the moment, our weekly workload runs in about 7 hours. I predict adding triggers for selected tables drastically increases at run time. I also check the most recent row id won't help with updates and deletions. In addition, the following code works fine when running in Oracle 10 g personal edition, but when running in the development environment, it fails.
    select scn_to_timestamp(ora_rowscn) from EMPLOYEE;
    ORA-08181: the specified number is not a number of regime change in force
    ORA-06512: at "SYS." SCN_TO_TIMESTAMP', line 1



    Are there other options other than what I've listed above in order to detect when a table is updated of our weekly load process?



    Thanks in advance,


    Seyed

    All chastise you for instrumentation does not is correct, but the other option you have "explored" failed because you do not quite understand it.

    Ora_rowscn, is a pseudo column that returns either the RCS of the last change to the block or rank, depending on how the table has been set. The SCN_TO-TIMESTAMP function throws this SNA at a table to perform the conversion. No each NPC is here, I think that the rule is the last fortnight of SNA are there, obviously depends on many variables.

    Your selection did this look upward to the entire table. The "early" lines probably have not been affected over the years, SNA of these blocks have long aged out of the system table. In addition, you don't have the RCS for EACH line, just the last of them has changed.

    Here's how you can use it.

    build a table with three columns (table_name, pre_load_SCN, Post_load_SCN)... before run you out of the lot, which fills with the MAX (Ora_rowscn) of each table. Execute the batch, update of this table with the MAX (Ora_rowscn) still once and for all the tables, a table that does not at least had a line changed since the date of your first analysis.

    Problem: Could be any process, not just the batch. So if you know, NOTHING else is running... you might be sure that you have captured the list of modified tables.

  • Delay during the stop 4 k record

    Hello. After a 4 minute video 4 k and by pressing 'stop', there is a delay of 1-2 minutes before I am.able to use the camera again. Is this normal? Thank you

    Is the SD card fast enough? I don't think that internal storage may have problems because it is faster.

  • The weekly backup failure

    Hello

    I am running an RMAN backup and daily backups to succeed, but I encounter a problem during the weekly backup.

    I am using recovery Director: Release 11.1.0.7.0

    Here is the script I'm running:

    Run {}

    SQL ' alter session set nls_date_format = "dd-mon-yyyy hh24:mi:ss";

    backup current controlfile;

    Home ' date/t ';

    Home ' time/t ';

    View all;

    outline report;

    cross-checking of backup;

    overlap archivelog all;

    duplication of copy of the controlfile;

    Home ' date/t ';

    Home ' time/t ';

    delete noprompt force backup expired;

    delete noprompt obsolete force;

    delete noprompt force expired archivelog all;

    delete noprompt force archivelog backupset all completed before ' sysdate-2';

    delete noprompt force complete database before backupset ' sysdate-7 ";

    Home ' date/t ';

    Home ' time/t ';

    retrieve the copy of the database with the tag "FULL";

    backup as backupset compressed incremental level 1 to retrieve copy with 'FULL' tag data include current controlfile;

    SQL 'alter system archive log current;

    SQL 'alter controlfile backup database to trace";

    ARCHIVELOG backup all the tag delete 'ARCHIVELOG' entry;

    Home ' date/t ';

    Home ' time/t ';

    }

    "exit";

    The question starts with the recover command.

    The errors I get:

    From back to January 27, 14

    using channel ORA_DISK_1

    using the ORA_DISK_2 channel

    channel ORA_DISK_1: from additional data file from the restore backup set

    channel ORA_DISK_1: specifying data file copies to recover

    retrieve the file number of the data copy = 00003 name = E:\FLASH_RECOVERY_AREA\NNVSDB\DATAFILE\O1_MF_UNDOTBS1_9CMHHTNM_ file. DBF

    retrieve the file number of the data copy 00005 name = E:\FLASH_RECOVERY_AREA\NNVSDB\DATAFILE\O1_MF_TS_NSA_D_9CMHHTNM_ = file. DBF

    retrieve the file number of the name 00006 = copy data file is E:\FLASH_RECOVERY_AREA\NNVSDB\DATAFILE\O1_MF_TS_NSA_D_9CMHY34C_. DBF

    retrieve the file number of the data copy = 00009 name = E:\FLASH_RECOVERY_AREA\NNVSDB\DATAFILE\O1_MF_TS_NSA_L_9CMHRGCG_ file. DBF

    channel ORA_DISK_1: backup E:\FLASH_RECOVERY_AREA\NNVSDB\BACKUPSET\2014_01_25\O1_MF_NNND1_TAG20140125T020010_9G72SC4V_ piece reading. BKP

    channel ORA_DISK_2: from additional data file from the restore backup set

    channel ORA_DISK_2: specifying data file copies to recover

    retrieve the file number of the data copy = 00001 name = E:\FLASH_RECOVERY_AREA\NNVSDB\DATAFILE\O1_MF_SYSTEM_9CMHY42C_ file. DBF

    retrieve the file number of the name 00002 = copy data file is E:\FLASH_RECOVERY_AREA\NNVSDB\DATAFILE\O1_MF_SYSAUX_9CMHYXN3_. DBF

    retrieve the file number of the data copy 00004 name = E:\FLASH_RECOVERY_AREA\NNVSDB\DATAFILE\O1_MF_USERS_9CMHZ2T6_ = file. DBF

    retrieve the file number of the data copy 00007 = E:\FLASH_RECOVERY_AREA\NNVSDB\DATAFILE\O1_MF_TS_NSA_I_9CMHRGCG_ name = file. DBF

    retrieve the file number of the data copy 00008 name = E:\FLASH_RECOVERY_AREA\NNVSDB\DATAFILE\O1_MF_TS_NSA_I_9CMHW21Q_ = file. DBF

    channel ORA_DISK_2: reading from the backup E:\FLASH_RECOVERY_AREA\NNVSDB\BACKUPSET\2014_01_25\O1_MF_NNND1_TAG20140125T020010_9G72SC3W_ piece. BKP

    RMAN-00571: ===========================================================

    RMAN-00569: = ERROR MESSAGE STACK FOLLOWS =.

    RMAN-00571: ===========================================================

    RMAN-03002: failure of the command recover at 27/01/2014 05:09

    ORA-19870: error when restoring the backup E:\FLASH_RECOVERY_AREA\NNVSDB\BACKUPSET\2014_01_25\O1_MF_NNND1_TAG20140125T020010_9G72SC4V_ piece. BKP

    ORA-19625: error identifying file E:\FLASH_RECOVERY_AREA\NNVSDB\DATAFILE\O1_MF_UNDOTBS1_9CMHHTNM_. DBF

    ORA-27041: could not open the file

    04002 - OSD: could not open the file

    S/O-error: (OS 2) the system cannot find the file specified.

    What I am doing wrong?

    Thanks in advance.

    You use an incremental update strategy of backup.  This attempts to update the full backup on the disk.  The error here is that the data UNDOTBS1 file is NOT in the database backup on the disk (in the FLASH_RECOVERY_AREA).  Bottom line: all your backups are useless without this data file in the backup.

    See gradually "update backup" to http://docs.oracle.com/cd/B28359_01/backup.111/b28270/rcmbckba.htm#CHDEHBFF

    (Frankly, your script is a mixture of different configurations!)

    Hemant K Collette

  • Date formats incompatible of apex between weekly and daily calendar

    I use the Apex ajax calendar to view activity.  My user has noticed that the date format changes between the weekly and daily life, that is to say the 07/08 (MM/JJ) and 08/07 (JJ/MM) respectively.  Is this a bug or is at - there somewhere some control of date format?

    I use the following to call pages

    Weekly

    JavaScript:apex.widget.Calendar.ajax_calendar ('W', 'same'); void (0);

    Every day

    JavaScript:apex.widget.Calendar.ajax_calendar (', 'same'); void (0);

    Thank you

    Drew

    Request Express 4.2.3.00.08

    Hello

    You can check your calendar template (shared components-> models-> calendar or go to the page that contains the schedule-> tree of shared components-> choose the calendar), if it uses the same date format for weekly view masks and every day? You will see variables substitution as #MM #, #DD # and so on.

    Concerning

    Patrick

    Member of the APEX development team

    My Blog: http://www.inside-oracle-apex.com

    APEX Plug-Ins: http://apex.oracle.com/plugins

    Twitter: http://www.twitter.com/patrickwolf

  • The list of the days of the weeks

    Hi all

    I have the following query which list weekdays between two dates

    select to_char(to_date('13/03/2014','dd-mm-yyyy') + rownum -1, 'DAY')
    from all_objects
    where (rownum <= to_date('18/03/2014','dd-mm-yyyy')-to_date('13/03/2014','dd-mm-yyyy')+1);
    
    

    The results:

    THURSDAY
    FRIDAY
    SATURDAY
    SUNDAY
    MONDAY
    TUESDAY

    now, it lists every day of the week...

    How can I add the query to eliminate the weekends (Friday and Saturday in my country)

    I want it to be as follows:

    THURSDAY
    SUNDAY
    MONDAY
    TUESDAY

    Best regards.

    Try this

    SELECT week

    (Select to_char (to_date (' 13/03/2014 ','dd-mm-yyyy') + rownum-1, 'DAY') during the week)

    of object

    where (rownum<=>

    WHERE the trim (weekday) not in ('SATURDAY ', 'SUNDAY');

  • by selecting specific days of the week for the date range?

    I have a table with a number of clients for about a year, but I want to only select Wednesday and Thursday of
    every week, since the beginning of the dates. Table is simple and has two columns. Each line is separate from a Date
    There is no duplicate of Date, it is counted for every day of the year.

    column 1: number of clients, count (customer_id)
    column 2: Date

    Need help with the best way to achieve this.

    Not sure if it is even possible to select a date in the name of the day?

    Basically, I want to select every Wednesday and Thursday of each week and compare the counts during the week, the week during
    week for the whole week see if charges go upwards or downwards, to get trends, thank you!

    Hello

    Kodiak_Seattle wrote:
    I have a table with a number of clients for about a year, but I want to only select Wednesday and Thursday of
    every week, since the beginning of the dates. Table is simple and has two columns. Each line is separate from a Date
    There is no duplicate of Date, it is counted for every day of the year.

    column 1: number of clients, count (customer_id)
    column 2: Date

    Need help with the best way to achieve this.

    Not sure if it is even possible to select a date in the name of the day?

    Sorry, we don't know what you want.

    To see if a date given (dt) is a Wednesday or Thursday, you can use:

    WHERE   TO_CHAR ( dt
              , 'DY'
              , 'NLS_DATE_LANGUAGE=ENGLISH'     -- If necessary
              )  IN ('WED', 'THU')
    

    I hope that answers your question.
    If not, post a small example data (CREATE TABLE and only relevant columns, INSERT statements) for all of the tables involved and also publish outcomes from these data.
    Explain, using specific examples, how you get these results from these data.
    Always say what version of Oracle you are using (for example, 11.2.0.2.0).
    See the FAQ forum {message identifier: = 9360002}

  • Add the number of days of the week to date

    Currently I have the following in place, formcalc code which adds a number of days (based on a calculation different field "TotalDays") on a date, but would like for the calculation of the new date to include only during the week.

    Is there a way to do this?

    var begindate = Date2Num (xfa.resolveNode ("SecB\. Date\.4'), "YYYY-MM-DD")

    $= Num2Date (begindate + TotalDays, "YYYY-MM-DD")

    Thank you.

    Hello

    Here is an example which will add figures given from Monday to Friday at your selected date excluding Saturday and Sunday.

    var dp = "MM/DD/YYYY" ; date pattern
    var d = Date2Num($.formattedValue, dp) ; selected date to number
    var p = 9 ; Number of days to add to the selected date
    
    for i = 1 upto p do
              d = d + 1
              while (Num2Date(d, "e") eq 6 or Num2Date(d, "e") eq 7) do
                        d = d + 1
              endwhile
    endfor
    
    DateField2.formattedValue = Num2Date(d, dp)
    
  • When you save the playlist, error - "Windows Media Player has encountered a problem during the creation or recording of the reading list.".

    When I try to save a playlist, I get an error message "Windows Media Player has encountered a problem during the creation or recording of the reading list.".

    Hello

    • Will there be any changes made prior to this issue?
    • What version of Windows are you using?

    Step 1: I recommend to run the Windows Media Player settings Troubleshooter and check.

    http://Windows.Microsoft.com/en-us/Windows7/open-the-Windows-Media-Player-settings-Troubleshooter

    Step 2: If the problem is to uninstall and reinstall Windows Media Player. Here's how.

    Uninstalling and reinstalling Windows Media Player:

    (A) uninstall Windows Media Player:

    a. go to start and in the search type 'Turn Windows has or not'.

    b. click on "Turn Windows features on or off".

    c. find multimedia and uncheck the brand in the face of Windows Media Player.

    d. restart the computer

    (B) reinstall Windows Media Player:

    a. go to start and in the search type 'Turn Windows has or not'.

    b. click on "Turn Windows features on or off".

    c. find the multimedia functions and place a check mark in front of the Windows Media Player.

    d. restart the computer.

    For more information, see the article below:

    http://Windows.Microsoft.com/en-us/Windows7/turn-Windows-features-on-or-off

  • During the Windows installation, I received the following message: Boot Record from CDROM tree research... OK press a key to boot from CD... Error loading operating system

    What is the cause of this error message

    during the installation of the operating system on a single computer, I met the following error message
    "The research tree Boot Record from CDROM... Ok
    Press any key to boot from CD... Error loading operating system"
    What are the causes of this error?

    Hi DavidMuya,

    To stop this message from appearing, follow these steps:

    (a) remove any CD from the drive before you turn on or restart the computer.

    (b) enter the BIOS and change the boot hard drive sequence instead. You will need to change if you plan to boot from a CD in the future.

    Note: Change (CMOS) BIOS/complementary metal oxide semiconductor settings can cause serious problems that may prevent your computer from starting properly. Microsoft cannot guarantee that problems resulting from the configuration of the BIOS/CMOS settings can be solved. Changes to settings are at your own risk.

  • ID package already in use, an error has occurred during the recording of output ' 1.1.0"to the database.

    Hello

    I currently have an application called "Apa Doanya' (id 33020976) for BB 7 and below. Now, I created another version of it for BB10. To publish this version BB10, I created a new application named also "Apa Doanya' (id 46317888), download the file bar, but not yet to introduce the new application for review. Later, I changed my mind, I want to release this BB10 version under the name of my current application so that I can keep the sides and the current download figures. So in my application, I added a new version, download the folder bar and increment the version 1.1.0. But I got an error when recording on step 5, he said:

    Package already in use ID
    An error has occurred during the recording of output ' 1.1.0"to the database.

    I tried several times but no luck. What has caused this? Is - it because I already download the bar file to another application (id 46317888)? Just to be sure, I remove bar app 46317888 file and download a dummy cod file (so that the application can be saved). Then repeat the previous step (add a new version and so on) but I still have the same error.

    Really appreciate any help.

    -Hammemi - D

    Hi erik,
    Thanks for reminding me

    Yes, the problem is now RESOLVED. It was, I think, a bug/error on their part (support of the seller) so they erased the package id (I quote: "the package ID has been deleted.").

    Thank you very much :-)

  • Listen and call pick-up during the recording of the voice message.

    Is it possible in the 4.0 unit (4) with the Callmanager 4.1 integration (2) to implement the following feature?

    A caller call out for the recipient, but the recipient does not meet the call. The callmanager before the call to the voice mail pilot unit, but when the unit starts recording the message to the recipient can hear it during the registration phase and if it then takes the phone tracks back to his phone call, and they can start the conversation. If the recipient picks up the phone during the recording, the unity server automatically removes the voice message. It is the same functionality that is old voice message recording devices in the PSTN.

    This feature is planned for version 4.2 to come next year at the beginning - it is called 'message monitor' - you can listen to voicemail as they are saved and select to pull this caller out of voice mail and talk to them live if you wish.

  • record during the call

    Sir I want all the apps by which record might be possible during the call. If not available pls provide even

    Hi siham,.

    Thanks for posting your query in Microsoft Community.

    Let me ask you a few questions to understand your good query;

    • Of appeal are what type you referring?
    • You use Windows PC or phone?
    • Are you referring to a video call via Skype or any similar application or a voice call by phone?

    Call Recorder is a free app available in store Windows for phone with Windows 8, 8.1 & 10 which includes features such as:

    -Record your phone call.

    -Play back recording.

    -Download the recording to Onedrive for transfer.

    -Password for your confidential records.

    You can see: Call Recorder in Windows store

    Please come back with more information about your application to help you better.

    Hope this information is useful. Please feel free to answer in the case where you are facing in the future other problems with Windows.

  • Records of files does not display during the recording of the converted web page in Internet Explorer

    I have recently installed Windows 10.  I use Acrobat Pro 10.  Now, when you convert a web page in an Acrobat document, when I click on "Save as", most of the shirts in my OneDrive folder do not appear.  This only happens during the conversion of a web page to a pdf Acrobat file.  If I save the web page converted into my office and open it from there, I can see and access all the OneDrive file records.

    Any idea what's going on here?  I tried uninstalling and reinstalling Acrobat but that did not help.  Thank you.

    Acrobat X (10) is not compatible with Windows 10.

Maybe you are looking for

  • Change the local iPhone backup file by default on PC

    I have a HP PC with Windows 10 House 11 flow. iTunes allows me to change my storage location of media on the F drive which is a 64 GB sd card. I don't see a way to change the phone backup file local saving by the c-drive location. I don't have enough

  • Portege 4000 - I would like to upgrade memory: 256 MB to 512 MB

    Hello I have a Portege 4000 and want to upgrade the memory: 256 MB to 512 MB.It has 98SE and the user always wants to keep this system. Does anyone know if there is a known issue with the upgrade to 512 MB I saw a thread in 2005, by someone who had a

  • VI suddenly increased file size

    I got a main vi file size of about 160 KB for several days now. All of a sudden today after (maybe after slightly changing my sub-VI-not sure about that), the size of the master file of the vi has suddenly turned up 18MB! Why is this happen and how d

  • 1051 printer

    This manual is used for the hp deskjet 1051 all-in-one printer?

  • Where will the files deleted in windows xp mode 7?

    As the title suggests, where deleted in XP mode files go to? I deleted a file on my local C drive using the XP mode. The file did not go to the XP virtual recycling bin or windows 7 recycling bin.  The file was small and did not warn me that it does