Delete rows with time stamp

Dear All,
I am trying to delete few rows, which have date and timestamp. I was able to delete the rows except dates with timestamp "12:00:00 PM". I even tried the "trunc" function. Please find the sample data below.
GC_ID--------COMPANY_ID......TRANSACTION_DATE----------TRANSACTION_CODE
14558-----------101350-------------1/31/2009 12:00:00 PM-------------6550
14528-----------101080-------------1/31/2009 12:00:00 PM-------------1510
14308-----------101510-------------1/31/2009 12:00:00 PM-------------1511
14308-----------101510-------------1/31/2009 12:00:00 PM-------------1506
14818-----------101611-------------1/31/2009 12:00:00 PM-------------1511
With Regards
Phani

If you want to be precise and have other rows where seconds and minutes are specified then specify "AM" in the format mask, as follows;
create table t
(gc_id number
,company_id number
,transaction_date timestamp
,transaction_code number
insert into t values (14558, 101350, to_timestamp('01/31/2009 12:00:00 PM', 'mm/dd/yyyy hh12:mi:ss AM'), 6550)
delete from t where transaction_date = to_timestamp ('01/31/2009 12:00:00 PM', 'mm/dd/yyyy hh12:mi:ss AM')
/or better still use;
'01/31/2009 12:00:00', 'mm/dd/yyyy hh24:mi:ss'

Similar Messages

  • Deadlock when delete rows with blob.

    Hello
    I have the following issue. I try to clean a table that contains a BLOB column.
    To do this I use SQLDBC I create a statement that contains the LOB column, I fetch the line, load the Blob. and before fetching the next line, I send a delete request. and I fall in the deadlock.
    If I fetch the next line before sending the delete request there is no deadlock, there is also no deadlock if i do not request le LOB column in the select.
    In fact when I made select with LOB, there is the follwing line in DOMAIN.LOCKS
    SESSION;TRANSCOUNT;PROCESS;USERNAME;DATE;TIME;TERMID;LASTWRITE;LOCKMODE;LOCKSTATE;APPLPROCESS;APPLNODE;SCHEMANAME;OWNER;TABLENAME;TABLEID;ROWIDLENGTH;ROWIDHEX;ROWID;
    295513;                4290;438;ESKDBADM;2010-06-17;12:05:46;ly-delorme-u..1674;?;tab_share;?;5748;LY-DELORME.esker.corp;?;?;?;0000800000046919;0;?;?
    when i send the delete request the following lock appears in DOMAIN.LOCKS. A exclusif lock on the column I want to delete. It's ok
    SESSION;TRANSCOUNT;PROCESS;USERNAME;DATE;TIME;TERMID;LASTWRITE;LOCKMODE;LOCKSTATE;APPLPROCESS;APPLNODE;SCHEMANAME;OWNER;TABLENAME;TABLEID;ROWIDLENGTH;ROWIDHEX;ROWID;
    295521;                4287;167;ESKDBADM;2010-06-17;12:05:49;ly-delorme-u..1674;         5;row_exclusive;write;5748;LY-DELORME.esker.corp;ESKDBADM;ESKDBADM;DBM350_AUTOTESTXML;0000000000000934;5;00C51133800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000;
    BUT there is a dead lock , I think because of the following entry in DOMAIN.LOCK_WAITS
    TABLENAME;TABLEID;H_TERMID;H_PROCESS;H_APPLPROCESS;H_APPLNODE;H_ROWIDHEX;H_ROWID;H_LOCKMODE;H_DATE;H_TIME;H_LOCKTIMEOUT;R_TERMID;R_PROCESS;R_APPLPROCESS;R_APPLNODE;R_ROWIDHEX;R_ROWID;R_REQMODE;R_DATE;R_TIME;R_REQTIMEOUT;
    ?;0000800000046919;ly-delorme-u..1674;438;5748;LY-DELORME.esker.corp;?;?;tab_share;2010-06-17;12:05:46;?;ly-delorme-u..1674;167;5748;LY-DELORME.esker.corp;?;?;tab_exclusive;2010-06-17;12:05:49;      3585
    The database request a tab_exclusive lock on tableid 0000800000046918 but there is already a tab_share lock on this.
    Do you why there is a lock on the table :  tableid 0000800000046918 ?
    How to avoid this lock using SQLDBC ?
    Thanks for you help.
    Yann.

    this is the same reply as previous reply, this carriage return. I hope.
    Hello,
    Here is code that explain my issue.
    I create a table like this :
    create table "ESKDBADM"."DBM350_AUTOTESTXML"( "MSN" INTEGER not null, "DIST_FILE" BLOB, constraint SYSPRIMARYKEY primary key ("MSN"))
    And then I try to delete row with the following program. I do not understand why the request SELECT Msn, DIST_FILE FROM DBM350_AUTOTESTXML set a share lock on the tableid : 000080000004691D.
    I do not find this tableid in the "SYSINFO"."FILES" table.
    SESSION;TRANSCOUNT;PROCESS;USERNAME;DATE;TIME;TERMID;LASTWRITE;LOCKMODE;LOCKSTATE;APPLPROCESS;APPLNODE;SCHEMANAME;OWNER;TABLENAME;TABLEID;ROWIDLENGTH;ROWIDHEX;ROWID;
    295697; 5220;172;ESKDBADM;2010-06-21;11:01:40;ly-delorme-u..1CDC;?;tab_share;?;7388;LY-DELORME.esker.corp;?;?;?;000080000004691D;0;?;?
    // SQLDBC.cpp : Defines the entry point for the console application.
    // YOU MUST CHANGE CONNECTION SETTINGS.
    #include "stdafx.h"
    #include <stdio.h>
    #include <tchar.h>
    #include <comdef.h>
    #include <iostream>
    #include "SQLDBC.h"
    using namespace SQLDBC;
    static void parseArgs(int argc, wchar_t **argv);
    static SQLDBC_Connection *connectDB(SQLDBC_Environment * env = NULL);
    static char* convertToUCS2(char *src);
    static void usage();
    SQLDBC_Environment *g_env;
    typedef struct ConnectArgsT {
      bstrt username;
      bstrt password;
      bstrt dbname;  
      bstrt host;    
      bstrt request;    
    } ConnectArgsT;
    ConnectArgsT connectArgs;
    void exitOnError(SQLDBC_ErrorHndl &err);
    int _tmain(int argc, _TCHAR* argv[])
       parseArgs(argc, argv);
       SQLDBC_Connection *conn = connectDB();
       //* Create a new statment object and execute it.
       SQLDBC_PreparedStatement *stmt = conn->createPreparedStatement();
       // FREEZE
       if (connectArgs.request.length() == 0)
               connectArgs.request = "SELECT Msn, DIST_FILE FROM DBM350_AUTOTESTXML";     
       /* NO FREEZE
       if (connectArgs.request.length() == 0)
               connectArgs.request = "SELECT Msn FROM DBM350_AUTOTESTXML";
       char command = (char)((LPCWSTR)(connectArgs.request));
        //* Executes the UNICODE encoded SQL command.
       SQLDBC_Retcode ret = stmt->prepare((const char*)command, SQLDBC_StringEncodingType::UCS2Swapped);
       exitOnError(stmt->error());
       stmt->execute();
       exitOnError(stmt->error());
       // * Get the resultset.  
       SQLDBC_ResultSet *result;
       result = stmt->getResultSet();
       exitOnError(stmt->error());
       // * Fetch the row from the resultset.     
       result->next();
            SQLDBC::SQLDBC_RowSet* pRowset =  result->getRowSet();
         ret = pRowset->fetch();          
       exitOnError(result->error());
       wchar_t szString[30];
       SQLDBC_Length ind;
    Get a string value from the column.
       result->getObject(1, SQLDBC_HOSTTYPE_UCS2_SWAPPED, szString, &ind, sizeof(szString)); // Retreive MSN.
       // Delete de line.
       // Create a new connection for delete
       SQLDBC_Connection *conn2 = connectDB(g_env);
       //* Create a new statment object and execute it.
       SQLDBC_PreparedStatement *stmt2 = conn2->createPreparedStatement();
         std::wstring st = L"DELETE FROM DBM350_AUTOTESTXML WHERE MSN=";
         st +=  szString;
         stmt2->prepare((char*)st.c_str(), SQLDBC_StringEncodingType::UCS2Swapped);
        //* Executes the UNICODE encoded SQL command.
         ret = stmt2->execute();
       exitOnError(stmt->error());
       printf("%s\n", szString);
       return 0;
    static char *convertToUCS2(char *src)
      int len = strlen(src);
      wchar_t w=(wchar_t)calloc(len, sizeof(wchar_t));
      int nc = mbstowcs(w, src, len);
      if ((size_t)-1 == nc) {
        fprintf(stderr, "Conversion to UCS2 failed. Execution stopped.\n");
        exit(1);
      short s=(SQLDBC_Int2)calloc(nc+1, sizeof(SQLDBC_Int2));
      int i;
      for(i=0; i<nc; i++) {
        s<i> = w<i>;
      free(w);
      return (char*)s;
    static char* strupper(char *str)
        char *p=str;
        while(*p) {
            p=toupper(p);
            ++p;
        return str;
    static wchar_t *argv0;      
    #ifdef WIN32
    #define STRICMP _stricmp
    #else
    #define STRICMP strcasecmp
    #endif
    SQLDBC_Connection *connectDB(SQLDBC_Environment * env)
      char errorText[200];
      SQLDBC_Retcode rc;
      if (g_env == NULL)
    Every application has to initialize the SQLDBC library by getting a
    reference to the ClientRuntime and calling the SQLDBC_Environment constructor.
           SQLDBC_IRuntime *runtime;
           runtime = SQLDBC::GetClientRuntime(errorText, sizeof(errorText));
           if (!runtime) {
              fprintf(stderr, "Getting instance of the ClientRuntime failed %s\n", errorText);
              usage();
           env = new SQLDBC_Environment(runtime);
           g_env = env;
    Create a new connection object and open a session to the database.
      SQLDBC_Connection *conn = env->createConnection();
      printf("Connecting to '%s' on '%s' as user '%s'\n",
             (char)connectArgs.dbname, (char)connectArgs.host, (char*)connectArgs.username);
      rc = conn->connect(connectArgs.host, connectArgs.dbname,
                         connectArgs.username, connectArgs.password);
      if(SQLDBC_OK != rc) {
        fprintf(stderr, "Can't connect to '%s'.\nERROR: %d:'%s'\n",
                connectArgs.dbname, conn->error().getErrorCode(), conn->error().getErrorText());
        exit(1);
      return conn;
    static void parseArgs (int argc, wchar_t **argv)
      argv0 = wcsdup(argv[0]);
    setting defaults for demo database
      connectArgs.username = "ESKDBADM";
      connectArgs.password = "DELORME";
      connectArgs.dbname = "EDP350";
      connectArgs.host = "ly-delorme";
    use values from command line
      if (argc > 5) {
        connectArgs.request = argv [5];
      if (argc > 4) {
        connectArgs.host = argv [4];
      if (argc > 3) {
        connectArgs.dbname = argv [3];
      if (argc > 2) {
        connectArgs.password = argv [2];
      if (argc > 1) {
        if (!wcsicmp(argv [1], L"-h"))
          usage();
        else {
          connectArgs.username = argv [1];
      strupper(connectArgs.username);
      strupper(connectArgs.password);
    void exitOnError(SQLDBC_ErrorHndl &err)
      if(err) {
        fprintf(stderr, "Execution stopped %d:'%s'", err.getErrorCode(), err.getErrorText());
        exit(1);
    static void usage()
      wchar_t *s = wcsrchr(argv0, L'/');
      if (!s)
        s = wcsrchr(argv0, L'
      if (s)
        *s = '\0';
      printf("Syntax: %s [-h] | [<connect_options>]\n"
             "\tconnect_options :: \n"
             "\t\t[ <username> \n"
             "\t\t[ <password>\n"
             "\t\t[ <database_name>\n"
             "\t\t[ <database_server> ]]]]\n"
               "\t\t[ <request> ]]]]\n"
             "\tCalling %s without any arguments will use user '%s','%s'\n"
             "\t\ton database '%s' at server '%s'\n",
             argv0, argv0,
             connectArgs.username, connectArgs.password,
             connectArgs.dbname, connectArgs.host);
      exit(1);

  • Deleting  rows with missing values in field in start routine of update rule

    Hello experts,
    how can I delet rows with missing values in a specific field in the start routine of update rules?
    I think ABAP code should look something like this:
    delete ...  from DATA_PACKAGE where Z_NO = ''.
    thanks in advance for any suggestions!
    hiza

    Write:
    delete data_package where field = value.
    Hope it helps.
    Regards

  • Mail attachment with time stamp

    Hi
    My scenario is Proxy to Mail.
    On receiver side I am getting the data as an attachment but i want that attachment with time stamp.
    How to add time stamp to the attachment in reciever mail adapter.
    Regards
    Sowmya
    Edited by: Sowmya on Aug 28, 2008 12:24 PM

    hi sowmya,
       The bellow link for MessageTransformBean..
      [http://help.sap.com/saphelp_nw70/helpdata/EN/57/0b2c4142aef623e10000000a155106/content.htm]
      In that ContentDisposition is used to fill the value for Attachment file name..
      Its allows the value accordingly "RFC1806" Note..
      RFC1806 allows accordingly RFC822 ..
      Check RFC822 ..
        5.  DATE AND TIME SPECIFICATION
    Regards,
    Prakasu

  • File name for append processing mode with time stamp

    Hi Experts
    we are doing file to file scenario using the processing mode as Append.
    the requirement for us to append the files and we need to have new file name with time stamp added to the appended file.but in the processing mode of the file adapter either we can append or add time stamp. thatz the problem I am facing now.
    we are doing file based processing not message based ,micheal blog regarding the dynamic file name is for message based not for file based.
    Please provide your valuable comments.
    Thanks
    Faheem

    Hi mohamed,
                      I suggest you to map the target source structure to the required filename u want, like for example ur filename is input26062008.txt means to the target structure u perform the following mapping
    constant (input) concat with currentdate function --> concat with constant .txt --> map this concat to target. So u will get the filename u expected with the time.
    Then in the communication channel u select the mode as append. Now ur requirement will get solve i think so. plz try.
    Regards,
    Murugavel

  • How to read multiple Digital samples and plot a chart with time stamps

    Hi,
     Could anyone send me a code that:
    1. Reads 'multiple samples(lets say 4) from single digital input' 
    2. 'plot digital data as a chart with time stamps'
    3. Find frequency
    4. Log data into file with time stamps
    I have attached the code which i tried.
    Thanks,
    LK
    Attachments:
    DigitalNSample.vi ‏27 KB
    DigitalNSample.vi ‏27 KB

    Hi,
     Could anyone send me a code that:
    1. Reads 'multiple samples(lets say 4) from single digital input' using NI USB 6009 or NI USB 6251.
    2. 'plot digital data as a chart with time stamps'
    3. Find frequency
    4. Log data into file with time stamps
    I have attached the code which i tried.
    Thanks,
    LK
    Attachments:
    DigitalNSample.vi ‏27 KB

  • TDMS viewer not showing data with time stamp

    Need help with time stamping data in a TDMS file generated by DAQ Assistant.
    When I use the TDMS Viewer, with the x-scale set to absolute time, the date starts at 1903. If I use Excel to look at the file the start time is correct (i.e. 2013).
    Solved!
    Go to Solution.

    Bo_Xie, I have simplifed my VI and now able to display the correct time stamp. Thank for your time!

  • Advertisement Details of Specific Computer with Time Stamp

    Hello Guys,
    Could you please help me how to get Advertisement Details of Specific Computer with Time Stamp?
    Thanks in Advance.
    Mukhyaprana

    It's true that there is no reliable install date, but IMO last status time for an advertisement is usually close enough. 
    Select r.name0, adv.advertisementname, stat.laststatename, stat.lastexecutionresult, stat.lastStatusTime
    from v_r_system r
    inner join v_clientAdvertisementStatus stat on stat.resourceID = r.resourceID
    inner join v_advertisement adv on stat.AdvertisementID = adv.AdvertisementID
    where r.name0 = 'clientname'
    order by adv.advertisementname

  • Apache Trinidad is running with time-stamp checking enabled.

    Experts,
    Contents of my web.xml file
    <context-param>
        <description>If this parameter is true, there will be an automatic check of the modification date of your JSPs, and saved state will be discarded when JSP's change. It will also automatically check if your skinning css files have changed without you having to restart the server. This makes development easier, but adds overhead. For this reason this parameter should be set to false when your application is deployed.</description>
        <param-name>org.apache.myfaces.trinidad.CHECK_FILE_MODIFICATION</param-name>
        <param-value>false</param-value>
      </context-param>When my application runs i get the following on the weblogic console
    <ViewHandlerImpl> <_checkTimestamp> Apache Trinidad is running with time-stamp checking enabled. This should not be used in a production environment. See the org.apache.myfaces.trinidad.CHECK_FILE_MODIFICATION property in WEB-INF/web.xml
    <UIXEditableValue> <_isBeanValidationAvailable> A Bean Validation provider is not present, therefore bean validation is disabled
    Isnt it a bit strange ? Please advise what is wrong.
    thnks
    jdev 11.1.2.1

    If you're talking about the integrated WLS, time-stamp checking is automatically enabled no matter what so that changes you make in the IDE can be picked up. It's nothing to worry about.
    John

  • Inserting Current Date with time stamp in oracle database

    Hi Experts,
                     I want to insert the current Date and time stamp in a field in the Oracle Database Table.
    I am able to insert date but i am not able to insert the date with time stamp. Any Suggestions??
    Thanks
    Naveen

    Naveen,
    Do you want to get current date (from sysdate) with a specific format or transform a value containing a date/time value to insert it in ORACLE ?
    Usually, you insert current datetimestamp in a date field using this :
    TO_DATE(sysdate,'dd/mm/yyyy hh:mi:ss')
    you may have to tweak the format pattern ('dd/mm....') according to your needs
    if you want to transform a date, use something like this:
    TO_DATE(your_date,your_format)
    but make sure your format is compliant with your date, ie
    TO_DATE('31/12/2008','MM/DD/YYYY') could raise error (litteral does not match) cuz ORACLE can't recognize 31 as a month pattern
    Chris

  • File with time stamp

    Hi All,
    I using RFC to file scenario ,in this when file is created it folder it is coming with date and time stamp.but i am not using add time stamp in processing paramerts.i have checked the file name in communication channel monitoring it is coming without timestamp
    but in folder file is getting created with time stamp.
    Regards

    Hi Gangadhar,
    In the receiver file adapter, under Processing tab, see the value of File Construction Mode.
    This value should be Create instead of Add Time Stamp.
    After making the changes save & activate the file receiver channel. The output file then will not have timestamp appended to its name.
    Regards,
    Gautam Purohit

  • Bounce with time stamp

    hi, is there a way to bounce with time stamp in logic? can logic automatically put time stamped files in the right place in the arrange window?
    thx, w

    Hi, Acmarie.
    Thank you for visiting Apple Support Communities. 
    To see what time a message was sent or received. Drag any bubble to the left.  Below, I have included the user guide which references this new feature on page 66. 
    iPhone User Guide
    Cheers,
    Jason H. 

  • Where clause with time stamp

    Hii,
    I have an issue with using where clause with time stamp. My requirement is to
    select * from driver_on_policy
    where last_change_datetime = '2001-03-06 19:00:06'
    date is in this form 6/3/2001 7:00:06 PM
    thnks
    sam

    If you want to use '6/3/2001 7:00:06 PM', then
    where last_change_datetime = to_timestamp('6/3/2001 7:00:06 PM','DD/MM/YYYY HH:MI:SS PM')If you can use a literal string in ANSI standard YYYY-MM-DD HH24:MI:SS format, then just
    where last_change_datetime = timestamp '2001-03-06 19:00:06' (That 'DD/MM' might need to be switched around to 'MM/DD' if you are in America.)
    Message was edited by:
    William Robertson

  • Can someone help with a previous post labeled "Writing to a data file with time stamp - Help! "

    Can someone possibly help with a previous post labeled "Writing to a data file with time stamp - Help! "
    Thanks

    whats the problem?
    Aquaphire
    ---USING LABVIEW 6.1---

  • Formatting a string with time stamp and double precision numbers

    %s\t%f\r%f
    This is a format string that I have in old code that I've decided to change.  Problem is I cannot make sense of the string codes in my own old code! Let me explain what I want, and hopefully someone can explain how to do it.
    I am using the format into string subvi to merge a time stamp (formatted as %m%d%Y%H%M%S%5u) and two different double precision numbers.  This string is then wired into the Write Characters to File subvi so that I can record data as a .txt file, and open it in either Matlab or Excel.  There is a minor problem with the string format above because in excel the first time stamp entry is blank, and the first loop only gives the two double precision numbers withouth the time stamp - the time stamp appears in the next loop (probably a looping issue and not due to the string format, but if you see differently please let me know).  Now what I want to do is 1. potentially fix that problem and 2. add some more doubles. 
    1. Is there a string format issue that is evident that I am not seeing that causes the time stamp to be formatted into the string after a carriage return?  Or should I be looking at looping issues?
    2. How do I add another one - three floating point numbers (double precision)?  Are the \'s marking different numbers in this string constant?  Or is it the %?  I can't find any information about the \'s, but I see that % begins the format specifier. 
    Ideally, I want these data in the following columns:  Date, Time(absolute), FP, FP, FP, carriage return for the next loop (FP is floating point double precision number).
    Thanks,
    Brad

    Hi JonN,
    Here there is no need of string concordinate function (in your code), the same result you can find if you connect the output of the format string to shift register, and shift register in data to initialize string connector in format into string function.
    <<KUDOS ARE WELCOME>>
    ELECTRO SAM
    For God so loved the world that he gave his one and only Son, that whoever believes in him shall not perish but have eternal life.
    - John 3:16

Maybe you are looking for

  • ITunes 8.1 Update Problem

    My computer is having problems updating iTunes to 8.1. It would never finish (it just sits there "installing" with one segment on the progress bar left ... for hours and hours). After that, I hit "Stop" and of course its sitting there (still) doing t

  • Effective PPI in .eps files

    Anyone know how to extract the effective ppi info in .eps files? Photoshop.eps and Illustrator.eps files are different, so whichever you may have info on would be appreciated. I believe Illustrator generated ones are read as .pdf docs, so it may be i

  • Joining Multiple facts to the multiple Dimension tables

    Hi All, We have multiple fact tables which are Joined to common Dimension tables. We join them in physical layer and maintain Left outer join in the BMM. I do not get any consistency errors. But when I run report I get error. "could not find level de

  • Possible to install msata drive in probook 4330s WWAN slot?

    Hi, Can someone verify if it is possible to install an msata SSD into the WWAN slot of a probook 4330s and use it as a OS boot drive? If it is possible, is there any information on how to install this and how to enable the boot option. Thanks.

  • TS3989 I can't see my photo stream at my icloud, can someone tell what to do

    I update my iphone to IOS6 and activate my icloud. When I visit icloud it does not appear photo stream. The iphone has ON to automatically sinc photo stream. Same problem with whatsup photos, it doesnt appear at photo stream nor photo album