Nulls in Rowsets

The issue with dataTables is well known - they currently don't handle fields with nulls in them gracefully. But it also appears there is an issue with standard rowSets -
I have a panelGrid of textFields, and if one of my columns in the rowSet is null, the page doesn't even create the HtmlInputText object's value - so when I try to use the idiomatic phrase:
fooRowset.updateString("Col1", getTfName().getValue().toString() );
I throw a null ptr exception from the subphrase "getTfName().getValue()" (I broke it all out and did it step by step...)
Question, when the dataTable issue with nulls gets figured out, will have a fix for this one too? Will the update center have a patch of any this anytime before the end of the year? (I'm starting to push my deadlines.)
(On a related point, the fix that I used for the editing of nulls in tables as posted here in a thread doesn't work in this case, because you can't 'loop' thru the textFields...)
(Maybe a dataTable that can be layout 'sideways' would be useful? If it did a vertical layout, with rows marching off to the right, instead of down, would atleast give us a way to edit a record in a rowset that only contained one row... and we wouldn't have to mess with panel grids??) I'd write something if I knew how... have a rowSet, and create a 2-column panelGrid with the name of the column in a outputText, and then the value of the row's column in a textField... some sort of dataForm object on the palette... california dreamin'....
cheers.

Hi,
Thanks for your Suggestions. A request has been filed for the same.
Regards.

Similar Messages

  • Using TimesTen in a heterogeneous  environment

    TimesTen works as a standalone server or in conjunction with Oracle and other TimesTen datastores.
    Since TimesTen uses native odbc connections (or possibly others) is there anyway one can connect TimesTen to other RDBMS as oposed to Oracle. If so what connection mechanisms can be used for this purpose.
    Tthanks,
    Mich

    OK with tracing enabled including to the client screen (driver manager has a GUI interface from Sybase to turn on tracing etc I get):
    Table CACHEADM.SALES2:
    Columns:
    PROD_ID NUMBER NOT NULL
    CUST_ID NUMBER NOT NULL
    TIME_ID DATE NOT NULL
    CHANNEL_ID NUMBER NOT NULL
    PROMO_ID NUMBER NOT NULL
    QUANTITY_SOLD NUMBER (10,2) NOT NULL
    AMOUNT_SOLD NUMBER (10,2) NOT NULL
    Ok this table has only 10 rows. I bet the cause is that time_id column conversion!
    1> select PROD_ID, CUST_ID,CHANNEL_ID, PROMO_ID, QUANTITY_SOLD, AMOUNT_SOLD from sales2
    2> go
    PROD_ID CUST_ID CHANNEL_ID PROMO_ID QUANTITY_SOLD AMOUNT_SOLD
    13.000000 987.000000 3.000000 999.000000 1.00 1283.26
    13.000000 1660.000000 3.000000 999.000000 1.00 1283.26
    13.000000 1762.000000 3.000000 999.000000 1.00 1283.26
    13.000000 1843.000000 3.000000 999.000000 1.00 1283.26
    13.000000 1948.000000 3.000000 999.000000 1.00 1283.26
    13.000000 2273.000000 3.000000 999.000000 1.00 1283.26
    13.000000 2380.000000 3.000000 999.000000 1.00 1283.26
    13.000000 2683.000000 3.000000 999.000000 1.00 1283.26
    13.000000 2865.000000 3.000000 999.000000 1.00 1283.26
    13.000000 4663.000000 3.000000 999.000000 1.00 1283.26
    Results processing ended, MaxResultSize limit, [1000], reached.
    (10 rows affected)
    Now let us try the date field time_id
    1> select TIME_ID from sales2
    2> go
    Explicit or implicit COMMIT failed.
    Results Processing, Conversion Error
    Results Processing, Conversion Error
    Results Processing, Conversion Error
    Results Processing, Conversion Error
    Results Processing, Conversion Error
    Results Processing, Conversion Error
    Results Processing, Conversion Error
    Results Processing, Conversion Error
    Results Processing, Conversion Error
    Results Processing, Conversion Error
    TIME_ID
    (10 rows affected)
    And the trace file shows:
    TraceEvents 03/22/2010 11:42:03.321187 TimesTen 12 cacheadm isql [slcon.cpp(814)] > smConnectionConcrete::Language
    TraceEvents 03/22/2010 11:42:03.321263 TimesTen 12 cacheadm isql [slcon.cpp(1634)] > smConnectionConcrete::SqlTransform: mode [passthrough]
    TraceEvents 03/22/2010 11:42:03.321282 TimesTen 12 cacheadm isql [sqlxform.cpp(69)] > dcplus::SqlTransform-0280-: [|0|select TIME_ID from sales2 ]
    TraceEvents 03/22/2010 11:42:03.321310 TimesTen 12 cacheadm isql [sqlxform.cpp(95)] < dcplus::SqlTransform-0282-: TSQL0 Finished
    TraceEvents 03/22/2010 11:42:03.321378 TimesTen 12 cacheadm isql [slcon.cpp(1792)] < smConnectionConcrete::SqlTransform: [1]
    TraceEvents 03/22/2010 11:42:03.321414 TimesTen 12 cacheadm isql [smdcamsg.cpp(468)] L½» ttimdb1_client 10009488 NULL NULL > smConnectionConcrete::executeSql
    TraceEvents 03/22/2010 11:42:03.321435 TimesTen 12 cacheadm isql [dcalang.cpp(137)] > smConnectionConcrete::executeSql
    TraceEvents 03/22/2010 11:42:03.321459 TimesTen 12 cacheadm isql [smdcamsg.cpp(468)] L½» ttimdb1_client 10009488 NULL NULL > smConnectionConcrete::connectTarget[work/oracle/TimesTen_store/ttimdb1]
    TraceEvents 03/22/2010 11:42:03.321502 TimesTen 12 cacheadm isql [smdcamsg.cpp(468)] L½» ttimdb1_client 10009488 NULL NULL smConnectionConcrete::dcaLanguage: Request contains [1] statements.
    TraceEvents 03/22/2010 11:42:03.321529 TimesTen 12 cacheadm isql [smdcamsg.cpp(468)] L½» ttimdb1_client 10009488 NULL NULL smConnectionConcrete::dcalanguage: statement [select TIME_ID from sales2]
    TraceEvents 03/22/2010 11:42:03.321557 TimesTen 12 cacheadm isql [smdcamsg.cpp(468)] L½» ttimdb1_client 10009488 NULL NULL > smConnectionConcrete::buildStatement
    TraceEvents 03/22/2010 11:42:03.321623 TimesTen 12 cacheadm isql [smdcamsg.cpp(468)] L½» ttimdb1_client 10009488 NULL NULL < smConnectionConcrete::buildStatement, deleteStatement status: 1
    TraceInterface 03/22/2010 11:42:03.321673 TimesTen 12 cacheadm isql [slcon.cpp(2223)] Trace API Level ENTER odbcBaseStatement():SQLAllocStmt [99d2d80]
    TraceInterface 03/22/2010 11:42:03.321696 TimesTen 12 cacheadm isql [slcon.cpp(2223)] Trace API Level EXIT odbcBaseStatement():SQLAllocStmt [9b054e0] with return code 0
    TraceInterface 03/22/2010 11:42:03.321718 TimesTen 12 cacheadm isql [slcon.cpp(2223)] Trace API Level ENTER odbcBaseStatement():SQLSetStmtAttr [9b054e0 | 1 | 1000]
    TraceInterface 03/22/2010 11:42:03.321740 TimesTen 12 cacheadm isql [slcon.cpp(2223)] Trace API Level EXIT odbcBaseStatement():SQLSetStmtAttr with return code 0
    TraceEvents 03/22/2010 11:42:03.321765 TimesTen 12 cacheadm isql [smdcamsg.cpp(468)] L½» ttimdb1_client 10009488 NULL NULL < smConnectionConcrete::buildStatement
    TraceEvents 03/22/2010 11:42:03.321789 TimesTen 12 cacheadm isql [smdcamsg.cpp(468)] L½» ttimdb1_client 10009488 NULL NULL > smConnectionConcrete::executeLanguageStatement
    TraceInterface 03/22/2010 11:42:03.321887 TimesTen 12 cacheadm isql [slcon.cpp(2223)] Trace API Level ENTER odbcBaseStatement():SQLPrepare [9b054e0 | request=select TIME_ID from sales2 | length=26]
    TraceInterface 03/22/2010 11:42:03.321910 TimesTen 12 cacheadm isql [slcon.cpp(2223)] Trace API Level EXIT odbcBaseStatement():SQLPrepare with return code 0
    TraceInterface 03/22/2010 11:42:03.321965 TimesTen 12 cacheadm isql [slcon.cpp(2223)] Trace API Level ENTER odbcBaseStatement():SQLExecute [9b054e0]
    TraceInterface 03/22/2010 11:42:03.321987 TimesTen 12 cacheadm isql [slcon.cpp(2223)] Trace API Level EXIT odbcBaseStatement():SQLExecute with return code 0
    TraceInterface 03/22/2010 11:42:03.322052 TimesTen 12 cacheadm isql [dcaresult.cpp(2182)] Trace API Level ENTER odbcBaseResult():SQLNumResultCols [9b054e0]
    TraceInterface 03/22/2010 11:42:03.322074 TimesTen 12 cacheadm isql [dcaresult.cpp(2182)] Trace API Level EXIT odbcBaseResult():SQLNumResultCols [ column count=1]
    TraceInterface 03/22/2010 11:42:03.322096 TimesTen 12 cacheadm isql [dcaresult.cpp(2182)] Trace API Level odbcBaseResult::createSchema SQL_MAX_COLUMN_NAME_LEN[30]
    TraceInterface 03/22/2010 11:42:03.322118 TimesTen 12 cacheadm isql [dcaresult.cpp(2182)] Trace API Level ENTER odbcBaseResult():SQLDescribeCol [9b054e0 | column number=1]
    TraceInterface 03/22/2010 11:42:03.322140 TimesTen 12 cacheadm isql [dcaresult.cpp(2182)] Trace API Level EXIT odbcBaseResult():SQLDescribeCol [column name=TIME_ID | column length=7 | datetype= 93 | precision=20 | scale=0 | nullable=0] with return code 0
    TraceInterface 03/22/2010 11:42:03.322163 TimesTen 12 cacheadm isql [dcaresult.cpp(2182)] Trace API Level odbcBaseResult::createSchema Column Number 1 Column Name[TIME_ID] SQL TYPE[93] Precision[20] Scale[0] Nullable[0] Max Length[26]
    TraceInterface 03/22/2010 11:42:03.322182 TimesTen 12 cacheadm isql [dcaresult.cpp(2182)] Trace API Level ENTER odbcBaseResult():SQLBindCol [9b054e0 | column number=1 | SQL C type=1 | length=27]
    TraceInterface 03/22/2010 11:42:03.322201 TimesTen 12 cacheadm isql [dcaresult.cpp(2182)] Trace API Level EXIT odbcBaseResult():SQLBindCol with return code 0
    TraceEvents 03/22/2010 11:42:03.322231 TimesTen 12 cacheadm isql [smdcamsg.cpp(468)] L½» ttimdb1_client 10009488 NULL NULL > smConnectionConcrete::processResults, rowSetResults
    TraceInterface 03/22/2010 11:42:03.322266 TimesTen 12 cacheadm isql [dcaresult.cpp(2146)] Trace API Level ODBC type[93] maps to CS Type[0]
    TraceInterface 03/22/2010 11:42:03.322367 TimesTen 12 cacheadm isql [dcaresult.cpp(2182)] Trace API Level ENTER odbcRowSetResult():SQLFetch [9b054e0]
    TraceInterface 03/22/2010 11:42:03.322390 TimesTen 12 cacheadm isql [dcaresult.cpp(2182)] Trace API Level EXIST odbcRowSetResult():SQLFetch with return code 0
    TraceTarget 03/22/2010 11:42:03.322412 TimesTen 12 cacheadm isql [dcaresult.cpp(2186)] Trace_DATA_Level SQLFetch [9b054e0|column number=1|SQL C type=1|datalength=19]
    TraceTarget 03/22/2010 11:42:03.322434 TimesTen 12 cacheadm isql [dcaresult.cpp(2186)] Trace_DATA_Level odbc value returned by SQLFetch is:1998-01-10 00:00:00
    TraceInterface 03/22/2010 11:42:03.322452 TimesTen 12 cacheadm isql [dcaresult.cpp(2182)] Trace API Level Rows Fetched into Row Set [1]
    TraceEvents 03/22/2010 11:42:03.322475 TimesTen 12 cacheadm isql [smdcamsg.cpp(468)] L½» ttimdb1_client 10009488 NULL NULL ResultSet rowset contains [1] rows.
    TraceTarget 03/22/2010 11:42:03.322577 TimesTen 12 cacheadm isql [dcaresult.cpp(2150)] Trace_DATA_Level dtConverter::toTdsRow Column Number 1
    TraceTarget 03/22/2010 11:42:03.322601 TimesTen 12 cacheadm isql [dcaresult.cpp(2150)] Trace_DATA_Level odbcValue: Column Name[TIME_ID] SQL TYPE[93] Described SQL TYPE[93] Precision[20] Scale[0] Nullable[0] Max Length[26]
    TraceTarget 03/22/2010 11:42:03.322622 TimesTen 12 cacheadm isql [dcaresult.cpp(2150)] Trace_DATA_Level Odbc value= 1998-01-10 00:00:00
    TraceTarget 03/22/2010 11:42:03.322650 TimesTen 12 cacheadm isql [dcaresult.cpp(2150)] Trace_DATA_Level original tdsValue: Column Name[TIME_ID] SQL TYPE[12] Precision[20] Scale[0] Nullable[0] Max Length[8]
    TraceTarget 03/22/2010 11:42:03.322672 TimesTen 12 cacheadm isql [dcaresult.cpp(2150)] Trace_DATA_Level data convert failed, use default datetime string
    TraceTarget 03/22/2010 11:42:03.322695 TimesTen 12 cacheadm isql [dcaresult.cpp(2150)] Trace_DATA_Level converted tdsValue: Column Name[TIME_ID] SQL TYPE[12] Precision[20] Scale[0] Nullable[0] Max Length[8] Data Length[8]
    TraceInterface 03/22/2010 11:42:03.322906 TimesTen 12 cacheadm isql [dcaresult.cpp(2182)] Trace API Level ENTER odbcRowSetResult():SQLFetch [9b054e0]
    TraceInterface 03/22/2010 11:42:03.322929 TimesTen 12 cacheadm isql [dcaresult.cpp(2182)] Trace API Level EXIST odbcRowSetResult():SQLFetch with return code 0
    TraceTarget 03/22/2010 11:42:03.322951 TimesTen 12 cacheadm isql [dcaresult.cpp(2186)] Trace_DATA_Level SQLFetch [9b054e0|column number=1|SQL C type=1|datalength=19]
    TraceTarget 03/22/2010 11:42:03.322973 TimesTen 12 cacheadm isql [dcaresult.cpp(2186)] Trace_DATA_Level odbc value returned by SQLFetch is:1998-01-10 00:00:00
    TraceInterface 03/22/2010 11:42:03.322993 TimesTen 12 cacheadm isql [dcaresult.cpp(2182)] Trace API Level Rows Fetched into Row Set [1]
    TraceEvents 03/22/2010 11:42:03.323023 TimesTen 12 cacheadm isql [smdcamsg.cpp(468)] L½» ttimdb1_client 10009488 NULL NULL ResultSet rowset contains [1] rows.
    TraceTarget 03/22/2010 11:42:03.323099 TimesTen 12 cacheadm isql [dcaresult.cpp(2150)] Trace_DATA_Level dtConverter::toTdsRow Column Number 1
    TraceTarget 03/22/2010 11:42:03.323120 TimesTen 12 cacheadm isql [dcaresult.cpp(2150)] Trace_DATA_Level odbcValue: Column Name[TIME_ID] SQL TYPE[93] Described SQL TYPE[93] Precision[20] Scale[0] Nullable[0] Max Length[26]
    TraceTarget 03/22/2010 11:42:03.323139 TimesTen 12 cacheadm isql [dcaresult.cpp(2150)] Trace_DATA_Level Odbc value= 1998-01-10 00:00:00
    TraceTarget 03/22/2010 11:42:03.323160 TimesTen 12 cacheadm isql [dcaresult.cpp(2150)] Trace_DATA_Level original tdsValue: Column Name[TIME_ID] SQL TYPE[12] Precision[20] Scale[0] Nullable[0] Max Length[8]
    TraceTarget 03/22/2010 11:42:03.323181 TimesTen 12 cacheadm isql [dcaresult.cpp(2150)] Trace_DATA_Level data convert failed, use default datetime string <-- Error here
    Note the last line data convert failed!

  • Creator Team: bug?

    Hi,
    Ocassionally, I get this error:
    Exception Details: java.lang.IndexOutOfBoundsException
      Index: 0, Size: 0
    Possible Source of Error:
       Class Name: java.util.ArrayList
       File Name: ArrayList.java
       Method Name: RangeCheck
       Line Number: 546
    Source not available. Information regarding the location of the exception can be identified using the exception stack trace below.
    Stack Trace:
    java.util.ArrayList.RangeCheck(ArrayList.java:546)
    java.util.ArrayList.remove(ArrayList.java:389)
    javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:271)
    javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:381)
    com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:75)
    com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:221)
    com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:90)
    javax.faces.webapp.FacesServlet.service(FacesServlet.java:197)
    sun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethodAccessorImpl.java:-2)
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    java.lang.reflect.Method.invoke(Method.java:585)
    org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:249)
    java.security.AccessController.doPrivileged(AccessController.java:-2)
    javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
    org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:282)
    org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:165)
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:257)
    org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:55)
    org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:161)
    java.security.AccessController.doPrivileged(AccessController.java:-2)
    org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
    com.sun.rave.web.ui.util.UploadFilter.doFilter(UploadFilter.java:194)
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:210)
    org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:55)
    org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:161)
    java.security.AccessController.doPrivileged(AccessController.java:-2)
    org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
    org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:263)
    org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
    org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:225)
    org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:173)
    org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
    org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
    org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
    org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:132)
    org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
    org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:933)
    org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:189)
    com.sun.enterprise.web.connector.grizzly.ProcessorTask.doProcess(ProcessorTask.java:604)
    com.sun.enterprise.web.connector.grizzly.ProcessorTask.process(ProcessorTask.java:475)
    com.sun.enterprise.web.connector.grizzly.ReadTask.executeProcessorTask(ReadTask.java:371)
    com.sun.enterprise.web.connector.grizzly.ReadTask.doTask(ReadTask.java:264)
    com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:281)
    com.sun.enterprise.web.connector.grizzly.WorkerThread.run(WorkerThread.java:83)
    It should be noted that when I refresh the browser, that the application works well. I am running the app on Sun's App. Server.
    Please advise

    Hi Roman,
    Thanks for replying. For a moment there, I thought I was being blacklisted ;-}
    In the application, I have a dddlist and a table. The values in the table are dependent on the ddlist value selected. In other words, if a user chooses ABC in the ddlist, the values in the table would be "A" ,"B" ,"C". However, if the user chooses DEF in the dropdown, then the values in the table would be "D","E","F"
    It goes one step further...the selected value in the ddlist is coming from a previous page (passed thru the URL). However, the user can change the value, and the table is populated automatically. There is also a text box and a button if the user wants to search the existing options in the table.
    Now for the code:
    The pre-renderer method:
    //pid: value from url
    //SearchParam: value from textbox. It is set to % if user does not enter anything
    if (pid != null && (SearchParam != null) ) {
    //Sgroup_tblRowSet3: rowset that table is bound to
       getSessionBean1().getSgroup_tblRowSet3().setObject(1, pid);
                    getSessionBean1().getSgroup_tblRowSet3().setObject(2,SearchParam);
                  getSessionBean1().getSgroup_tblRowSet3().setObject(3,SearchParam);
                  getSessionBean1().getSgroup_tblRowSet3().execute();
                  ddPG.setSelected(new Integer(pid));
            getSgroup_tblDataProvider().refresh();Any suggestions?
    Thanks

  • JDBC connection suspends application

    Hi,
    I have tried to create a database connection with JDBC, but when I run the application, it "gets stuck" when it tries to create that connection. It doesn't really suspend the thread, but the application just hangs there and shows no indication of whether the connection worked or failed.
    Has anyone run across that problem before? How do I solve that?
    my code:
                    Statement anfrage = null;
              ResultSet rowset = null;
              try {
                  DriverManager.registerDriver(new Driver());
                  Connection conn = DriverManager.getConnection("jdbc:mysql://localhost/test?" +
                                                 "user=xxxx&password=xxxx");
                  // send queries
                  anfrage = conn.createStatement();
                  rowset = anfrage.executeQuery("SELECT * FROM parseddata");
                  while(rowset.next()){
                       System.out.println(rowset.getString("id") + " :works");
                  rowset.close();
                  anfrage.close();
              } catch (SQLException ex) {
                  // handle any errors
                  System.out.println("SQLException: " + ex.getMessage());
                  System.out.println("SQLState: " + ex.getSQLState());
                  System.out.println("VendorError: " + ex.getErrorCode());
              }the driver and the connection settings are correct (I have tried to see if the connection fails by giving invalid parameters to the connection attempt), so I'm out of ideas. It just never reaches anfrage = conn.createStatement();, but it also doesn't throw an exception (Threadstate running).
    regards,
    Ulrich

    Hi b00nlander,
    Here was my problem:
    Using mysql-connector-java-5.1.5 and MySql Ver 11.18 Distrib 3.23.58, for redhat-linux-gnu (i386) I found that DriverManager.getConnection() would work fine when access to the mysql server was denied due to invalid username/password combination.
    The problem only came when supplying correct details: the call getConnection() just hung.
    I solved this problem by DOWNGRADING the version of mysql-connector to mysql-connector-java-3.1.14. I surpose one could upgrade mysql to a later release to solve this problem also.
    It would seem that there is just an incompatibility between these versions of drivers and mysql?
    Regards,
    Ken.

  • How to display/navigate to specific record in a table with more then thousand records

    Hi,
    there is a task that I do not know how can be resolved.
    There is a query that returns around 1 - 2 thousand records. And all those records have corresponding weight assigned.
    After query executing it is necessary to navigate to the records with the highest weight assigned. It can be first record, it can be a record at the end or in the middle of the row set from thousand records.
    I have used "DisplayRow"=selected or the code below, but it does not work properly ... when the record that we navigate is in the middle of record set from 2000 records, then users have to scroll down to it.
    And I need to position to that specific record after query is executed.
    So I used the code below:
    public void onButtonClicked(ActionEvent actionEvent) {
    DCBindingContainer bc = (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
    DCIteratorBinding iterator = bc.findIteratorBinding("ViewVIIterator");
            Row row = iterator.getCurrentRow();
            String bestPosition = (String)row.getAttribute("BestPosition");
            iterator = bc.findIteratorBinding("DetaillVIIterator");
            ViewObject vo = iterator.getViewObject();
            vo.setWhereClause(some_conditions);
            vo.executeQuery();
            RowSetIterator rowSet = iterator.getRowSetIterator();
            Key key = null;
            while (rowSet.hasNext()) {
                row = rowSet.next();
                if (row != null && ((String)row.getAttribute("weight")).equals(bestPosition)) {
                    key = row.getKey();
                    Key rowKey = row.getKey();
                    ArrayList tableRowKey = new ArrayList();
                    tableRowKey.add(rowKey);
                    this.getRangeTable().setScrollTopRowKey(tableRowKey);
                    break;
    After the code above I getting the row selected or set as a current, but in case of 2000 records, when my record is in the middle of this record set, I need to scroll down to this record to see it.
    And I wanted that I will be navigated to my record with records above and below.
    What am I doing wrong above?
    Thanks
    Alexander

    Hi Timo!
    thanks for the reply.
    version info:
    Oracle JDeveloper 11g Release 2 11.1.2.3.0
    Studio Edition Version 11.1.2.3.0
    Build JDEVADF_11.1.2.3.0_GENERIC_120914.0223.6276.1
    IDE Version: 11.1.2.3.39.62.76.1
    Product Version: 11.1.2.3.39.62.76.1
    1. sorting order is already applied and we to position to a specific record in af:table.
    From another side the task can rephrased: I need to position to a specific record and I need to be able to show 500 records before and 500 records after.
    So where clause can be like:
    :bestPosition > position - 500 and :bestPosition < position +500.
    2. I tried to apply your second approach and found that record is selected, but I need to scroll to it down. It happens when first 20 records are displayed in af:table and my record is 480 records below ...
    Alexander

  • How to get xsql page-param on xsl transform?

    On the xsql file a page-param is set. If param does not exist then have do insert new record into master table, then requery for the value to set-page-param.
    How do call the page-param on xsl transform file used in xsql:insert-request?
    <xsql:set-page-param bind-params="cwMedRecNo" name="org_client_id">
    select client_id from org_client
    where chart_number = ?
    and active_ind = 'Y'
    and provider_organization_id = 71
    </xsql:set-page-param>
    <xsql:if-param name="org_client_id" exists="no">
    <!-- Client_Id doesn't exist, get next sequence number value-->
    <xsql:set-page-param name="org_client_id">
    select client_id_s.nextval from dual
    </xsql:set-page-param>
    <!--insert patient into org_client table-->
    <xsql:dml bind-params="org_client_id cwMedRecNo" commit="yes">
    insert into client (organization_id, client_id, chart_number, active_ind, last_updated_date, administered_ind)
    values
    (000, ?, ?, 'Y', sysdate, 'Y')
    </xsql:dml>
    </xsql:if-param>
    <xsql:set-page-param name="s_org_client_id" value="{@org_client_id}" />
    <xsql:insert-request
    table="immunization"
    columns="client_id organization_id site_id vaccination_date last_updated_date entered_by_org_id vaccine_id source_id contraindication_code refused_code elsewhere_code active_record HISTORICAL_IND"
    transform="dme_data_entry_immunization.xsl"
    commit-batch-size = "1" />
    In the dme_data_entry_immunization.xsl file. The element client_id comes back null.
    <rowset xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xsl:version="1.0">
    <xsl:for-each select="/request/parameters/*">
    <row>
    <xsl:element name="client_id"><xsl:value-of select="//s_org_client_id"/></xsl:element>
    <xsl:element name="vaccine_group_code">
    <xsl:choose>
    <xsl:when test="item_no = 145">PNEU</xsl:when>
    <xsl:when test="item_no = 144">FLU</xsl:when>
    <xsl:otherwise></xsl:otherwise>
    </xsl:choose>
    </xsl:element>
    </row>
    </rowset>

    Hi J
    Have you added the <<Page()>> and <<PageCount()>> functions on the reports?
    FR does not (or certainly did not) add page numbers to the reports in books unless you manually add them. I always used to add a text box in the footer of the report and insert functions like this. It has been a while since I did it (I haven't on 11.1.2.1 for example) but I think that if you do this the page number corresponds to the page within the book and not the page of the report (if a multi-page report). It may not take account of a TOC page though.
    Hope this helps
    Stuart

  • Why ResultSet getDate() method returns null when querying .csv file?

    Here is the full code:
    import java.sql.*;
    import java.sql.Types;
    import java.sql.Date;
    import myjava.support.CachedRowSetMaker;
    import javax.sql.rowset.CachedRowSet;
    import java.io.IOException;
    import java.text.SimpleDateFormat;
    import java.util.Calendar;
    class jdbc2{
    final private String s1="SELECT top 10 [DATE], [ADJ CLOSE] FROM [vwo-1.csv]";
    private ResultSet result=null;
    private Connection conn=null;
    public static void main(String[] args) throws SQLException{
    jdbc2 db=new jdbc2();
    try {
              Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
              db.conn = DriverManager.getConnection("jdbc:odbc:STOCK_DATA");
              PreparedStatement sql=db.conn.prepareStatement(db.s1);
              db.result=sql.executeQuery();
    // check column names and types using the ResultSetMetaData object.
              ResultSetMetaData metaData = db.result.getMetaData();
         System.out.println("Table Name : " + metaData.getTableName(2));
         System.out.println("Field\t\tDataType");
         for (int i = 0; i < metaData.getColumnCount(); i++) {
         System.out.print(metaData.getColumnName(i + 1) + "\t");
         System.out.println(metaData.getColumnTypeName(i+1));
         System.out.print(metaData.getColumnName(1) + "\t"+metaData.getColumnName(2)+"\n");
              while (db.result.next()){
                   System.out.print(db.result.getDate("DATE", Calendar.getInstance()));
                   System.out.format("\t%,.2f\n", db.result.getFloat("Adj Close"));
    catch (Exception e) {
    System.out.println("Error: " + e.getMessage());
         finally {
              db.result.close();
              db.conn.close();
    Everything works well, until getting to the block
              while (db.result.next()){
                   System.out.print(db.result.getDate("DATE", Calendar.getInstance()));
                   System.out.format("\t%,.2f\n", db.result.getFloat("Adj Close"));
    The getDate("DATE", Calendar.getInstance())); always returns null, instead of the date value in the vwo-1.csv.
    Even though I change it to
    java.sql.Date d=db.result.getDate("DATE") and convert to String using .toString(), I still gets nulls. The dollar amount in "Adj Close" field is fine, no problem.
    The .csv fils is downloaded from YahooFinace.
    Can anyone review the code and shed some light as to what I did wrong?
    Thanks alot.

    CREATE TABLE `login` (
    `username` varchar(40) DEFAULT NULL,
    `password` varchar(40) DEFAULT NULL
    ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
    CREATE TABLE `amount` (
    `amountid` int(11) NOT NULL,
    `receiptid` int(11) DEFAULT NULL,
    `loanid` int(11) DEFAULT NULL,
    `amount` bigint(11) DEFAULT NULL,
    `latefee` int(11) DEFAULT NULL,
    `paymentid` int(11) DEFAULT NULL,
    `pid` int(11) DEFAULT NULL,
    PRIMARY KEY (`amountid`)
    ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
    CREATE TABLE `applicationfee` (
    `applicationfeeid` int(11) DEFAULT NULL,
    `applicationamount` int(11) DEFAULT NULL,
    `applicationfee` int(11) DEFAULT NULL
    ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
    CREATE TABLE `category` (
    `categoryid` int(11) DEFAULT NULL,
    `categoryname` varchar(40) DEFAULT NULL,
    `categorydescription` varchar(500) DEFAULT NULL,
    `cattype` int(11) DEFAULT NULL
    ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
    CREATE TABLE `commission` (
    `commissionid` int(11) DEFAULT NULL,
    `bussiness` int(11) DEFAULT NULL,
    `commission` int(11) DEFAULT NULL,
    `pid` int(11) DEFAULT NULL
    ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
    CREATE TABLE `customer` (
    `cacno` int(11) NOT NULL DEFAULT '0',
    `name` varchar(40) DEFAULT NULL,
    `age` int(11) DEFAULT NULL,
    `cphone` varchar(40) DEFAULT NULL,
    `cmobile` varchar(40) DEFAULT NULL,
    `caddress` varchar(500) DEFAULT NULL,
    `cstatus` varchar(20) DEFAULT NULL,
    `cphoto` longblob,
    `pid` int(11) DEFAULT NULL,
    PRIMARY KEY (`cacno`)
    ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
    CREATE TABLE `daybook` (
    `closingbal` varchar(40) DEFAULT NULL,
    `date` date DEFAULT NULL
    ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
    CREATE TABLE `extraincome` (
    `categoryid` int(11) NOT NULL,
    `receiptid` int(11) DEFAULT NULL,
    `date` date DEFAULT NULL,
    `amountid` int(11) DEFAULT NULL
    ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
    CREATE TABLE `employee` (
    `empno` int(11) DEFAULT NULL,
    `empname` varchar(40) DEFAULT NULL,
    `age` int(11) DEFAULT NULL,
    `sal` int(11) DEFAULT NULL
    ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
    CREATE TABLE `image` (
    `id` int(11) DEFAULT NULL,
    `image` blob
    ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
    CREATE TABLE `loan` (
    `loanid` int(11) NOT NULL DEFAULT '0',
    `loanamt` varchar(40) DEFAULT NULL,
    `payableamount` double DEFAULT NULL,
    `installment` int(11) DEFAULT NULL,
    `payableinstallments` int(11) DEFAULT NULL,
    `monthlyinstallment` varchar(20) DEFAULT NULL,
    `surityname` varchar(20) DEFAULT NULL,
    `applicationfeeid` int(11) DEFAULT NULL,
    `interestrate` float DEFAULT NULL,
    `issuedate` date DEFAULT NULL,
    `duedate` date DEFAULT NULL,
    `nextduedate` date DEFAULT NULL,
    `cacno` int(11) DEFAULT NULL,
    `cname` varchar(20) DEFAULT NULL,
    `pid` int(11) DEFAULT NULL,
    `interestamt` double DEFAULT NULL,
    `pendingamt` float DEFAULT NULL,
    PRIMARY KEY (`loanid`)
    ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
    CREATE TABLE `md` (
    `mdid` int(11) NOT NULL DEFAULT '0',
    `mdname` varchar(40) DEFAULT NULL,
    `mdphoto` varchar(100) DEFAULT NULL,
    `mdphone` varchar(40) DEFAULT NULL,
    `mdmobile` varchar(40) DEFAULT NULL,
    `mdaddress` varchar(500) DEFAULT NULL,
    PRIMARY KEY (`mdid`)
    ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
    CREATE TABLE `partner` (
    `pid` int(11) NOT NULL DEFAULT '0',
    `pname` varchar(40) DEFAULT NULL,
    `paddress` varchar(500) DEFAULT NULL,
    `pphoto` varchar(100) DEFAULT NULL,
    `pphone` varchar(40) DEFAULT NULL,
    `pmobile` varchar(40) DEFAULT NULL,
    `pstatus` varchar(20) DEFAULT NULL,
    `mdid` int(11) DEFAULT NULL,
    `mdname` varchar(40) DEFAULT NULL,
    `date` date DEFAULT NULL,
    `nextpaydate` date DEFAULT NULL,
    PRIMARY KEY (`pid`)
    ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
    CREATE TABLE `partnerinvested` (
    `pid` int(11) DEFAULT NULL,
    `pname` varchar(20) DEFAULT NULL,
    `receiptid` int(11) DEFAULT NULL,
    `date` date DEFAULT NULL,
    `amountinvested` int(11) DEFAULT NULL,
    `latefee` int(11) DEFAULT NULL,
    `amountid` int(11) DEFAULT NULL
    ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
    CREATE TABLE `payments` (
    `paymentid` int(11) NOT NULL,
    `categoryid` int(11) DEFAULT NULL,
    `particulars` varchar(100) DEFAULT NULL,
    `amountid` int(11) DEFAULT NULL,
    `paymentdate` date DEFAULT NULL,
    PRIMARY KEY (`paymentid`)
    ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
    CREATE TABLE `receipts` (
    `receiptid` int(11) DEFAULT NULL,
    `paiddate` date DEFAULT NULL,
    `amountid` int(11) DEFAULT NULL,
    `loanid` int(11) DEFAULT NULL,
    `latefee` int(11) DEFAULT NULL,
    `installment` int(11) DEFAULT NULL,
    `cacno` int(11) DEFAULT NULL,
    `cname` varchar(40) DEFAULT NULL,
    `pid` int(11) DEFAULT NULL
    ) ENGINE=InnoDB DEFAULT CHARSET=latin1;

  • Deleting a row from a resultSet with nulls

    Hello All,
    I have stumbled across a bit of a problem when using a cachedRowSet
    If I select columns from my database that have null values, and I call deleteRow() I get a
    NullPointerException.
    at com.sun.rowset.internal.CachedRowSetWriter.deleteOriginalRow
    However if I don�t select the null columns in my cachedRowSet. I can delete no worries.
    I would of though that the cachedRowSet object could handle nulls but it seems it doesn�t, anyone know any workarounds for this?
    NOTE: using JTDS driver would that play a part?

    If I select columns from my database that have null
    values, and I call deleteRow() I get a Does the whole row a null record ?
    Please put a sample program so that the problem can be reproduced.
    >
    NullPointerException.
    at
    com.sun.rowset.internal.CachedRowSetWriter.deleteOrigi
    nalRow
    Also give the stack trace.

  • How to append new row in rowset with parameter?

    Hi,
    In the data input page in prerender method I have this code to filter rowset with non existing id in the table to show empty table on the page:
    try {           
                getSessionBean1().getKoordinatesRowSet().setObject(1, non_existing_id);
            } catch (Exception e) {
                error("klaida koord " + e);
            }After this I have empty table and I want with a button on the page append one or more rows, fill them and save to my db. I try with this code:
    public String addBtn_action() {       
            try {           
                RowKey rk = koordinatesDataProvider.appendRow();           
                koordinatesDataProvider.setCursorRow(rk);                           
            } catch (Exception ex) {
                log("Negaliu prideti eilutes ", ex);
                error(ex.getMessage());
            return null;
        }But new row does not appear. When I remove parameter in RowSet and remove code from prerender method all works fine, but I see all data from the table that was entered before. Like I said - I want to have an empty table and be able to append one or more new rows, fills them and save to my db. How can I resolve this?

    Rui's answer will create copies of the entire table.  There may be times where thsi is what you want, but you asked about creating new rows.  If your new row is a copy of one of your existing rows, then you could use
    _RowName.addInstance(1);
    (the underscore at the beginning invokes the instance manager).  Is this what you're looking for?

  • OracleXMLSave - Insert into table with NOT NULL Columns

    Im having trouble using OracleXMLSave (XSU12) to insert into a
    table where columns are initialized on insert with system
    derived values (see table script below) I get the following
    error message.
    Message: 'java.sql.SQLException: ORA-01400: cannot insert
    NULL "TESTMEETING"."S_TERMID")
    Im inserting this XML:
    <ROWSET table="testmeeting">
    <ROW>
    <DESCRIPTION>TestMeeting</DESCRIPTION>
    <STARTDATE>2001-10-22 00:00:00.0</STARTDATE>
    <CATEGORYCODE>HR</CATEGORYCODE>
    <STATUS>O</STATUS>
    </ROW>
    </ROWSET>
    Table Script:
    CREATE TABLE TESTMEETING (
    S_TERMID VARCHAR2 (12) DEFAULT (USERENV('TERMINAL'))
    NOT NULL,
    S_RECORDCREATED DATE DEFAULT (SYSDATE) NOT NULL,
    S_RECORDCREATOR NUMBER (4) DEFAULT (UID) NOT NULL,
    DESCRIPTION VARCHAR2 (28),
    CATEGORYCODE VARCHAR2 (2),
    STARTDATE DATE,
    STATUS VARCHAR2 (1))
    If I remove these columns the insert works OK. Inserts also work
    fine from sqlplus etc.
    Apologies for the previous entry, itchy fingers.
    Thanks for your help

    Hi.
    try to insert data in column "TESTMEETING"."S_TERMID" by trigger.
    Thanks..

  • XML Document Insert fails : NULL is an invalid

    Hi,
    I am trying to inseert a valid Oracle Canonical XML document
    into my table . But i get the following error :
    2001-07-01 19:50:16,167 <ERROR>
    NULL is an invalid column name.</ERROR>
    The table definition is as follows :
    create or replace table Internal_Message_Impl (
    processId &ID_TYPE primary key,
    transactionHeader THeader_t,
    payloadCollection clob,
    manifest clob,
    messageHeader MessageHeader_t
    In my input XML document I have columns corresponding to the processId (primary
    key) and transactionHeader. But I don't any xml tags for the remaining columns.
    In the OracleSaveXML java API I am setting which columns should be inserted or
    updated :
    OracleXMLSave save = new OracleXMLSave(_conn, DB_TABLE_NAME);
    save.setIgnoreCase(true);
    // default Oracle Date format is 'MM/dd/yyyy HH:mm:ss' . See JDBC
    documentation on
    // java.text.SimpleDateFormat to get the list of valid date formats.
    // save.setDateFormat(java.lang.String mask);
    String[] columnNames = new String[3];
    columnNames[0] = IM_PRIMARY_KEY;
    columnNames[1] = TRANSACTION_HEADER_COLUMN_NAME;
    String[] keyColumnNames = new String[2];
    keyColumnNames[0] = IM_PRIMARY_KEY;
    save.setUpdateColumnList(columnNames);
    save.setKeyColumnList(keyColumnNames); // ignored in the case of insert and
    delete
    if(isNew()) {
    save.insertXML(oraXmlStr);
    } else {
    save.updateXML(oraXmlStr);
    Can somebody tell me whether this approach is o.k. ?
    Here is the xml document I am trying to insert :
    Oracle Canonical XML string for TransactionHeader :
    <?xml version="1.0" encoding="UTF-8"?>
    <ROWSET>
    <ROW>
    <processId>1</processId>
    <TransactionHeader>
    <process>
    <listId>-99</listId>
    <revisionId>-9</revisionId>
    <packetId>-9</packetId>
    </process>
    <providerId>10001</providerId>
    <serviceId>12</serviceId>
    <adapterId>-9</adapterId>
    <customerId>7</customerId>
    <transactionElement>
    <name/>
    <value>1</value>
    </transactionElement>
    <transactionKind>
    <tKind>
    <value>-9</value>
    <name/>
    </tKind>
    <subKind>
    <value>-9</value>
    <name/>
    </subKind>
    </transactionKind>
    <state>
    <code>
    <value>-9</value>
    <name/>
    </code>
    <subCode>
    <value>-9</value>
    <name/>
    </subCode>
    <value/>
    </state>
    <trackingNumber>7UDZED</trackingNumber>
    <controllerNumber/>
    <completionTime>2001-07-08T19:50:05</completionTime>
    <creationTime>2001-07-04T19:50:05</creationTime>
    </TransactionHeader>
    </ROW>
    </ROWSET>
    Appreciate any responses for this problem.
    Thanks
    Mahesh
    null

    Hallo,
    I have same problem but all parameters seems ok...
    <Table> is an invalid table element or appears in the wrong order.
    <variant>
      <Table xmlns:aid5="http://ns.adobe.com/AdobeInDesign/5.0" xmlns:aid="http://ns.adobe.com/AdobeInDesign/4.0/" aid5:tablestyle="Art.-Table" aid:table="table" aid:trows="64" aid:tcols="7">
        <cell aid5:cellstyle="Art.-Cell" aid:table="cell" aid:crows="1" aid:ccols="1" aid:ccolwidth="58">
    I am using Indesign CC 2014

  • XML into table: Why do all my insert values are NULL?

    Hello,
    I'm pretty new in XML ... then I still learn a lot by myself !!!
    I surfed to a lot of forums and examples ....
    I have a XML file. I built a XSL file in order to insert a part of my XML file into a table.
    The 2 files are loaded as CLOB into a DB table.
    I wrote a PLSQL procedure for this job.
    We are on a DB 10gR2.
    As a result, all the inserted columns are loaded with NULL !!!! ....
    I must have done something wrong ... for sure !!! but I cannot figure out.
    Here are the files and procedures:
    *<?xml version="1.0" ?>*
    *<purchaseOrder orderDate="1999-10-20">*
    *<shipTo country="US">*
    *<name>Alice Smith</name>*
    *<street>123 Maple Street</street>*
    *<city>Mill Valley</city>*
    *<state>CA</state>*
    *<zip>90952</zip>*
    *</shipTo>*
    *<billTo country="US">*
    *<name>Robert Smith</name>*
    *<street>8 Oak Avenue</street>*
    *<city>Old Town</city>*
    *<state>PA</state>*
    *<zip>95819</zip>*
    *</billTo>*
    *<comment>Hurry, my lawn is going wild!</comment>*
    *<items>*
    *<item partNum="872-AA">*
    *<productName>Lawnmower</productName>*
    *<quantity>1</quantity>*
    *<USPrice>148.95</USPrice>*
    *<comment>Confirm this is electric</comment>*
    *</item>*
    *<item partNum="926-AA">*
    *<productName>Baby Monitor</productName>*
    *<quantity>1</quantity>*
    *<USPrice>39.98</USPrice>*
    *<shipDate>1999-05-21</shipDate>*
    *</item>*
    *</items>*
    *</purchaseOrder>*
    The XLS file is :
    *<?xml version="1.0"?>*
    *<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">*
    *<xsl:output method="xml" media-type="text/xml" />*
    *<xsl:template match="/">*
    *<insert>*
    *<Table>*
    *<xsl:attribute name="source">*
    *<xsl:value-of select="'item_club'" />*
    *<!--layer=Default-->*
    *</xsl:attribute>*
    *<Columns>*
    *<Column>*
    *<xsl:attribute name="source">*
    *<xsl:value-of select="'item_code'" />*
    *<!--layer=Default-->*
    *</xsl:attribute>*
    *</Column>*
    *<Column>*
    *<xsl:attribute name="source">*
    *<xsl:value-of select="'item_name'" />*
    *<!--layer=Default-->*
    *</xsl:attribute>*
    *</Column>*
    *<Column>*
    *<xsl:attribute name="source">*
    *<xsl:value-of select="'item_price'" />*
    *<!--layer=Default-->*
    *</xsl:attribute>*
    *</Column>*
    *</Columns>*
    *<xsl:for-each select="purchaseOrder/items">*
    *<Rowset>*
    *<xsl:for-each select="item">*
    *<Row>*
    *<Column>*
    *<xsl:attribute name="source">*
    *<xsl:value-of select="'item_code'" />*
    *<!--layer=Default-->*
    *</xsl:attribute>*
    *<xsl:value-of select="@partNum" />*
    *<!--layer=Default-->*
    *</Column>*
    *<Column>*
    *<xsl:attribute name="source">*
    *<xsl:value-of select="'item_name'" />*
    *<!--layer=Default-->*
    *</xsl:attribute>*
    *<xsl:value-of select="productName" />*
    *<!--layer=Default-->*
    *</Column>*
    *<Column>*
    *<xsl:attribute name="source">*
    *<xsl:value-of select="'item_price'" />*
    *<!--layer=Default-->*
    *</xsl:attribute>*
    *<xsl:value-of select="USPrice" />*
    *<!--layer=Default-->*
    *</Column>*
    *</Row>*
    *</xsl:for-each>*
    *<!--layer=Default-->*
    *</Rowset>*
    *</xsl:for-each>*
    *<!--layer=Default-->*
    *</Table>*
    *</insert>*
    *</xsl:template>*
    *</xsl:stylesheet>*
    *<!--xsl-easyControl - (C) 2003-2007 SoftProject GmbH-->*
    *<!--Source: "purchaseOrder_clubDev.xml"|Type:"xml"-->*
    *<!--Destination: "Connexion_XSL_SCFOX.xac"|Type:"Connexion_XSL_SCFOX"-->*
    *<!--Document type: Input Driven-->*
    The XML files are successfully inserted into a CLOB colum :
    ID FILENAME XML
    24 item_club.xsl <?xml version="1.0"?><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.or
    25 purchaseOrder.xml <?xml version="1.0" ?> <purchaseOrder orderDate="1999-10-20">
    And the procedure is :
    CREATE OR REPLACE PROCEDURE load_xml( p_dir IN VARCHAR2
    , p_filename IN VARCHAR2) AS
    insCtx DBMS_XMLSave.ctxType;
    rows NUMBER;
    l_bfile BFILE := BFILENAME(p_dir, p_filename);
    l_clob CLOB;
    l_bfile_xsl BFILE;
    l_clob_xsl CLOB;
    begin
         dbms_output.put_line('p_filename='||p_filename);
         insCtx := DBMS_XMLSave.newContext('sipmo.item_club'); -- get the save context..!
         dbms_output.put_line('item_club.xsl context='||insCtx);
         --IMPORTANT... ignore la casse
         DBMS_XMLSave.setIgnoreCase(insCtx, 1);
         --select XSL file item_club.xsl
    l_bfile_xsl := BFILENAME(p_dir, 'item_club.xsl');
         DBMS_LOB.createtemporary (l_clob_xsl, TRUE);
         DBMS_LOB.fileopen( l_bfile_xsl, DBMS_LOB.file_readonly);
         DBMS_LOB.loadfromfile( l_clob_xsl, l_bfile_xsl, DBMS_LOB.getlength(l_bfile_xsl));
         dbms_output.put_line('item_club.xsl length='||DBMS_LOB.getlength(l_bfile_xsl));
         DBMS_LOB.fileclose(l_bfile_xsl);
         DBMS_XMLSave.SETXSLT(insCtx, l_clob_xsl);
         dbms_output.put_line('step 10');
         DBMS_XMLSave.clearUpdateColumnList(insCtx); -- clear the update settings
         DBMS_XMLSave.setUpdateColumn(insCtx,'ITEM_CODE');
         DBMS_XMLSave.setUpdateColumn(insCtx,'ITEM_NAME');
         DBMS_XMLSave.setUpdateColumn(insCtx,'ITEM_PRICE');
         -- Now insert into the table
         dbms_output.put_line('step 90');
         rows := DBMS_XMLSave.insertXML(insCtx, l_clob);
         dbms_output.put_line('step 100 rows='||rows);
         DBMS_XMLSave.closeContext(insCtx);
         DBMS_LOB.freetemporary (l_clob_xsl);
         DBMS_LOB.freetemporary (l_clob);
    END;
    The result table is like this :
    scfx>select * from item_club;
    ITEM_CODE ITEM_NAME ITEM_PRICE
    All the columns of each row are NULL !!!
    Why?
    Do you have any advice ?
    Thanks if advance,
    Olivier

    So, if I understand what you mean ... I should write something like this :
         insert into item_club
              select t2.partnum, t2.productname, to_number(replace(t2.usprice, '.', ','))
              from odab_xml_tab t
              , xmltable('*' passing t.xml.extract('purchaseOrder/items/*')
              columns partNum varchar2(35) path '@partNum'
              , productName varchar2(35) path 'productName'
              , USPrice varchar2(35) path 'USPrice'
              ) t2
    Its a change in our code.. but that looks nice !!!
    Thanks,
    Olivier

  • XMLGEN: Produce XML dump of a table WITH tags for null column values

    I am new to generating XML so bear with me....
    We have a customer who needs an XML extract of data, including tags for any column that is null.
    I created a simple test case below using DBMS_XMLGEN.getXML. The first row (A1) has no null values and thus tags for columns A, BEE and CEE are produced. The second row (A2) has null in column BEE and thus tags for only columns A and CEE are produced.
    Is there a way to force a tag for null column BEE in the second row?
    create table foo (A varchar2(10), BEE number, CEE date);
    insert into foo values ('A1',1,sysdate);
    insert into foo values ('A2',null,sysdate);
    SELECT DBMS_XMLGEN.getXML('SELECT * FROM foo') FROM dual;
    <ROWSET>
    <ROW>
    <A>A1</A>
    <BEE>1</BEE>
    <CEE>27-SEP-12</CEE>
    </ROW>
    <ROW>
    <A>A2</A>
    <CEE>27-SEP-12</CEE>
    </ROW>
    </ROWSET>

    What's the database version? (SELECT * FROM v$version)
    Could you use this instead :
    SQL> select xmlserialize(document
      2           xmlelement("ROWSET",
      3             xmlagg(
      4               xmlelement("ROW",
      5                 xmlelement("A", a)
      6               , xmlelement("BEE", bee)
      7               , xmlelement("CEE", cee)
      8               )
      9             )
    10           )
    11         -- for display purpose only :
    12         as clob indent
    13         )
    14  from foo
    15  ;
    XMLSERIALIZE(DOCUMENTXMLELEMEN
    <ROWSET>
      <ROW>
        <A>A1</A>
        <BEE>1</BEE>
        <CEE>2012-09-27</CEE>
      </ROW>
      <ROW>
        <A>A2</A>
        <BEE/>
        <CEE>2012-09-27</CEE>
      </ROW>
    </ROWSET>
    Or,
    SQL> select xmlserialize(document
      2           xmlquery(
      3             '(#ora:view_on_null empty #)
      4             {
      5               <ROWSET>{fn:collection("oradb:/DEV/FOO")}</ROWSET>
      6             }'
      7             returning content
      8           )
      9           as clob indent
    10         )
    11  from dual;
    XMLSERIALIZE(DOCUMENTXMLQUERY(
    <ROWSET>
      <ROW>
        <A>A1</A>
        <BEE>1</BEE>
        <CEE>2012-09-27</CEE>
      </ROW>
      <ROW>
        <A>A2</A>
        <BEE/>
        <CEE>2012-09-27</CEE>
      </ROW>
    </ROWSET>
    (where "DEV" is my test schema)
    If you want to stick with DBMS_XMLGEN, you're gonna have to use PL/SQL and setNullHandling procedure.
    Edited by: odie_63 on 27 sept. 2012 17:14

  • Number of Rows in RowSet, function?

    Is there a fucntion call that returns the number of rows in a RowSet?
    thanks
    -nat

    public void updateSQLTable(int row, int col, String fieldName, Object objNewValue) { // update actual SQL table
      Connection dataConnection = null;
      Statement selectData = null;
      Statement updateData = null;
      ResultSet rs = null;
      dataConnection = Passport.openSQLConnection(SQLDriver, SQLConnectionString); // Open an SQL connection
      try {
        String currentValue;
        Object savedValue = ((Vector)data.elementAt(row)).elementAt(col);
        String selectStatement = buildSelectStatement(row, col, "", fieldName);
        selectData = dataConnection.createStatement(); // Setup for query
        rs = selectData.executeQuery(selectStatement); // Perform query
        if (null == rs){
          rs.close();
          Passport.closeSQLConnection(dataConnection);
          Passport.showUserError("Record update failed. The result set came back null.");
          Passport.logIt("Table Update Select: Failed null resultset");
          return; // Dump out of here
        /* Avert any possibility of major system malfunction */
        rs.last();
        int numberOfRecords = rs.getRow();
        if (numberOfRecords > 1) { // redundant check to make sure no multiple updates occur
          Passport.showUserError("Multiple records will be updated. This should not occur.");
          rs.close();
          Passport.closeSQLConnection(dataConnection);
          return;
        rs.beforeFirst();
        /* Continue with normal processing */
        if (rs.next()) { // move to first record
        ....sorry post screwed up - again
    rykk

  • Javax.sql.rowset.serial.SerialBlob cannot be cast to oracle.sql.BLOB

    Hi there,
    I'm facing this exception.
    My code:
    final ReportTemplateAttachment rta = new ReportTemplateAttachment();
    FileBlob fb = new FileBlob();
    fb.setContentType(attachmentDto.getContentType().getValue());
    fb.setCreationDate(sysDate);
    fb.setCreationUser(userId);
    final SerialBlob blob = new SerialBlob(attachmentDto.getFileVal());//it's a  byte[]
    //SerialBlob is of type javax.sql.rowset.serial.SerialBlob
    fb.setFileData(blob);
    fb.setName(attachmentDto.getFileName());
    fb.setLastUpdateDate(sysDate);
    fb.setLastUpdateUser(userId);
    fb.setLength(blob.length());
    rta.setFileBlob(fb);and the object rta will be inserted into another object.
    The variable of interest in FileBlob hbm is defined as follows:
    <property name="fileData" type="blob">
                <column name="FILE_DATA" />
    </property>where the type blob is oracle.sql.BLOB
    If I change the oracle.sql.BLOB to javax.sql.rowset.serial.SerialBlob in the hbm, I can insert but when I try to get the blob back I get a deserialize exception so this change is not an option.
    but when I save the main Object (a cascade operation) I get the following exception:
    org.springframework.jdbc.UncategorizedSQLException:
    Hibernate flushing: could not insert: [pt.sc.data.entities.FileBlob];
    uncategorized SQLException for SQL
    [insert into WP_ADMIN.file_blob (name, content_type, length, file_data, status, creation_user, creation_date, last_update_user, last_update_date, id)
    values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)];
    SQL state [null];
    error code [0];
    An SQLException was provoked by the following failure: java.lang.ClassCastException:
    javax.sql.rowset.serial.SerialBlob cannot be cast to oracle.sql.BLOB;
    nested exception is java.sql.SQLException: An SQLException was provoked by the following failure:
    java.lang.ClassCastException: javax.sql.rowset.serial.SerialBlob cannot be cast to oracle.sql.BLOBAny light on the subject?
    Thanks in advance,
    mleiria

    You don't seem to understand the difference between an object model and a database. Hibernate, being an ORM package, works on the object model and will, based on what you request it to do, generate proper SQL statements to get the database part going. But you shouldn't be thinking about databases when using Hibernate; your main focus is the object model. There is no blob, only binary data. Binary data in Java is generally handled through a byte array.
    If you want to think in databases where blobs do exist, you should be using JDBC directly, not Hibernate.
    (I'm far from being an expert in Hibernate)I would really suggest taking a few hours and reading through the manual. You don't need to be an expert but you should at least know what kind of tool you're working with.

Maybe you are looking for

  • Palm Z22 not functionin​g

    My Palm Z22 just stopped. It will not turn on and the battery is charged. I tried to soft reset but nothing happened. Hopefully somebody out there can help. Thanks. Post relates to: Palm Z22

  • Air or pro for photoediting

    I'm looking for a new computer to use for a photoediting and possible DJ business startup.  I like the portability of the air and the power/beauty of the Retina Pro. Bottom line, I need to make a decision based on quality, longevity, and value. Any h

  • Multiple OS9 per partition

    I know 9.22 supports multiple system folders per volume, eg. HD partition. But this wasn't always the case with the 'old' OS -- before arrival of that feature, when you wanted several system folders on your system, you needed to partition your drive

  • Java Search Engine?

    Does anyone know whether it would be possible to write a web based search engine such as google in java? I don't want detailed information, but does anyone know what kind of equipment/software I would need, and the difficulty it poses. Any relevent U

  • Patch R12 on T4 engine takes a long time

    Hi All, I have patched R12 64bit (patch 8919491) on T4-1 machine takes a long time (not completed after 40 hours). ram 16, sga 2g, another init.ora I set default, idle cpu concumption 99% message alert.log : Incremental checkpoint up to RBA [0x3.1afe