JPA @Version annotation with Timestamp and insert

Hi. I have the @Version annotation specified on a Timestamp field of my entity. The versioning works correctly as long as the Date is populated in the database, but when I insert an entity, I get a StaleObjectException. After some research, I found several references saying that the @Version attribute should not be set manually. So my question is: Does the @Version annotation initialize a Timestamp on insert by default, or is there some other annotation (eg - @Temporal or something) that has an attribute that specifies a default value on insert?
Thanks for your time.

Timur Akhmadeev wrote:
Hi,
I suspect this to be a JDBC issue.Nope, this is your schema design gap. It breaks the main principle of PK: to uniquely identify a row in a table always. Your PK doesn't satisfy it, since it depends on client's settings.Why is setting the JVM to UTC working ? This is the part that confuses me.
I create the 3 dates in Eastern time, then change the JVM default to UTC: the 3 inserts work.
I create the 3 dates in Eastern time, then leave the JVM to Eastern time , the 3rd insert gets the unique constraint error.
To me, the PK principle is not broken: these are 3 different UTC dates.

Similar Messages

  • My hard drive died last week, and I needed to install a new one.  Previously, I was able to save a .doc with text and inserted photo to .pdf and then to .jpg.  Now I can get the .pdf but can't determine what to do to convert to .jpg.  Does anyone know ?

    My hard drive died last week, and I needed to install a new one.  Previously, I was able to save a .doc with text and inserted photo to .pdf and then to .jpg.  Now I can get the .pdf but can't determine what to do to convert to .jpg.  Does anyone know ?

    Rather than do that, which means starting over from scratch, losing all your edits, organisation and so on, why not simply use iPhoto Library Manager to revert the Library to the older version? Easier, less destructive.
    The instructions on that are here
    If you really want to start over: you can access the Originals folder simply by going to your Pictures Folder and finding the iPhoto Library there. Right (or Control-) Click on the icon and select 'Show Package Contents'. A finder window will open with the Library exposed.

  • Problem with overwrite and insert keyboard commands

    I'm a new user, switching from FCP. I edited one project successfully with no trouble a couple of weeks ago. Now I'm in a second project and having a weird difficulty. Using a pretty new Mac 8 core tower.
    The insert and overlay keyboard commands (comma and period keys) don't work. They still work in the old project but not this one. If I start a new sequence and copy my timeline to it, the commands will work for awhile but ONLY with video, not with the audio tracks. Drag and drop works fine but that really slows me down.
    The clips I'm using are all the same format (H.264 from Canon 5DII and some still photos) as the first project. Only difference in this project is lots of chroma keying and some resizing of background still photos. Nothing unrendered.
    I started a new project just now and imported the problem project into it, started a new sequence, copied old sequence, and I get the same problem. I can drop in video with a keyboard command but not audio. Earlier it was not even doing video. Yesterday when I'd start a new sequence and do the same thing, it would give me video on the keyboard command but then eventually that would stop and it would do nothing. At one point the cursor would move over the width of the clip, as if it had been dropped into the timeline, but then that stopped as well.
    I've trashed preferences and that didn't work. I did that according to a procedure I found online. It said open up PP while holding down the Shift and Option keys. I did that twice. Nothing.
    To summarize: Keyboard commands for overwrite and insert edit do not work in this project but do in an older project.
    Any ideas?
    Thanks.
    Bill Pryor
    [email protected]

    Well, thanks to an email from another person who was having the same problem, it's all solved not.
    Operator error. Dang. Who knew--in FCP you select a track by clicking on the V or A buttons to the far left. In Premiere Pro you have to make sure BOTH the far left button and the one to the right that says Video 1, Audio 1, etc. are also clicked. They BOTH have to be light gray. In my first project, everything was properly activated but in the next project apparently they were not and that carried over to succeeding projects (even though I didn't change anything...at least consciously).
    So all as well now. No glitch, no bug. Just good ol' fashioned operator error. I will wear the dunce hat today.

  • Use of the "updlock" hint with update and insert statements

    I have inherited some stored procedures and am trying to figure out why the developers decided to use the "updlock" hint on many of the update and insert statements. I have looked around everywhere and have found only one explanation of why "update...with
    (updlock)" can be useful, namely when a table has no clustered index:
    http://www.sqlnotes.info/2012/10/10/update-with-updlock/ I have found nothing yet that mentions why "insert into...with (updlock)" might be used. I understand why the hint
    might be useful on select statements in some cases, but if all of the tables have clustered indexes, is there any good reason to use it on update and insert statements?
    Thanks,
    Ron
    Ron Rice

    This form of deadlock error can occur on a table which has a clustered index.
    If you are doing updates on a table which has a clustered index and that table also has a nonclustered index and the nonclustered index is used to find the row to update you can see this type of deadlock.  For example create a table with a clustered
    primary key index and a nonclustered index by running
    Create Table Foo(PK int primary key identity, OtherKey varchar(10), OtherData int);
    go
    Insert Foo Default Values;
    go 10000
    Update Foo Set OtherKey = 'C' + Cast(PK As varchar(10))
    Create Unique Index FooIdx On Foo(OtherKey);
    That creates a table with 10000 rows, a clustered index and a nonclustered index.  Then run
    Begin Transaction
    Update Foo Set OtherData = 1 Where OtherKey = 'C5'
    That will use the FooIdx index to find the row that needs to be updated.  It will get a U lock on the index row in the FooIdx index, then an X lock on the row in the clustered index, update that row, then free the U lock on FooIdx, but keep the X lock
    on the row in the clustered index.  (There is other locking going on, but to simplify things, I'm only showing the locks that lead to the deadlock).
    Then in another window, run
    Begin Transaction
    Update Foo Set OtherData = 2 Where OtherKey = 'C5'
    This will get a U lock on the index row in the FooIdx index, then try to get an X lock on the row in the clustered index.  But that row is already exclusively locked, so this second window will wait holding a U lock on FooIdx row and is waiting for
    an X lock on the clustered index row.
    Now go back to the first window and run
    Update Foo Set OtherData = 3 Where OtherKey = 'C5'
    This will once again try to get the U lock on the FooIdx row, but it is blocked by the U lock the second window holds.  Of course the second window is blocked by the X lock on the clustered index row and you have a deadlock.
    All that said, I certainly do not routinely code my updates with UPDLOCK.  I try to design databases and write code so that deadlocks will be rare without holding excessive locks.  The more locks you hold and the longer you hold them, the more
    blocking you will get and the slower your system will run.  So I write code that if a deadlock exception occurs, it is properly handled.  Then if too many deadlocks occur, that is the time to go back to the code to see what changes are needed to
    decrease the number of deadlocks (one way to do that may be to get locks earlier and/or hold them longer. 
    But I wouldn't worry much about this form of deadlock.  It is, in my experience, vary rare.  I don't recall ever seeing it in a production environment.
    Tom

  • PK with TIMESTAMP causes insert unique constraint error at DST switch

    Hi,
    I have a test that inserts rows in a table that has a TIMESTAMP in its PK.
    When inserting rows that cross over the November DST change, it tries to insert these dates:
    --- Sun Nov 02 02:00:00 EST 2008
    --- Sun Nov 02 01:00:00 EST 2008
    --- Sun Nov 02 01:00:00 EDT 2008
    This is the output of 3 different UTC dates. We can see that there are 2 x 1am, but they differ in their DST. They are really 3 different UTC dates.
    But I get this error:
    --- Expected error: ORA-00001: unique constraint (DDLTEST1.SYS_C00142622) violated
    But I can get around that error and can insert these same dates if I set my JVM to UTC. The inserts work so I suspect this to be a JDBC issue.
    I am using the Oracle Thin driver in a spring app:
    <property name="driverClassName" value="oracle.jdbc.driver.OracleDriver" />
    <property name="url" value="jdbc:oracle:thin:@localhost:db" />
    I can post the sample code but wonder if there is an obvious answer to this.
    Note that MySql had the same problem. I fixed it by specifying the UTC timezone in the connection string, like this:
    jdbc:mysql://[host]/[db]?useLegacyDatetimeCode=false&useTimezone=true&sessionVariables=time_zone='UTC'
    Any idea how to get around that problem without setting JVM to UTC ?
    Claude
    Edited by: user2678899 on 10 juin 2009 10:09
    I removed #2 work around which was wrong
    Edited by: user2678899 on 10 juin 2009 10:23

    Timur Akhmadeev wrote:
    Hi,
    I suspect this to be a JDBC issue.Nope, this is your schema design gap. It breaks the main principle of PK: to uniquely identify a row in a table always. Your PK doesn't satisfy it, since it depends on client's settings.Why is setting the JVM to UTC working ? This is the part that confuses me.
    I create the 3 dates in Eastern time, then change the JVM default to UTC: the 3 inserts work.
    I create the 3 dates in Eastern time, then leave the JVM to Eastern time , the 3rd insert gets the unique constraint error.
    To me, the PK principle is not broken: these are 3 different UTC dates.

  • Filename required with Timestamp and without '-' in between the Timestamp

    Hi All,
    I have a requirement were the file name along with time stamp should be as,
    FileNameyyyyMMddHHmmSS.txt
    But if i use File Construction mode as TimeStamp in receiver channel
    i am getting the file name as shown below
    FileName20110908-055553-153
    My requirement is to get the file name as
    FileName20110908055553153
    ie.. i dont want '-' in between the Time stamp.
    Can anybody suggest me the solution for this.
    Thanks
    Sai

    Hi All,
    I have created mapping  as
    CurrentDate---->UDF--->rootnode
    Currentdate set to : yyyyMMddHHmmSS
    UDF  code :   No imports
    String fileName ="DataAuditNewCustomer" + CurrentDate + ".txt";
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
    conf.put(key,fileName);
    return fileName;
    In sender Comm channel as:
    *i did not select ASMA*
    In receiver Comm channel i set the parameters as
    Filename schema : *
    fileConstruction mode : Create
    *ASMA attributes :  fileName*
    The file is being picked up but showing an error
    In MONI its showing an error message as :
    <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
    - <!--  Request Message Mapping
      -->
    - <SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="">
      <SAP:Category>Application</SAP:Category>
      <SAP:Code area="MAPPING">EXCEPTION_DURING_EXECUTE</SAP:Code>
      <SAP:P1>com/sap/xi/tf/_MM_NewCustomer_</SAP:P1>
      <SAP:P2>com.sap.aii.utilxi.misc.api.BaseRuntimeException</SAP:P2>
      <SAP:P3>RuntimeException in Message-Mapping transformatio~</SAP:P3>
      <SAP:P4 />
      <SAP:AdditionalText />
      <SAP:ApplicationFaultMessage namespace="" />
      <SAP:Stack>During the application mapping com/sap/xi/tf/_MM_NewCustomer_ a com.sap.aii.utilxi.misc.api.BaseRuntimeException was thrown: RuntimeException in Message-Mapping transformatio~</SAP:Stack>
      <SAP:Retry>M</SAP:Retry>
      </SAP:Error>
    Thanks
    Sai
    Edited by: sai_SHA on Sep 9, 2011 2:09 PM

  • Problem with SDO_FILTER combined with Timestamp and Order By using JDBC

    I'm having a problem with using SDO_FILTER. I've included a test driver below. It seems that I'm having a problem with combining the SDO_FILTER, Timestamp, ORDER BY and a nested table using the Oracle 11.1.0.7.0 driver against Oracle 11g. The below query queryNoWork results in the following error:
    Caused by: java.sql.SQLException: ORA-01422: exact fetch returns more than requested number of rows
    ORA-06512: at "MDSYS.SDO_3GL", line 1320
    at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:70)
    at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:133)
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:206)
    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:455)
    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:413)
    at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:1034)
    at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:194)
    at oracle.jdbc.driver.T4CPreparedStatement.executeForDescribe(T4CPreparedStatement.java:791)
    at oracle.jdbc.driver.T4CPreparedStatement.executeMaybeDescribe(T4CPreparedStatement.java:866)
    at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1186)
    at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3387)
    at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:3488)
    at oracle.jdbc.driver.OraclePreparedStatementWrapper.execute(OraclePreparedStatementWrapper.java:1374)
    at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.execute(WrappedPreparedStatement.java:299)
    All of the other query variations seem to work. The GEOM column referenced is a Linestring that has only 2 points, start and end. Any help on this would be greatly appreciated. Thanks!
    import java.math.BigDecimal;
    import java.sql.Connection;
    import java.sql.Date;
    import java.sql.Driver;
    import java.sql.DriverManager;
    import java.sql.PreparedStatement;
    import java.sql.ResultSet;
    import java.sql.Timestamp;
    import java.text.SimpleDateFormat;
    import java.util.ArrayList;
    import java.util.Enumeration;
    public class QueryTester
         public static void main(String[] args)
              try
                   SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
                   ArrayList<Object> queryParameters = new ArrayList<Object>();
                   queryParameters.add(new BigDecimal(0));
                   queryParameters.add(new Double(0));
                   queryParameters.add(new BigDecimal(180));
                   queryParameters.add(new Double(90));
                   queryParameters.add(new java.sql.Date(sdf.parse("2005-12-25").getTime()));
                   queryParameters.add(new java.sql.Date(sdf.parse("2005-12-26").getTime()));               
                   BigDecimal one = new BigDecimal(1);
                   DriverManager.registerDriver((Driver) Class.forName("oracle.jdbc.driver.OracleDriver").newInstance());
                   Enumeration<Driver> drivers = DriverManager.getDrivers();
                   while(drivers.hasMoreElements())
                        System.out.println(drivers.nextElement().getClass().getName());
                   Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@xxxx:1521:xxxx", "xxxx", "xxxx");
                   String queryNoWork = "select * from (select ROWNUM rowcount, a.* from (select * from TRACK_SEGMENTS where ( ( sdo_filter(GEOM, sdo_geometry(2003, 8307, null, sdo_elem_info_array(1, 1003, 3), sdo_ordinate_array(?, ?, ?, ?) ), 'MASK=ANYINTERACT') = 'TRUE' and END_DATE >= ?and START_DATE < ?) and 1 = 1 and 1 = 1) and ((START_DATATYPE = 'maritime_dense')) ORDER BY ID ) a) where rowcount between 1 and 30000";
                   String queryWorks0 = "select * from (select ROWNUM rowcount, a.* from (select * from TRACK_SEGMENTS where ( ( sdo_relate(GEOM, sdo_geometry(2003, 8307, null, sdo_elem_info_array(1, 1003, 3), sdo_ordinate_array(?, ?, ?, ?) ), 'MASK=ANYINTERACT') = 'TRUE' and END_DATE >= ?and START_DATE < ?) and 1 = 1 and 1 = 1) and ((START_DATATYPE = 'maritime_dense')) ORDER BY ID ) a) where rowcount between 1 and 30000";
                   String queryWorks1 = "select * from (select ROWNUM rowcount, a.* from (select * from TRACK_SEGMENTS where ( ( sdo_filter(GEOM, sdo_geometry(2003, 8307, null, sdo_elem_info_array(1, 1003, 3), sdo_ordinate_array(?, ?, ?, ?) ), 'MASK=ANYINTERACT') = 'TRUE' and END_DATE >= TO_TIMESTAMP('2005-12-25','YYYY-MM-DD') and START_DATE < TO_TIMESTAMP('2005-12-26','YYYY-MM-DD')) and 1 = 1 and 1 = 1) and ((START_DATATYPE = 'maritime_dense')) ORDER BY ID ) a) where rowcount between 1 and 30000";
                   String queryWorks2 = "select * from (select ROWNUM rowcount, a.* from (select * from TRACK_SEGMENTS where ( ( sdo_filter(GEOM, sdo_geometry(2003, 8307, null, sdo_elem_info_array(1, 1003, 3), sdo_ordinate_array(?, ?, ?, ?) ), 'MASK=ANYINTERACT') = 'TRUE' and END_DATE >= ?and START_DATE < ?) and 1 = 1 and 1 = 1) and ((START_DATATYPE = 'maritime_dense')) ) a) where rowcount between 1 and 30000";
                   String queryWorks3 = "select * from TRACK_SEGMENTS where ( ( sdo_filter(GEOM, sdo_geometry(2003, 8307, null, sdo_elem_info_array(1, 1003, 3), sdo_ordinate_array(?, ?, ?, ?) ), 'MASK=ANYINTERACT') = 'TRUE' and END_DATE >= ?and START_DATE < ?) and 1 = 1 and 1 = 1) and ((START_DATATYPE = 'maritime_dense')) ORDER BY ID";
                   String query = queryWorks0;
                   PreparedStatement s = conn.prepareStatement(query);
                   int parameterIndex = 0;
                   for (Object object : queryParameters) {
                        if (object instanceof Timestamp)
                             s.setDate(++parameterIndex, (Date) object);
                        else
                             s.setObject(++parameterIndex, object);
                   s.execute();
                   ResultSet results = s.getResultSet();
                   results.next();
                   System.out.println("executed query - " + results.getLong(1));
              catch (Exception e)
                   e.printStackTrace();
    }

    Is the TRACK_SEGMENTS table partitioned ?
    It looks like in the case where the SQL does not work, it is not using the Spatial index. So can you add some index hints
    in the query to force it to use the spatial index TRACK_SEGMENTS table ?
    siva

  • DBMS_TYPES with timestamp and interval does not seem to work.

    I have a PL/SQL script that seems to work for char,varchar,numerics, dates, but not for intervals. I basically took example code out of the Oracle manuals and stitched it together.
    The code in question is the function colTypeString. Apparently, interval is not being recognized as a type, so the function is returning back unknown. The documentation seems a bit spartan, so I thought perhaps you can help me out.
    Thanks.
    Here's the code:
    create table interval_test( intym interval year(4) to month, intdm interval day(3) to second(4) );
    execute oraforum_pkg.desc_query( 'select * from interval_test' );
    col_type     =     182, UNKNOWN_TYPE
    col_maxlen     =     5
    col_name     =     INTYM
    col_name_len     =     5
    col_schema_name =
    col_schema_name_len =     0
    col_precision     =     4
    col_scale     =     0
    col_null_ok     =     true
    col_type     =     183, UNKNOWN_TYPE
    col_maxlen     =     11
    col_name     =     INTDM
    col_name_len     =     5
    col_schema_name =
    col_schema_name_len =     0
    col_precision     =     3
    col_scale     =     4
    col_null_ok     =     true
    PL/SQL procedure successfully completed.
    Here's the package:
    -- Define the ref cursor types and function
    CREATE OR REPLACE PACKAGE oraforum_pkg IS
    FUNCTION colTypeString( typeId in integer) return varchar2; -- typeId from dbms_types
    PROCEDURE print_rec(rec in DBMS_SQL.DESC_REC);
    PROCEDURE desc_query( selectSql in varchar2 );
    END oraforum_pkg;
    CREATE OR REPLACE PACKAGE BODY oraforum_pkg IS
    FUNCTION colTypeString( typeId in integer)
    return varchar2 -- typeId from dbms_types
    is
    rval varchar2(40) := 'Unknown';
    BEGIN
    case typeId
    when DBMS_TYPES.NO_DATA then rval := 'NO_DATA' ;
    when DBMS_TYPES.SUCCESS          then rval := 'SUCCESS' ;
    when DBMS_TYPES.TYPECODE_BDOUBLE     then rval := 'BDOUBLE' ;
    when DBMS_TYPES.TYPECODE_BFILE     then rval := 'BFILE' ;
    when DBMS_TYPES.TYPECODE_BFLOAT     then rval := 'BFLOAT' ;
    when DBMS_TYPES.TYPECODE_BLOB     then rval := 'BLOB' ;
    when DBMS_TYPES.TYPECODE_CFILE     then rval := 'CFILE' ;
    when DBMS_TYPES.TYPECODE_CHAR     then rval := 'CHAR' ;
    when DBMS_TYPES.TYPECODE_CLOB     then rval := 'CLOB' ;
    when DBMS_TYPES.TYPECODE_DATE     then rval := 'DATE' ;
    when DBMS_TYPES.TYPECODE_INTERVAL_DS     then rval := 'INTERVAL_DS' ;
    when DBMS_TYPES.TYPECODE_INTERVAL_YM     then rval := 'INTERVAL_YM' ;
    when DBMS_TYPES.TYPECODE_MLSLABEL     then rval := 'MLSLABEL' ;
    when DBMS_TYPES.TYPECODE_NAMEDCOLLECTION then rval := 'NAMEDCOLLECTION' ;
    when DBMS_TYPES.TYPECODE_NUMBER     then rval := 'NUMBER' ;
    when DBMS_TYPES.TYPECODE_OBJECT     then rval := 'OBJECT' ;
    when DBMS_TYPES.TYPECODE_OPAQUE     then rval := 'OPAQUE' ;
    when DBMS_TYPES.TYPECODE_RAW          then rval := 'RAW' ;
    when DBMS_TYPES.TYPECODE_REF          then rval := 'REF' ;
    when DBMS_TYPES.TYPECODE_TABLE     then rval := 'TABLE' ;
    when DBMS_TYPES.TYPECODE_TIMESTAMP     then rval := 'TIMESTAMP' ;
    when DBMS_TYPES.TYPECODE_TIMESTAMP_LTZ then rval := 'TIMESTAMP_LTZ' ;
    when DBMS_TYPES.TYPECODE_TIMESTAMP_TZ then rval := 'TIMESTAMP_TZ' ;
    when DBMS_TYPES.TYPECODE_VARCHAR2     then rval := 'VARCHAR2' ;
    when DBMS_TYPES.TYPECODE_VARCHAR     then rval := 'VARCHAR' ;
    when DBMS_TYPES.TYPECODE_VARRAY then rval := 'VARRAY' ;
    else rval := 'UNKNOWN_TYPE';
    end case;
    return rval;
    END;
    PROCEDURE print_rec(rec in DBMS_SQL.DESC_REC) IS
    BEGIN
    DBMS_OUTPUT.PUT_LINE('col_type = '
    || rec.col_type || ', ' || colTypeString(rec.col_type) );
    DBMS_OUTPUT.PUT_LINE('col_maxlen = '
    || rec.col_max_len);
    DBMS_OUTPUT.PUT_LINE('col_name = '
    || rec.col_name);
    DBMS_OUTPUT.PUT_LINE('col_name_len = '
    || rec.col_name_len);
    DBMS_OUTPUT.PUT_LINE('col_schema_name = '
    || rec.col_schema_name);
    DBMS_OUTPUT.PUT_LINE('col_schema_name_len = '
    || rec.col_schema_name_len);
    DBMS_OUTPUT.PUT_LINE('col_precision = '
    || rec.col_precision);
    DBMS_OUTPUT.PUT_LINE('col_scale = '
    || rec.col_scale);
    DBMS_OUTPUT.PUT('col_null_ok = ');
    IF (rec.col_null_ok) THEN
    DBMS_OUTPUT.PUT_LINE('true');
    ELSE
    DBMS_OUTPUT.PUT_LINE('false');
    END IF;
    DBMS_OUTPUT.PUT_LINE('');
    END;
    PROCEDURE desc_query( selectSql in varchar2 ) IS
    c NUMBER;
    d NUMBER;
    col_cnt INTEGER;
    f BOOLEAN;
    rec_tab DBMS_SQL.DESC_TAB;
    col_num NUMBER;
    BEGIN
    c := DBMS_SQL.OPEN_CURSOR; -- Is this needed for parsing? Yes, as argument to PARSE
    DBMS_SQL.PARSE(c, selectSql, DBMS_SQL.NATIVE);
    -- d := DBMS_SQL.EXECUTE(c); -- Doesn't look necessary.
    DBMS_SQL.DESCRIBE_COLUMNS(c, col_cnt, rec_tab);
    * Following loop could simply be for j in 1..col_cnt loop.
    * Here we are simply illustrating some of the PL/SQL table
    * features.
    col_num := rec_tab.first;
    IF (col_num IS NOT NULL) THEN
    LOOP
    print_rec(rec_tab(col_num));
    col_num := rec_tab.next(col_num);
    EXIT WHEN (col_num IS NULL);
    END LOOP;
    END IF;
    DBMS_SQL.CLOSE_CURSOR(c);
    END;
    END oraforum_pkg;
    Message was edited by:
    user554561

    The issue is that DBMS_SQL and DBMS_TYPES have different typecodes. Which means you can't interrogate the DBMS_SQL.DESC_REC using DBMS_TYPES constants. You could create yourself a package of DBMS_SQL_TYPES.
    SQL> create table t ( ts timestamp, iv interval day to second );
    Table created.
    SQL>
    SQL> insert into t values ( systimestamp, interval '1' second );
    1 row created.
    SQL>
    SQL> declare
      2     c         integer           := dbms_sql.open_cursor ();
      3     rec_tab   dbms_sql.desc_tab;
      4     col_cnt   integer;
      5  begin
      6     dbms_sql.parse (c, 'select * from t', dbms_sql.native);
      7     dbms_sql.describe_columns (c, col_cnt, rec_tab);
      8
      9     for i in 1 .. col_cnt
    10     loop
    11        dbms_output.put_line ('Name: ' || rec_tab (i).col_name || '; Type: ' || rec_tab (i).col_type);
    12     end loop;
    13
    14     dbms_sql.close_cursor (c);
    15
    16     dbms_output.put_line ('DBMS_TYPES.TYPECODE_TIMESTAMP; Type: ' || DBMS_TYPES.TYPECODE_TIMESTAMP);
    17     dbms_output.put_line ('DBMS_TYPES.TYPECODE_INTERVAL_DS; Type: ' || DBMS_TYPES.TYPECODE_INTERVAL_DS);
    18
    19  end;
    20  /
    Name: TS; Type: 180
    Name: IV; Type: 183
    DBMS_TYPES.TYPECODE_TIMESTAMP; Type: 187
    DBMS_TYPES.TYPECODE_INTERVAL_DS; Type: 190
    PL/SQL procedure successfully completed.Regards

  • Version incompatibility with UCM and WLS

    Dear All,
    I just have some confusion.
    I have installed WLS 10.3.4 and houses the Webcenter 11G PS3 (11.1.14) also.
    But when I download the UCM 11GR1, I notice that it says it is not compatible with my Weblogic.
    I think I have downloaded the wrong version, I am looking for UCM 11G download to match my already
    setup domain but when I check the older release at OTN, i only can find Oracle Universal Content Management 10gR3 Downloads.
    Is this the same or is this copatible with my WLS?
    Thanks

    Hi Jose,
    This is a known interoperability problem with MS SOAP toolkit, which send what is refered to as untyped request. You have an option to accept untyped request in oc4j - look at section 12.2 of the 10.1.2 Web services guide [http://download-west.oracle.com/docs/cd/B14099_04/web.1012/b14027/custom.htm#BABEJDEC]. The tag is <accept-untyped-request> .
    Hope this helps,
    Eric

  • TDMS with timestamp and configurable channels

    I am trying to figure out a good way to determine how to line up data in a TDMS file with corresponding timestamps when the user in my application adds channels.
    Here's the scenario,
    Lets say I've been recording 10 channels (called Ch0,Ch1...Ch9) in a group called 'Data'. My data appears as follows in the TDMS file:
    (10 Ch's, 3 Samples) 
    Timestamp
    Ch0
    Ch1
    Ch2
    Ch3
    Ch4
    Ch5
    Ch6
    Ch7
    Ch8
    Ch9
    12:00:01 AM
    100
    200
    300
    400
    500
    600
    700
    800
    900
    1000
    12:00:02 AM
    100
    200
    300
    400
    500
    600
    700
    800
    900
    1000
    12:00:03 AM
    100
    200
    300
    400
    500
    600
    700
    800
    900
    1000
    Let's say now the user decides to add an additional channel to the group. The TDMS write function will add the channel, but the new data does not line up with the corresponding timestamp, instead it start writing to the first row as follows:
    (11 Ch's, 6 samples, 3 new channel samples)
    Timestamp
    Ch0
    Ch1
    Ch2
    Ch3
    Ch4
    Ch5
    Ch6
    Ch7
    Ch8
    Ch9
    Ch10
    12:00:01 AM
    100
    200
    300
    400
    500
    600
    700
    800
    900
    1000
    1100
    12:00:02 AM
    100
    200
    300
    400
    500
    600
    700
    800
    900
    1000
    1100
    12:00:03 AM
    100
    200
    300
    400
    500
    600
    700
    800
    900
    1000
    1100
    12:00:04 AM
    100
    200
    300
    400
    500
    600
    700
    800
    900
    1000
    12:00:05 AM
    100
    200
    300
    400
    500
    600
    700
    800
    900
    1000
    12:00:06 AM
    100
    200
    300
    400
    500
    600
    700
    800
    900
    1000
    I would want it to appear as follows:
    Timestamp
    Ch0
    Ch1
    Ch2
    Ch3
    Ch4
    Ch5
    Ch6
    Ch7
    Ch8
    Ch9
    Ch10
    12:00:01 AM
    100
    200
    300
    400
    500
    600
    700
    800
    900
    1000
    12:00:02 AM
    100
    200
    300
    400
    500
    600
    700
    800
    900
    1000
    12:00:03 AM
    100
    200
    300
    400
    500
    600
    700
    800
    900
    1000
    12:00:04 AM
    100
    200
    300
    400
    500
    600
    700
    800
    900
    1000
    1100
    12:00:05 AM
    100
    200
    300
    400
    500
    600
    700
    800
    900
    1000
    1100
    12:00:06 AM
    100
    200
    300
    400
    500
    600
    700
    800
    900
    1000
    1100
    Other than just starting a brand new TDMS file, can anyone think of a way to line the data up with its corresponding timestamp in this scenario? Or if there is a way to determine what the corresponding timestamp is when I read in the TDMS file.
    Any help is appreciated
    Thanks,
    -CAC

    From your description that the channel values have their corresponding timestamp, I assume that you are writing the waveform data rather than those basic data type(integer, double, etc.) which do not have any timestamp related information.
    The reason that the new data in Ch10 does not line up with the same timestamp data in other channels is because:
    When writing data to a channel, it cannot leave the first several positions vacant, and start writing from the nthe position.
    From the view of TDMS as a file format, it should only be responsible for data logging, and not assume any relationship between channels.
    In your case, the new data in Ch10 channel should have the timestamp starting from 12:00:04 AM to 12:00:06 AM, these data are definitely stored from the first position of Ch10, and .tdms file format cannot do anything to line up the data between channels.
    Timestamp
    Ch0
    Ch1
    Ch2
    Ch3
    Ch4
    Ch5
    Ch6
    Ch7
    Ch8
    Ch9
    Ch10
    12:00:01 AM
    100
    200
    300
    400
    500
    600
    700
    800
    900
    1000
    1100 (12:00:04 AM)
    12:00:02 AM
    100
    200
    300
    400
    500
    600
    700
    800
    900
    1000
    1100 (12:00:05 AM)
    12:00:03 AM
    100
    200
    300
    400
    500
    600
    700
    800
    900
    1000
    1100 (12:00:06 AM)
    12:00:04 AM
    100
    200
    300
    400
    500
    600
    700
    800
    900
    1000
    12:00:05 AM
    100
    200
    300
    400
    500
    600
    700
    800
    900
    1000
    12:00:06 AM
    100
    200
    300
    400
    500
    600
    700
    800
    900
    1000
    For your second question, there is a approach to determine the corresponding timestamp of each channel data read out from .tdms file. The waveform data type is stored in .tdms file in the form of three components:
    Value array value[ ]
    Starting time stamp t0, which is the base timestamp of a channel (or the timestamp of the first value in this channel)
    Time increment dt, the time interval between two data samples. (e.g. one sample per second, dt=1.0; four samples per second, then dt=0.25)
    So it's very easy to calculate the Timestamp of value[index] = t0 + (dt * index)  (0 <= index < num of samples in value[])
    Here is a VI in the attachment that demonstrates how to get the timestamp of each value in the channel.
    Regards,
    Tianbin
    Attachments:
    GetDataTimestamp.vi ‏21 KB

  • Can someone help with Incompatible versions error with taglib and project?

    Evening all,
    I am trying to import a tag library into my web project but I keep getting the error "Incompatible versions: Tag library is version 1.2, project version is version 1.1".
    I am using IBM Rational Application Developer as my IDE, Tomcat 5.0 as my target server and I'm compiling my code with SUNs 1.4.2 JRE.
    I created the tag library as a java project and my web site as a dynamic web project in IBM RAD.
    If anyone can tell me why I'm getting this error message and, if possible, how to fix it I would be very grateful.
    Thanks in advance,
    Alex

    Evening all,
    I am trying to import a tag library into my web
    project but I keep getting the error "Incompatible
    versions: Tag library is version 1.2, project version
    is version 1.1".1.1 and 1.2 might be referring to the servlet spec level supported by each.
    I am using IBM Rational Application Developer as myIDE, Irrelevant, I believe.
    Tomcat 5.0 as my target server and Tomcat version 5 implements the Servlet 2.4 and JavaServer Pages 2.0.
    I'm compiling my code with SUNs 1.4.2 JRE.That's fine.
    >
    I created the tag library as a java project and my
    web site as a dynamic web project in IBM RAD.I wonder if all you have to do is recompile and repackage your tag library. Maybe it's an older library that has to be updated to the spec supported by Tomcat 5.0
    If anyone can tell me why I'm getting this error
    message and, if possible, how to fix it I would be
    very grateful.
    Thanks in advance,
    AlexSee if that helps, Alex.
    %

  • Help with CDOSYS,  and insert into DB

    I'm using Dreamweaver 8, SQL Server 2000, Windows 2003
    Server.
    This is what so far I was able to achieve. Have a form that
    inserts records into the database, a confirmation page of the
    insert, and a simple CDOSYS message to notify me that a record have
    been inserted.
    Basically on the Form action I call the insert page, wich in
    turn redirects to the confirmation page that virtually includes the
    file for the email.
    What I would like to achieve, is the email that I've setup,
    to include in the body of the message all the fields that have been
    inserted, instead of a simple message that a record have been
    inserted. Below is the simple code that I´m using for the
    email. Can someone explain what do I have to modify or add and
    where?
    Thanks.
    Manuel
    <%
    Set myMail=CreateObject("CDO.Message")
    myMail.Subject="New Contact"
    myMail.From=""
    myMail.To="myMail@myProvider"
    myMail.Bcc="someonelse'sMail@hisProvider"
    myMail.Cc=""
    myMail.TextBody="There´s a new contact"
    myMail.Send
    set myMail=nothing
    %>

    Thanks if you read my first post, but I've figured it out.
    Thanks anyway
    Manuel

  • Returing clause with select and insert

    Hi,
    I am trying to use the following query but its not working.I want to know whether this syntax is valid.
    Insert into t_name( , , ,)
    Select , , , from t_name2
    Returing into , , , .
    There is only one row I am dealing with.
    Thanks a Lot !!!
    Edited by: user10619253 on Jan 16, 2009 12:52 AM

    Hi user michaels2,
    Whwn I am trying with the above example its working but for more then 1 column its not working
    SQL> declare
    2 x int;
    3 begin
    4 insert into emp (empno,ENAME)
    5 values ( ( select 100,'ABC' from dual ) )
    6 returning empno into x;
    7 dbms_output.put_line ('Last Value Inserted: '||to_char (x));
    8 end;
    9 /
    values ( ( select 100,'ABC' from dual ) )
    ERROR at line 5:
    ORA-06550: line 5, column 8:
    PL/SQL: ORA-00947: not enough values
    ORA-06550: line 4, column 4:
    PL/SQL: SQL Statement ignored
    SQL>
    Thanks !!!

  • HELP! i created a movie with pictures and inserted clips from video I taped, then added music. It publishes and I made a dvd.revised this and during it, got error, now the video clips go black although I see the clips. WHAT to do??

    After I upgraded the Imovie to the latest vesion, II started getting errors and it would boot me out. I see the movie clips but when it plays or previews its a a black screen, althought you can hear the backgorund music I added. I have reimported thefile clips and they will play in edit mode but when re insert the same clips they still play black.. how do i get this to work!?!

    ps when syncing it jumps through steps 1 - 4 real fast, i seem to remeber iphone showing the number of tracks transferring and names, but i see nothing? then it sits on 5 saying "waiting for changes to be applied"

  • TDMS with timestamp and different tab creation

    Hello all,
    I would like to ask you how can I get readings from two voltage sensors and save them into .tdms format. However, as these readings will be continuous and long, I need one .tdms file for each day for management purposes. For management purposes again I'd like to have reading for each hour of the day in separate tabs.
    Moreover, if convenient I'd like the date/time next to each reading (total three columns - 1. date/time 2. Sensor #1 3. Sensor #3).
    I know that partial solutions to this problem are all over the place but I'm not as proficient in LabVIEW to be able to assemble this information. If you could help me I would greatly appreciate it!
    Thanks in advance!
    Solved!
    Go to Solution.

    Hi Settler,
    An easy way to change the chanel name would be to generate a file path that is dependent on the current time. 
    I've attached a simple VI that converts a timestamp into a string of the current hour. I hope this helps.
    -N
    National Instruments
    Applications Engineer
    Attachments:
    Time Stamp to Hour String.vi ‏7 KB

Maybe you are looking for

  • Converting PM from trial to full version

    I had asked in another thread whether I could download and install the current tryout version of PM, and then use my old serial number from a PM 7 upgrade I had registered with Adobe back in 2002.  I was under the impression this process would work f

  • Plain HTTP Adapter - How to add CR/LF into Prolog?

    Hi all! I have to do a multipart/formdata request to an external HTTP Server. This requires to set boundaries etc. AND to add Carriage Returns / Line Feeds into the HTTP-Body. I think I could solve the problem using the Prolog / Epilog functionality

  • Having Problem with logon & logoff Triggers for the SCHEMA

    hi, I have created triggers "LOGOFF_TRIG" & "LOGON_TRIG" . This triggers fires each time the user SCOTT logings and logoff from the database and stores the info in table log_trig_table. Below the code of the trigger LOGOFF_TRIG CREATE OR REPLACE TRIG

  • Internal order not defaulting

    Hey Guys, we are using internal orders as capital investment measures. The internal order has to be assigned to the capital investment measure inorder for the order to be budgetted. In one of my systems(4.6) the order automatically is update in the c

  • Export command syntax for OA page in R12

    Hi, Can any one let me know the syntax for export command for an OA page in R12. I have tried with the 11i export command, but could not get the page. Thanks, Divya