Extracting dates problem

customer table
===========
customer_id varchar2(6)
st_dt date
ed_dt date
dop varchar2(7)
data
===
customer_id st_dt ed_dt dop
429100 2005/02/23 2006/03/20 0000007
customer1 table
============
customer_id varchar2(6)
st_dt date
ed_dt date
dop varchar2(7)
dt date
insert into customer1(customer_id, st_dt, ed_dt, dop, dt)
select a.customer_id, a.st_dt, a.ed_dt, a.dop, a.st_dt+b.tita
from customer a, (select rownum-1 tita from user_objects) b
where a.st_dt+b.tita <= a.ed_dt
and instr(a.dop, decode(to_char(a.st_dt+b.tita, 'd')-1,0,7,to_char(
a.st_dt+b.tita,'d')-1))>0
order by a.customer_id,a.st_dt+b.tita
The purpose of thie query is to extract all the dates in the customer table st_dt to ed_dt fields based on the field dop, 0000007 indicates Sunday, if the value is 1004007, it indicates monday, thursday and sunday. The results will insert into customer1 table, however the results are different if I execute the same query on different machine, they both run on oracle 10g database.
If i change st_dt to 2005/02/23 and ed_dt to 2005/03/20, it returns the right result, it seems that the ed_dt doesn't work if I change the year to 2006.
what's wrong with this query ? or is there something to do with the date settings in my database ?
thanks.

(select rownum-1 tita from user_objects) bInteresting way of creating a counter :)
Anyways, I guess you should not pick a date range that span more days than you have objects in your schema. You can possibly extend the range by selecting from all_objects instead :-)))))

Similar Messages

  • Problem with extract data from R/3 to BW

    I want extract data from R/3 system.the problem is when I run the infopackage,I can see the status is yellow In the Monitor and the data can't extract to BW.but in the source system,the job of extracting data has been finished.
    (use the Tcode: WE02)the Outbound IDocs and Inbound IDocs are OK,but in the BW system ,I canu2019t see the Inbound IDocs.
    In the source system use Tcode: SM50,I can see the process SAPLQOWK is running for a long time and run out system memory.
    use Tcode : SM58, I execute LUW, the data can transfer to BW system,but the report SAPLQOWK is not stop.
    it would be stopped by canceling the process manually in operating system or it run out time.
    why can't i extract data from R/3 system successfully ?
    why the process SAPLQOWK can't finish?
    how can i do?

    Hi,
    I hope the note 527481 would help you to sort out this problem.
    Regards,
    Anil Kumar Sharma .P

  • Problem in Excel after extracting data from SAP Report

    Hello,
    I have a problem with Excel file after extracting it from one of the SAP report.
    When my client extracted data from SAP in to excel he is coming across minus symbol on both sides of the number.
    for ex:        -447492177-
    When i extracted same SAP report in to excel i didnt face any such problem.
    Please share your inputs on what could be the problem.

    1. Make sure your client and you are using the same version of Microsoft Excel
    2. Let your client try to OPEN the exported xls file from a existed workbook instead of double-clicking the file directly.
    Atom

  • I have a problem to  extract data from oracle dump file (.dmp) using oracle database or any other tools.

    There is IMP utility which provides me data as graphical way. But i need extract data in such a way so that i could able to use in my application.
    thanks,
    mohan

    Hi,
    EdStevens
    Actually I was using SQL Developer. Sorry for the wrong define question. Now the real problem is:
    I want to read or extract data in a txt file from Oracle Dump (.dmp) file without using Oracle sqlPlus or Oracle Database.
    No need to say that i am able to extract dump data using sqlPlus. But for that, there is a little burden to install oracle database
    or sql Developer.
    I also listen about Oracle Loader a little bit. Is it a tool for providing extraction of data from Oracle dump file.
    Thanks for your previous reply,
    And now waiting for your suggestion.
    thanks,
    mohan

  • Quote problem in Generating Insert Statement Script to Extract Data

    Hi every body;
    I would like to write an sql/plsql script which can extract data from an oracle existing table in insert statements.
    example:
    the table employees:
    empno name
    1 john
    2 M'hir
    3 M'silou
    My problem is that i have the following result:
    insert into employees values('1','john');
    insert into employees values('2','m'hir');------- Problem with M'hir qote
    insert into employees values('3','M'silou');----- Problem with M'silou quote
    How can i have :
    insert into employees values('2','m''hir');------- two quotes with M'hir =M''hir
    insert into employees values('3','M''silou');----- Problem with M'silou=M''silou
    plz your help
    thank you at advance

    Hi,
    What is your DB version?? If it is >10g, you can use the Q delimiter (as mentioned by Solomon).
    Check this out.
    http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14251/adfns_sqltypes.htm#BABFEDBG
    -Arun

  • Problem when extracting data from R/3 to BI

    Hi Experts,
    I am facing a strange problem. While i am extracting data from R/3 yo BI. One Infopackage is running successfully and i can see the data at Bi side. But while I am running another infopackage for another data source it is taking long time and at last loading results into failure.
    I have gone through SDN also but not able to find any inputs.
    I think it might be the reason with the Idocs.  The error it is giving is
    Request still running
    Diagnosis
    No errors found. The current process has probably not finished yet.
    System Response
    The ALE inbox of BI is identical to the ALE outbox of the source system
    or
    the maximum wait time for this request has not yet been exceeded
    or
    the background job has not yet finished in the source system.
    Current status
    All of the packets from the source system arrived
    I am not able to see list of Idocs in sm58.
    What might be the reoson?
    Regards,
    sridhar

    Hi,
    See if its a full schedule it again by deleting any old requests....
    And then when going thru job overview>in the sourcesystem>u can execute there itself and chk the status of the job...
    If its no there then the job might have missed up due to some unfair reason....it happens sometimes also..some times it will be in scheduled only....once select all active/cancled/finished and so on...
    And also chk under details tab...under extraction....whether data selection scheduled and requested and finished....????
    If not there try to run it again and at the same moment monitor in source with jobname as BIREQU_* and select all input entries as canceled/active/finished......
    rgds,

  • Problem Extract Data from Essbase

    Hi all,
    I have this error when I try to extract data from essbase :
    org.apache.bsf.BSFException: exception from Jython:
    Traceback (innermost last):
    File "<string>", line 1, in ?
    com.hyperion.odi.essbase.wrapper.EssbaseRecordFetchException: Out of memory error.
         at com.hyperion.odi.essbase.wrapper.EssbaseReportDataIterator.hasNext(Unknown Source)
         at com.hyperion.odi.essbase.ODIEssbaseResultSet.next(Unknown Source)
         at com.hyperion.odi.essbase.ODIStagingLoader.loadData(Unknown Source)
         at com.hyperion.odi.essbase.AbstractEssbaseReader.extract(Unknown Source)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    For information :
    I use an reportscript which extract 400 000 records. I think that the problem comes from the staging area. How to modify size of the management of the memory?
    I don't have this problem when i extract just 2 000 records for exemple.
    Best regards,
    Ben

    Hi,
    Are you using a local or a defined agent?
    Are you using the memory engine as the staging area.
    Anyway you can increase the memory being used by the JVM depending on the above.
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • Problem in extracting data

    Hi All
    i am getting problem while extracting data.
    XML is .
    <po:PurchaseOrder xmlns:po="http://www.oracle.com/PO.xsd"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.oracle.com/PO.xsd
    http://www.oracle.com/PO.xsd">
    <PONum>1005</PONum>
         <Company>Oracle</Company>
    <Item>
    <Part>9i Doc Set</Part>
    <Price>2550</Price>
    </Item>
    <Item>
    <Part>8i Doc Set</Part>
    <Price>350</Price>
    </Item>
    </po:PurchaseOrder>
    and i am writing SELECT query as
    select p.extract('/(PurchaseOrder/Company)').getStringVal() from po_tab2 p
    then i get blank rows.
    SQL> select p.extract('/PurchaseOrder/Company').getStringVal() from po_tab2 p;
    P.EXTRACT('/PURCHASEORDER/COMPANY').GETSTRINGVAL()
    6 rows selected.
    but if i use only root element in xpath then it displays result with xml data.
    SQL> select p.extract('/PurchaseOrder').getStringVal() from po_tab2 p;
    P.EXTRACT('/PURCHASEORDER').GETSTRINGVAL()
    <po:PurchaseOrder xmlns:po="http://www.oracle.com/PO.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchem
    a-instance" xsi:schemaLocation="http://www.oracle.com/PO.xsd http://www.oracle.com/PO.xsd">
    <PONum>1001</PONum>
    <Company>Oracle</Company>
    <Item>
    <Part>9i Doc Set</Part>
    <Price>2550</Price>
    </Item>
    <Item>
    <Part>8i Doc Set</Part>
    <Price>350</Price>
    how can i extract data from child nodes.

    seems like problem with the namespace.
    pls add the third argument to the extract function i.e the namespace.
    select p.extract('/PurchaseOrder/Company', 'target namespace').getStringVal() from po_tab2 p;

  • Problem extracting data using 0EC_PCA_3 datasource

    Hello every body.
    Hope every thing is all right for you.
    I'm facing an embarassing problem, and hope you can help!
    I'm using datasource 0EC_PC_3 to extract data from GLPCA (ECC table) into a BI DSO. My probleme is that when i try to extract all data for a specific profit center group (or customer) i'm not getting data related to fiscal period biger than 10. When i add a filter on account number (on infopackage selection criteria) for example it's getting all data with no probleme in fiscal period!!
    Any body has faced this error or something like it?
    Thanks for help!
    Salah

    Thanks every body for reply,
    yes i've fiscal period as part of my DSO key part!
    At datasource level (0EC_PCA_3), i'm not getting data as it should be !!!
    When, whitin my infopackage, i specify the profit center, data are retreived correctly, otherwise i'm not getting all data!!!
    Any idea? :s

  • Problems to extract data from 0HR_PY_1

    Hi Experts,
    I'm using BW v.7 to extract data from standard data source 0HR_PY_1 of SAP-ECC, with delta update.
    When I try to extract the data job finishes with error (red status) and all data-packages have error message ABORT in customer routine 9998.
    Although I'm using BW v.7 I have activated 3.x extraction (DataSouce -> InfoSource -> Update Rule).
    Any help will be welcome!
    Alex

    I've found the problem by myself

  • Problem extracting data from R/3 to BW using infopackage?

    Hi all,
    I am trying to extract data from R/3 to BI7.0 through infopackage and its giving below error.
    Request still running
    Diagnosis
    No errors found. The current process has probably not finished yet.
    System Response
    The ALE inbox of BI is identical to the ALE outbox of the source system
    or
    the maximum wait time for this request has not yet been exceeded
    or
    the background job has not yet finished in the source system.
    Current status
    No Idocs arrived from the source system
    In the details tab:
    Extraction (messages): Missing messages  in yellow status
    Missing message: Request received          
    Missing message: Number of sent records
    Missing message: Selection completed
    Transfer (IDocs and TRFC): Missing messages or warnings  in yellow status
    Data Package 1 : arrived in BW ; Processing : Selected number does not agree with transferred n
    Processing (data packet): Everything OK             in green status
    Data Package 1 ( 370 Records ) : Everything OK
    Inbound Processing ( 370  Records ) : No errors
    Data package 1 received; Processing is starting
    Update PSA ( 370  Records posted ) : No errors
    Data package 1 is being saved...
    370 records for data package 1 updated successfully, 0 records filtered
    Processing end : No errors
    Inbound processing of data package 1 finished.
    Please anyone try to look at this issue and give me better soluttion ASAP.
    Thanks,
    Suresh.

    Hi ,
    The infopackage run for avery long time in yellow state with out changing to green, This might happen due to connection error(get in touch with your basis team) or due to over load on the system.
    eventhough the status of request is finished in source system, the job will be executing in the BI.
    1)Wait for sometime for the request to turn out green automatically or
    2)make the request to red and delte, repeat the infopackage step.
    3)IF you know about the no of records that need to be transferred and if the total records are transferred already, manually  change the request to green.
    Cheers,
    Srinath

  • Problems in extracting data from r/3

    Hi Guys
    I am extracting data from r/3(QA) to BW(QA), into an ODS. Now, my previous load failed but i saw from RSMO that the load had more than 4 million records. I am scheduled the load again. And in monitor(RSMO) it says:
    (yellow symbol) 17:24:50 ( 762040 From 0 Records )
    and in status, it says everything ok, no error, process is still goin on. And in details this is the last line at the moment:
    "Transfer (IDocs and TRFC): Missing messages or warnings"
    Data Package 29 : arrived in BW ; Processing : Selected number does not agree with transferred n
    "Processing (data packet): Warning received"
    Data Package 29 ( 23810 Records ) : Everything OK.
    I am assuming that there are 100 packages like this in total. Will my data load into the ODS finally??
    Thanks.

    Hi Chintai,
    If you are extracting delta records, then you can view the number of records in RSA7.
    I suggest you go to details tab of the monitor, you would be knowing the activites that are taking place..
    Check if your transfer rules, update rules are done for atleast for few of the data packages.
    Regards
    Manga(Assign points)

  • Problem in extracting data from source system

    HI
       I am comparing source system and data in bW for a particular datasource.In this process in source system transaction RSA3 when i am trying to extract data its not showing the exact count.I couldnt able to understand the setting options like Datarecord/calls & Displa extr.calls in transaction RSA3.can some one assist in this..?

    Vara Prasad,
    I do know about the popup , but then the popup is displayed only AFTER the extraction completes. Asusming that you have about 10 million records - I cannot find the number of records without actually extracting it and my RSA3 will fail because it is too large of RSA3 , I was talking about if there was a method by which I could fins the number of records alone without extracting the data / running RSA3.
    Also if your extractor has 20,000 records , and if you set 10 datapackets of 1000 each the popup will display 10000 whih is incorrect and you would have to increase the data packet / package size to finally arrive at the right number...

  • Can not extract data into BW from SQL SERVER

    Dear All,
      I meet a problem to extract data from database(MS SQL Server 2000(sp3)) into BW now and can not extract data into BW ODS, even PSA, In the monitor, display yellow light(0 from 0 record), detail message just display message "data request arranged" "confirmed with: confirmation" in requests(message) step; "missing message: request received" in extract (message)  step; "no data" in processing(data packet) step and so on. but in fact, there are two records in my database test table and DB connection is OK. Even I can extract data from another test oracle database into BW ODS successfully.
       Our BW system has two BW applicaton server and use oracle database. the one application server locates on IBM AIX host. the another one locates on one NT server. the application server on NT server is used for data extration from MS SQL SERVER  database into BW oracle database. and MS SQL SERVER and NT platform application server locate on same one host. DBSL was installed on the NT application server already. and DB connector also was created successfully for MS SQL SERVER and datasource also was generated. DBSL type is Kernel640-WIN-IA32bit-unicode. my BW system is ECC5.0/UNICODE/ORACLE. all table/view/field name of MS SQL server is upcase and have not any specific character. for example: ZDEMO etc.
    wait your help.
    Thanks in advance.
    Billy

    Hi  Ravi,
    Could you help me to get knowledge about the followings:
    approximately how many records    extracting and transfering  from SAP R/3 to BIW  in an organisation. for that how much time  will take .
    How to extract data from  two are three source system  to BIW. Kindly help me with step by step explanation .If any screen shots with documents pls fwd to my ID. "[email protected]"
    Your help highly appreciated.
    Thanks.
    Hema

  • Unable to extract data from an AS/400 system.

    Hello experts.
    We are trying to extract data from an AS/400 system but not having any success until now.
    I´ll write down you the stepts that we have followed until now:
    1.- Create a DB Connect between both systems
    2.- Create a Source System from AS400 in the workbench under DB Connect Directory
    3.- Generate datasources from tebles specified in the schema of the connection
    break point -
    At this point, we had a problem with some tables with at least one fieldname containing character "Ñ".
    After asking some possible solutions to SAP, the told us this is not supported, as the system can´t have any object with character "Ñ", so the transfer structure was unable to activate with this fields in the datasource.
    --- end of brek point --
    4.- After those issues, we´ve decided to implement, in another schema, views from those tables which had the fieldnames with that character "Ñ", changing them to an "N".
    5.- We´ve created another source system with that schema, and user than can see that schema.
    6.- To be able to see those views, in transaction RSDBC, we had to deactivate the two checkboxes in the first window ( Choose tables and Choose views) .
    7.- Right afeter, we could generate correctly the datasources from this logical tables.
    8.- We have designed  the hole dataflow for this datasources and everithing went rigth.
    9.- But wen we tried to execute the infopackage to extract data from those logic tables, we cannot get any registers. Acctualy the charge remains yellow after the job have finished.
    Please, I would appreciate any help you could give us on this problem.
    Thank you very much
    Regards
    Joaquin

    I´d like ti add something to this thread, and maybe clarify a littel bit the question.
    The only way that the BW system recognizes those logical tables, through transaction RSDBC is checking out the two boxes on this transaction, "Select Tables" and "Select Views".
    I don´t know haw these logical tables have been created, bus does this mean that the are not neither tables or views as BW understand them.
    Please, if someone knows anythin about this, answer to this thread.
    Thank you very much.
    Joaquin Sobrido

Maybe you are looking for

  • Upgrading and transferring data to a new macbook pro, given my old mac is running on Lion.

    I am currently using a late 2006 black macbook running OS Lion. I have recently bought a new retina macbook pro to upgrade to which will presumably be running OS Mountain Lion. I understand there are several ways to transfer data across to new macs a

  • Marker comments not being saved

    I've been adding markers and then comments to those markers in the source panel on clips from the project pane.  The marker comments show up in the markers pane.  However, upon opening a new clip and then returning to the clip with markers, all of th

  • New apps crash iPhone 2.0 software on launch

    I installed the 2.0 firmware on my Edge iPhone on Friday. I have noticed that every once in a while, the Phone will re-boot itself when I click on one of the new application icons. It immediately shows the while Apple logo and is re-booting. It has h

  • How to indicate an entire directory to upload?

    Hi, My JSP application must allow that users can indicate an entire directory to upload, not single files. Any suggestion using JSP, AJAX or Javascript? For single files it´s easy, I can use <input type="file" ... > I can´t ask users to zip the direc

  • Execute scripts in your PWD without prepending them with "./"

    To execute scripts in your PWD without prepending them with "./", add it to the end of your $PATH: $ export PATH="$PATH:." ...and, to make it permanent, create an entry in your .bashrc: $ echo "export PATH=\"\$PATH:.\"" >> ~/.bashrc It won't cure can