Store Date as Oracle Date as string for simplicity?

I got this table (scaled-down):
   CREATE TABLE TBLSERVICES
     STORENBR CHAR(4 byte) NOT NULL,
     SERVICEDATE CHAR(10 byte) NOT NULL,
     CHECKNBR CHAR(6 byte),
     ORDER_START_TIME DATE NOT NULL,
     ITEMID CHAR(4 byte), 
     SERVERID NUMBER(18),
     SERVERNAME VARCHAR2(50 byte),
     ITEMQUANTITY NUMBER
) Function MakeServicesDatatable(byval onodesconfig as xmlnodelist) return datatable
       dim objDT as new datatable
       With objDt
            .Columns.Add("StoreNbr", GetType(String))
            .Columns.Add("Order_Start_Time", GetType(String))
       End With
       dim dte as string
       For Each onode As XmlNode In onodesConfig
                If onode.InnerText = "5" Or onode.InnerText = "6" Then
                    objdr = objDt.NewRow
                    objdr("StoreNbr") = storenbr
                    dteYear = parentNode("Order_Start_Time").SelectSingleNode("Year").InnerText
                    dteMonth = parentNode("Order_Start_Time").SelectSingleNode("Month").InnerText
                    dteDay = parentNode("Order_Start_Time").SelectSingleNode("Day").InnerText
                    DteHour = parentNode("Order_Start_Time").SelectSingleNode("Hour").InnerText
                    dteMin = parentNode("Order_Start_Time").SelectSingleNode("Minute").InnerText
                    dteSecs = parentNode("Order_Start_Time").SelectSingleNode("Second").InnerText
                    dte = String.Format("{0}/{1}/{2} {3}:{4}:{5}", dteMonth, dteDay, dteYear, DteHour, dteMin, dteSecs)
                    objDR("order_start_time") = dte
                    objDt.rows.add(objdr)
                end if
        next onode
        return objDT
end function
I call following:
dt = MakeServicesDatatable(NodesWithData)
WriteDataToDB(dt)
Public Sub WriteDataToDB(ByVal dtServices As DataTable)      
        Dim altConnString As String = connString
        Dim queryString As String = "Select * from tblServces"
        Using connection As New OracleConnection(altConnString)
            Dim adapter As New OracleDataAdapter()
            adapter.SelectCommand = New OracleCommand(queryString, connection)
            Dim builder As OracleCommandBuilder = New OracleCommandBuilder(adapter)
            connection.Open()
            Dim ds As DataSet = New DataSet
            adapter.Fill(ds, "tblServices")
            For Each drService As DataRow In dtServices.Rows
                ds.Tables("tblServices").ImportRow(drService)                
            Next drService
           adapter.Update(ds, "tblServices")
        End Using
    End SubIn a PL/SL SQL Query, I need to say something like this:
- Lunch is anything before 3:00pm
- Assume date is same as date of order start time
select  storenbr,
        itemquantity
from tblServices
where order_start_time < DatePArt(order start time date) || 15:59:00 I don't know syntax for getting date portion of oracle date
Problem is the order_start_time is stored as dd-mmm-yyyy.
I need seconds also. Should I make order-start_time a string
and convert to date in SQL statement.

Hi Vinod,
Create a varaible of type customer exit for RUNDATE.
IF i_step = 1.
   select max (rundate) from /bic/prundate into zrundate.
  IF i_vnam = 'rundate'.
  l_s_range - low = zrundate.
  l_s_range- opt = 'eq'.
append l_s_range into e_t_range.
endif.
Endif.
hope it helps
bhaskar

Similar Messages

  • I need to download data from Oracle data base into a Excel spread sheet

    I need to download data from Oracle data base into a Excel spread sheet.
    Any input will be appreciated.

    Goes something like this:
    1) create an ODBC connection (on NT/WIN: ODBC DATA SOURCES in the control panel, create a USER DSN.
    2) in EXCEL-menu: DATA->GET EXTERNAL DATA->CREATE NEW QUERY. In the wizzard you will see the DSN created in the previous step. Select that source.
    3) follow the wizzard.
    Hope this does any good...
    Regards,

  • Help with today's date - 2 days as a string for a file name

    This will be an Expression/Connection String for a Flat File Connection Manager.
    Need it in this format COMPANY20150402.txt except the formula needs to incorporate the DATEADD("D", -2, Getdate())
    "COMPANY" + (DT_STR,4,1252) DatePart("yyyy",getdate()) +
    Right("0" + (DT_STR,4,1252) DatePart("m",getdate()),2) +
    Right("0" + (DT_STR,4,1252) DatePart("d",getdate()),2)  +".txt"
    Where do I add the DATEADD part? and be syntactically correct?
    TIA
    Harry

    You do get COMPANY20150402.txt outputted from your expression
    just keep adding DATEADD("DAY",-2,.... to each getdate()
    like
    "COMPANY" + (DT_STR,4,1252) DatePart("yyyy",DATEADD("DAY",-2,getdate())) +
    Right("0" + (DT_STR,4,1252) DatePart("m",getdate()),2) +
    Right("0" + (DT_STR,4,1252) DatePart("d",getdate()),2)  +".txt"
    Arthur
    MyBlog
    Twitter

  • Oracle Replication - Encrypted Data and Oracle Data Guard

    We are working on a high availability architecture for one of our new projects. The preliminary architecture has Oracle 10g Release 2(10.2.0.2) production database (primary database) running on Solaris10 server for OLTP operations. And a production replicated database (standby database) is running on another node running on Solaris10 server for reporting, ETL data extractions etc. The plan is to implement Oracle data guard (DG) to replicate data between primary database and standby database (logical standby database). As a side note, there is going to be one to two minute time log for data synchronization between primary and standby databases.
    We need to encrypt sensitive data (like SSN, Credit Card No. etc) in the primary production database. Initially we thought this can be achieved by using Oracle Transparent Data Encryption (TDE), this is a new encryption method Oracle came up with their 10g version. But the issue here is Oracle TDE doesn’t support setting up the logical standby database (using Oracle data Guard) for reporting on the second node. I have confirmed with Oracle on this, so we are kind of stuck in the middle on this new requirement. So our next option is to look out for any third party vendors who can resolve this puzzle, and looking for your help for any suggestions.
    · Do you know any vendor who can support both data encryption and data replication for Oracle databases?
    · Do you know any vendor who can support just data encryption for Oracle databases?
    (I am thinking if we can find a vendor, we would like to ask them if they have any technical issues working with Oracle data guard for data replication and use some kind of technique to decrypt the data on the standby/reporting database.)

    You can always use the DBMS_CRYPTO or DBMS_OBFUSCATION_TOOLKIT to encrypt the data rather than using TDE. You may have to do some work on the key management side, though, but it shouldn't be too painful.
    Justin

  • COVERT DB2 DATE TO ORACLE DATE

    I AM MIGRATING DB2/AS400 DATA TO ORACLE.
    IN THIS I HAVE DB2 DATE WHICH IS IN CYYMMDD FORMAT AND I HAVE TO CONVERT DD/MM/YYYY FROM TO ORACLE.
    WHICH IS THE BETTER WAY TO PROCESS THIS TYPE OF DATA.
    COULD YOU PLEASE HELP ME

    HI,
    The simplest way is:
    Take a look at the default date format at your Oracle (you can change it if necessary) and then use some DB2 Data do Character function to format it like Oracle default format.
    Oracle will do an implicit conversion.
    Does it help you?

  • How to Convert Normal XML date or Oracle date to JDE Julian Date

    We can do a simple mathematical step in XSLT :
    'xpath20:format-dateTime(xpath20:current-dateTime(),"[Y0001][d001]") - 1900000'
    Or in SQL :
    Select to_char(sysdate,'YYYYDDD')-1900000 from dual;
    Julian Date is: Year in 4 digits, YYYY, and Number of days in 3 digits, DDD
    JDE Julian Date is Julian Date -1900000 (ie it counts Julian date from 1900 Year)
    "[Y0001][d001]” returns date in Year in 4 digit + number of days in 3 digits. This is the Julian date.
    Subtracting 1900000 ( ie YR ’1900’ & DAY ‘000’) gives the required JDE Julian Date.
    Edited by: prakash.pankaj on Jul 8, 2011 2:13 PM
    Edited by: prakash.pankaj on Jul 8, 2011 4:02 PM
    Edited by: panks on Jul 20, 2011 3:43 PM

    Hi,
    getTime() (in Date) will give you that date in milliseconds since January 1, 1970 00:00:00 GMT.
    To my knowledege, this is the same as Unix date format.

  • How to reverse the end date on Oracle Standard Benefits plan for a employee

    Hi,
    We tried to end date a medical benefit plan for an employee but did it wrong. It should show end dated 31-JAN-2010 and then we wanted to add a new plan starting from '01-FEB-2010'. But we wrongly end-dated as on 31-DEC-2010.
    Can anyone help me to identifiy how to remove the wrong end date from the benefit plan for the employee..
    Regards
    Arun Kumar S Rathod

    If you are using life events, just backout the life event and the end-date will go away. then create a fresh life event and make necessary changes.

  • How get selected data from oracle data as per give input

    sir i use Sun Java Studio Creator with oracle 10g
    my direct want user give input through both listbox , textbox or string variable
    how i pass this input in sessionbeen query and page give data in table as per user need
    please give me step and code
    this is urgent
    thank's

    You would get hierarchical data from a functrion in the same way as you would any data.  Create a function returning a cursor and then use your SQL statement to open the cursor.  Very simplistically:
    Create Function My_Func Return Sys_Refcursor As
       l_cur Sys_Refcursos
    Begin
       Open l_cur For
          'select EMPNO,ENAME,SYS_CONNECT_BY_PATH(ename, '/') "Path"
           from EMP
           start with MGR is null
           connect by prior empno=mgr';
       Return l_cur;
    End;
    Then, whatever calls the function would walk through the cursor an do whatever.
    Jhn

  • Flash Date and Oracle date

    Is it possible to convert a date being retrieved from an
    oracle database to the flash Date format in flash so that the
    different Actionscript date functions can be applied to the
    retrieved date.

    Hello gents!
    Like this. Conversion is pretty easy, when we need a readable
    date we can usually concat one with the Date class methods
    getMonth, getTime and so on. Creating flash dates is done the other
    way around, by using setDate and the other methods of the Date
    class.

  • Which oracle data type store Maximum data?

    Hi All
    could any one suggest me that i store maximum data in oracle data type for that which data type i have to use?
    i m working on Oracle 10g
    Thanks

    Refer
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/sql_elements001.htm#i54330
    and choose the data type that you need to (except for LONG - it has too many limitations and is only provided for backward compatibility).

  • DB2 data guard (oracle)

    SAP : R/3 ECC 6.0
    db : db2
    os : linux suse
    hclsap:db2hcd 52> db2licm -l
    Product name:                     "DB2 Enterprise Server Edition"
    License type:                     "Trial"
    Expiry date:                      "03/21/2010"
    Product identifier:               "db2ese"
    Version information:              "9.1"
    Annotation:                       "-5;(_t)"
    Linux hclsap 2.6.16.60-0.21-smp #1 SMP Tue May 6 12:41:02 UTC 2008 x86_64 x86_64 x86_64 GNU/Linux
    Question : Is there any possibility of Data guard (oracle)  mechanism possible possible for db2.
    I was checking concept of HADR not sure whether possible with SAP bundled version.
    How to check whether it is possible with the bundled version of DB2 with SAP 6.0
    Pl. guide me

    Hi,
    Is there any possibility of Data guard (oracle) mechanism possible possible for db2.
    YES..Using DB2 HADR..
    Please refer following Useful links.
    [http://help.sap.com/saphelp_nwpi711/helpdata/en/b9/a961d169c143ecb45262a2b10f149d/frameset.htm|http://help.sap.com/saphelp_nwpi711/helpdata/en/b9/a961d169c143ecb45262a2b10f149d/frameset.htm]
    [DB2 HADR in SAP Environment|http://www3.software.ibm.com/ibmdl/pub/software/dw/dm/db2/dm-0508zeng/HADR.pdf]
    [DB2 9- Data Recovery and High Availability Guide and Reference|ftp://ftp.software.ibm.com/ps/products/db2/info/vr9/pdf/letter/en_US/db2hae90.pdf]
    [Technical Comparison of DB2 HADR and Oracle Data Guard|ftp://ftp.software.ibm.com/software/data/pubs/papers/hadr-comp.pdf]
    I was checking concept of HADR not sure whether possible with SAP bundled version.
    SAP OEM License includes HADR license as a part of DB2 License.
    Please refer [SAP Note 1260217 - DB6: Software components contained in DB2 license from SAP|https://service.sap.com/sap/support/notes/1260217].
    Regards,
    Bhavik G. Shroff

  • How to Extract data from Oracle DB to BW via DBConncet interface.

    HI All,
    Do you know how to extract data from ORACLE data base to BW, using DBConnect.
    Here we are not using R/3 Business content structures.
    How to do it in both source system  and BW side?
    How to define structures on both sides.
    Please provide any documents on that.
    Thanks in Advance.
    Sri.

    Hi Srilaxmi
    Have a look at these links
    http://help.sap.com/saphelp_nw04/helpdata/en/58/54f9c1562d104c9465dabd816f3f24/content.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/a1/89786c3df35c4ea930a994e884bb4c/content.htm
    http://help.sap.com/saphelp_bw30b/helpdata/en/80/1a618ae07211d2acb80000e829fbfe/content.htm
    and  this thread
    Extract from Oracle View with DB connect
    regards
    KR

  • Oracle Data Modeler commit change seg physical table

    Hello,
    Sometimes when I record a data model, Oracle Data Modeler (SVN) given as outgoing a chage of segment of physical table , if you committees are to change, duplication of files in the physical model is produced. Later when you open the physical model gives errors that have duplicate files
    How you can correct this error? Why the segment change occurs?
    Thanks

    Hello,
    Versión 4.0.0.833.
    No pattern is occasionally when shooting in the data model. How you can correct this error? Why the segment change occurs?
    Thanks

  • When Oracle 9i release 2 for Linux releases?

    Hi all,
    sorry for my borther, but I really wanna know the exact date that Oracle 9i release 2 for Linux releases?
    Thanks
    xiao

    Try here...
    http://technet.oracle.com/software/products/oracle9i/htdocs/linuxsoft.html

  • When Oracle 9i release 2 for Linux available on the marker?

    Hi all,
    sorry for my borther, but I really wanna know the exact date that Oracle 9i release 2 for Linux releases?
    Thanks
    xiao

    Try here...
    http://technet.oracle.com/software/products/oracle9i/htdocs/linuxsoft.html

Maybe you are looking for

  • After updating to IOS 8.1, I have problems sending photos in messages

    I'm not at all sure how long after updating this started happening, and I'm fairly sure I just have a setting messed up someplace. When I go into messages, contacts are listed in three different colors. Gray, green, & blue. I can send a message to an

  • Problem in placing files in server

    Hello, I am working on applet to servlet communication. I have developed the code but I have problem in placing the files in the tomcat server. these are my files test.html test.class (applet) inter.class (bean implementing serializable interface) te

  • Buttons appear when printing

    I am designing a fillable PDF form in Form Designer 7.0. When the form first comes up, I have some fields the user fills in and then they hit a "submit" button which hides all the buttons and gives them a read only PDF for printing purposes. So the u

  • Error Quering th spatial database.

    ERROR at line 1: ORA-29902: error in executing ODCIIndexStart() routine ORA-13004: the specified buffer size is invalid ORA-06512: at "MDSYS.SDO_INDEX_METHOD", line 83 ORA-06512: at line 1 null

  • R3trans -d  returning error (0012) server not starting

    hi all, our solution manager is installed on a window server.it was shut down for a regular maintenance.now when i'm starting it again its not starting.it shows "waiting for central instance SMS smsandbox01 01 to finish startup".. with R3trans -d fol