Extending parameter type in constructor declaration?
I've come across a couple of places where I really want to have the compiler use a specific implementation for types of generic parms. As things stand now, I write two classes: one that defines a general mechanism, and one (may or may not be derived from the first) that provides a more specific mechanism.
I know that this isn't possible given the generic type erasure, but I thought I came up with a way to make it work. Of course, this doesn't work either, but I wanted to know what potential misuse causes this syntax to be rejected by the spec.
public class TNum<T> {
private T value;
public TNum(T value) { this.value = value; }
public <N extends Number & T> TNum(N value) { // compiler rejects this in either order
this(value);
}So far, the two cases that I'd use this type of technique:
1) Comparison functors -- there are two choices generally
class Less<T> {
public Less(Comparator<T> comp) {...}
class Less<T extends Comparable) {
public Less() {}
}I could eliminate a class if I could write
class Less<T>{
public <T> Less(Comparator<T> comp) { ... }
public <C extends Comparable & T>Less() {
this(new ComparableComparator<C>());
}2) Swing Editors & Renderers: the basic implementation is the same for all parm types, but there are a couple of minor extensions when dealing with Numbers.
David Hall
http://jga.sf.net
I'm not sure about the multiple-inheritance argument:
there are a number of places where the inferencer is
working with an empty set of potential classes. For
example <? extends String>: String being final can't
possibly have a derived class.
Given <N extends Number & T>, I would expect due to
the type erasure rules that the type N would be erased
to Number for actual class file generation.Granted, but then the problem is the compiler doesn't know what T is here. If T turned out to be (pick any class) "Thread" then you've written N extends Number & Thread, which clearly doesn't work.
Whether this is the actual problem in this case or not I don't know, but I don't see to allow you to write 'N extends X & Y' unless the compiler could know at least one of X and Y is an interface. Given you have no bounds on T in your example this is impossible.
ComparableComparator
I've seen it in a number of libraries in addition to
JGA and no one has a better name for it. It is an
attempt to have one visible method of comparing
objects instead of two.Oh, I see, you're trying to do pattern matching:
class ComparableComparator<U extends Comparable<U>> implements Comparator<U> {
public int compare(U x, U y) {
return x.compareTo(y);
class Less<T> {
public Less(Comparator<T> comp) {
public Less() {
this(new ComparableComparator<T>());
BoundToWork.java [33:1] type parameter T is not within its bound
this(new ComparableComparator<T>());
^
1 error
Errors compiling BoundToWork.This won't compile because T is not bound so the compiler can't know T implements Comparable<T>.
One could write:
class Less<T extends Comparable<T>> {
public Less(Comparator<T> comp) {
public Less() {
this(new ComparableComparator<T>());
}Which compiles but defeats the whole object of what you're trying to do...
The thing is, I don't understand how you're planning to use this, do you have in mind something like this?
class NotComp {} //doesn't implement Comparable<NotComp >
Less<NotComp > l1 = new Less<NotComp>(new NotCompComparator());
class Comp implements Comparable<Comp> { ...}
Less<Comp> l2 = new Less<Comp>();Are you essentially trying to say that the no-arg constructor should only be available if the type of the parameter T happens to extend Comparable<T>, and conversely if T is not Comparable<T> then one must use the one-arg constructor of less and explicitly supply a Comparator object?
If I've understood you correctly then I can't see how this can work. You're basically trying to constrain which constructors are available based on the interfaces implemented by the type parameter (T) in Less<T>. But that can't work... both constructors must be callable for all instantiations of Less<T> ?
Please forgive me if I've gone off on a total tangent and misunderstood your intent.
Similar Messages
-
JLS3: Scope of type parameter and inner class declaration
The following code:
class Foo<E>
class E
E foo()
return this;
}produces this error message:
$ javac Foo.java
Foo.java:7: incompatible types
found : Foo<E>.E
required: E
return this;
^
1 errorApparently, the type parameter E of the outer class Foo shadows the inner class declaration E. An alternative way to check is to create a new E() in this method, which results in an error message about using a type parameter where a type is expected.
Of course this code is sick, but I would like to know where this is defined in the JLS3, since I cannot find out in which way this shadowing works. What I've found until now:
Page 179:
"The scope of a class' type parameter is the entire declaration of the class."
Page 190:
"The scope of a declaration of a member m declared in or inherited by a class type C is the entire body of C, ... "
Page 132:
"If a type name consists of a single Identifier, then the identifier must occur in the scope of exactly one visible declaration of type with this name, or a compile time error occurs."
Section 6.3.1 (Shadowing declarations) specifies the shadowing rules, but does not mention type parameters.
Any help is appreciated.The current behaviour in eclilpse seems to be the one we get if the bug in javac is fixed as described.
This code compiles
public class Shadow1 {
class Foo<E>
class E
E foo()
return this;
}but this code
Foo<E>.E foo()
return this;
}shows
Type mismatch: cannot convert from Shadow1.Foo<E>.E to Shadow1.Foo<Shadow1.Foo<E>.E>. E
Not sure if this error message is correct. -
List as function parameter type
Hi,
how to declare list parameter type in function ? I want to call function with list, param2 = ('A', 'B', 'C'...) for example: function(param1, param2)
thxTwo ways....
either you know you have a maximum number of parameters allowed and specify it such as ...
e.g. with a maximum of 10 params...
FUNCTION myfunc (p_param1 IN VARCHAR2 := NULL
,p_param2 IN VARCHAR2 := NULL
,p_param3 IN VARCHAR2 := NULL
,p_param4 IN VARCHAR2 := NULL
,p_param5 IN VARCHAR2 := NULL
,p_param6 IN VARCHAR2 := NULL
,p_param7 IN VARCHAR2 := NULL
,p_param8 IN VARCHAR2 := NULL
,p_param9 IN VARCHAR2 := NULL
,p_param10 IN VARCHAR2 := NULL) IS
...or you pass in an array...
TYPE t_params IS TABLE OF VARCHAR2 INDEX BY PLS_INTEGER;
FUNCTION myfunc (p_params IN t_params) IS
...You can't code it for an unknown amount of parameters. -
"final" parameter in a constructor
I saw a code like this.
class Example {
class Test {
public Test(final Example example) {
What does that mean to have a final type parameter in a constructor?
Does that mean that I don't need a "Example" class variable to use the object that are passed to a parameter?
Could you just explain the meaning of "final" variables/parameter?
ThanksThe final keyword means that once a value has been assigned to a variable it cannot be changed. Same goes for parameters.
final int x = 42;
x = 600; // error
public void someMethod(final int x) {
x = 600; // error
} -
HR Create Standalone Query Integrator - LOV as parameter type?
Hi
Our customer wants to download data from a view with filters on various fields. We accomplished this using a download integrator and created restrictions via Standalone Query with various where clause parameters to the view(using HR Create Standalone Query Integrator). While this addressed customer's requirement they are seeing lot of users entering wrong data for the parameter value and causing bad SQLs hitting the database. Customer wants to make sure they dont let end users enter the wrong values in the run time parameter and requesting to make the parameter prompt value to be a LOV type where they are forced to choose one of the valid value.
Example:
Integrator Name - AP_INVOICE
SQL Where Clause – where invoice_type=$PARAM$.invoice_type
1st Parameter Name – invoice_type
1st Parameter Type – Varchar2
1st Parameter Prompt– Invoice Type Equals
Customer wants this Invoice type parameter values to be shown in a drop down list so that end user is forced to pick the valid value and download the data. How to accomplish this? Appreciate your guidance.
Thank you.DECLARE
ln_number NUMBER := 1;
BEGIN
BNE_PARAM_DEFNS_PKG.UPDATE_ROW (
X_APPLICATION_ID => 800,
X_PARAM_DEFN_CODE =>'PER_BUS_GRP_ID',
X_OBJECT_VERSION_NUMBER => ln_number,
X_PARAM_NAME => 'PER:BUS_GRP_ID',
X_PARAM_SOURCE =>'HR:Download',
X_PARAM_CATEGORY => 5,
X_DATATYPE =>1,
X_ATTRIBUTE_APP_ID => NULL,
X_ATTRIBUTE_CODE => NULL,
X_PARAM_RESOLVER => NULL,
X_DEFAULT_REQUIRED_FLAG => 'N',
X_DEFAULT_VISIBLE_FLAG =>'Y',-- changed from 'Y' to 'N'
X_DEFAULT_USER_MODIFYABLE_FLAG =>'Y',
X_DEFAULT_DATE => NULL,
X_DEFAULT_NUMBER => NULL,
X_DEFAULT_BOOLEAN_FLAG => NULL,
X_DEFAULT_FORMULA => NULL,
X_VAL_TYPE => 2,
X_VAL_VALUE =>'XXC_HR_ALL_BG',
X_MAX_SIZE => 240,
X_DISPLAY_TYPE => 3,
X_DISPLAY_STYLE =>1,
X_DISPLAY_SIZE => 240,
X_HELP_URL => NULL,
X_FORMAT_MASK => NULL,
X_USER_NAME => 'APPS',
X_DEFAULT_STRING => NULL,
X_DEFAULT_STRING_TRANS_FLAG =>NULL,
X_DEFAULT_DESC => NULL,
X_PROMPT_LEFT => 'Business Group Name',
X_PROMPT_ABOVE => 'Business Group Name',
X_USER_TIP => 'Enter Business Group Name',
X_ACCESS_KEY => NULL,
X_LAST_UPDATE_DATE => SYSDATE,
X_LAST_UPDATED_BY => -1,
X_LAST_UPDATE_LOGIN => -1
dbms_output.put_line('Value of Object Version Number is : '|| ln_number);
exception
when others then
dbms_output.put_line(SQLERRM);
end;Edited by: 936671 on Jul 4, 2012 10:51 AM -
"Cannot get parameter type" exception in logs
Hello, Everyone!
I am trying to migrate my old Birt reports to a new runtime version (and new designing capabilities as well). The reports get rendered correctly after migration but I experience some lack of performance (quite significant actually). When I check logs I see lots of SEVERE exceptions concerning report parameters which probably affect the delay.
Technical parameters:
Database: Oracle 11g
AS: Apache Tomcat 7.0.26
Java: 1.7.0_67
JDBC Driver: ojdbc6.jar or ojdbc7.jar (described below)
old Birt Viewer Runtime version: 2.5.2
new Birt Viewer Runtime version: 4.4.2 (the latest)
The exceptions are following:
Apr 07, 2015 7:55:40 PM org.eclipse.birt.data.engine.odaconsumer.PreparedStatement doSetNull( int )
SEVERE: Cannot set a null value to parameter 147.
org.eclipse.birt.report.data.oda.jdbc.JDBCException: Cannot set preparedStatement null value.
SQL error #1:Unsupported feature
java.sql.SQLException: Unsupported feature
at org.eclipse.birt.report.data.oda.jdbc.Statement.setNull(Statement.java:884)
at org.eclipse.datatools.connectivity.oda.consumer.helper.OdaQuery.setNull(OdaQuery.java:1223)
at org.eclipse.birt.data.engine.odaconsumer.PreparedStatement.doSetNull(PreparedStatement.java:4691)
at org.eclipse.birt.data.engine.odaconsumer.PreparedStatement.setNull(PreparedStatement.java:4173)
at org.eclipse.birt.data.engine.odaconsumer.PreparedStatement.setParameterValue(PreparedStatement.java:3113)
at org.eclipse.birt.data.engine.odaconsumer.PreparedStatement.setParameterValue(PreparedStatement.java:3070)
at org.eclipse.birt.data.engine.executor.DataSourceQuery.setInputParameterBinding(DataSourceQuery.java:1159)
at org.eclipse.birt.data.engine.executor.DataSourceQuery.execute(DataSourceQuery.java:919)
at org.eclipse.birt.data.engine.impl.PreparedOdaDSQuery$OdaDSQueryExecutor.executeOdiQuery(PreparedOdaDSQuery.java:503)
at org.eclipse.birt.data.engine.impl.QueryExecutor.execute(QueryExecutor.java:1222)
at org.eclipse.birt.data.engine.impl.ServiceForQueryResults.executeQuery(ServiceForQueryResults.java:233)
at org.eclipse.birt.data.engine.impl.QueryResults.getResultIterator(QueryResults.java:178)
at org.eclipse.birt.report.engine.data.dte.QueryResultSet.<init>(QueryResultSet.java:98)
at org.eclipse.birt.report.engine.data.dte.DteDataEngine.doExecuteQuery(DteDataEngine.java:168)
at org.eclipse.birt.report.engine.data.dte.DataGenerationEngine.doExecuteQuery(DataGenerationEngine.java:83)
at org.eclipse.birt.report.engine.data.dte.AbstractDataEngine.execute(AbstractDataEngine.java:275)
at org.eclipse.birt.report.engine.executor.ExecutionContext.executeQuery(ExecutionContext.java:1947)
at org.eclipse.birt.report.engine.executor.QueryItemExecutor.executeQuery(QueryItemExecutor.java:80)
at org.eclipse.birt.report.engine.executor.TableItemExecutor.execute(TableItemExecutor.java:62)
at org.eclipse.birt.report.engine.internal.executor.wrap.WrappedReportItemExecutor.execute(WrappedReportItemExecutor.java:46)
at org.eclipse.birt.report.engine.internal.executor.emitter.ReportItemEmitterExecutor.execute(ReportItemEmitterExecutor.java:46)
at org.eclipse.birt.report.engine.internal.executor.dup.SuppressDuplicateItemExecutor.execute(SuppressDuplicateItemExecutor.java:43)
at org.eclipse.birt.report.engine.internal.executor.wrap.WrappedReportItemExecutor.execute(WrappedReportItemExecutor.java:46)
at org.eclipse.birt.report.engine.internal.executor.l18n.LocalizedReportItemExecutor.execute(LocalizedReportItemExecutor.java:34)
at org.eclipse.birt.report.engine.layout.html.HTMLBlockStackingLM.layoutNodes(HTMLBlockStackingLM.java:65)
at org.eclipse.birt.report.engine.layout.html.HTMLPageLM.layout(HTMLPageLM.java:92)
at org.eclipse.birt.report.engine.layout.html.HTMLReportLayoutEngine.layout(HTMLReportLayoutEngine.java:100)
at org.eclipse.birt.report.engine.presentation.ReportDocumentBuilder.build(ReportDocumentBuilder.java:249)
at org.eclipse.birt.report.engine.api.impl.RunTask.doRun(RunTask.java:269)
at org.eclipse.birt.report.engine.api.impl.RunTask.run(RunTask.java:86)
at org.eclipse.birt.report.service.ReportEngineService.runReport(ReportEngineService.java:1325)
at org.eclipse.birt.report.service.BirtViewerReportService.runReport(BirtViewerReportService.java:158)
at org.eclipse.birt.report.service.actionhandler.BirtRunReportActionHandler.__execute(BirtRunReportActionHandler.java:81)
at org.eclipse.birt.report.service.actionhandler.AbstractBaseActionHandler.execute(AbstractBaseActionHandler.java:90)
at org.eclipse.birt.report.presentation.aggregation.layout.FramesetFragment.doService(FramesetFragment.java:191)
at org.eclipse.birt.report.presentation.aggregation.layout.FramesetFragment.service(FramesetFragment.java:86)
at org.eclipse.birt.report.servlet.ViewerServlet.__doGet(ViewerServlet.java:181)
at org.eclipse.birt.report.servlet.BirtSoapMessageDispatcherServlet.doPost(BirtSoapMessageDispatcherServlet.java:278)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at org.eclipse.birt.report.servlet.BirtSoapMessageDispatcherServlet.service(BirtSoapMessageDispatcherServlet.java:122)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.eclipse.birt.report.filter.ViewerFilter.doFilter(ViewerFilter.java:68)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:987)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:579)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:309)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:722)
Caused by: java.sql.SQLException: Unsupported feature
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:199)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:263)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:271)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:445)
at oracle.jdbc.driver.DatabaseError.throwUnsupportedFeatureSqlException(DatabaseError.java:765)
at oracle.jdbc.driver.OracleParameterMetaData.getParameterType(OracleParameterMetaData.java:156)
at org.eclipse.birt.report.data.oda.jdbc.Statement.setNull(Statement.java:879)
... 60 more
and:
Apr 07, 2015 7:55:40 PM org.eclipse.birt.data.engine.odaconsumer.ParameterMetaData getRuntimeParameterType
SEVERE: Cannot get the type for parameter: 1.
org.eclipse.birt.report.data.oda.jdbc.JDBCException: Cannot get parameter type.
SQL error #1:Unsupported feature
java.sql.SQLException: Unsupported feature
at org.eclipse.birt.report.data.oda.jdbc.ParameterMetaData.getParameterType(ParameterMetaData.java:161)
at org.eclipse.datatools.connectivity.oda.consumer.helper.OdaParameterMetaData.getParameterType(OdaParameterMetaData.java:177)
at org.eclipse.birt.data.engine.odaconsumer.ParameterMetaData.getRuntimeParameterType(ParameterMetaData.java:233)
at org.eclipse.birt.data.engine.odaconsumer.ParameterMetaData.<init>(ParameterMetaData.java:97)
at org.eclipse.birt.data.engine.odaconsumer.PreparedStatement.mergeParamHintsWithMetaData(PreparedStatement.java:1674)
at org.eclipse.birt.data.engine.odaconsumer.PreparedStatement.getParameterMetaData(PreparedStatement.java:1525)
at org.eclipse.birt.data.engine.odaconsumer.PreparedStatement.getParameterMetaData(PreparedStatement.java:1539)
at org.eclipse.birt.data.engine.odaconsumer.PreparedStatement.getParameterType(PreparedStatement.java:798)
at org.eclipse.birt.data.engine.odaconsumer.PreparedStatement.retrySetParameterValue(PreparedStatement.java:3211)
at org.eclipse.birt.data.engine.odaconsumer.PreparedStatement.setParameterValue(PreparedStatement.java:3188)
at org.eclipse.birt.data.engine.odaconsumer.PreparedStatement.setParameterValue(PreparedStatement.java:3070)
at org.eclipse.birt.data.engine.executor.DataSourceQuery.setInputParameterBinding(DataSourceQuery.java:1159)
at org.eclipse.birt.data.engine.executor.DataSourceQuery.execute(DataSourceQuery.java:919)
at org.eclipse.birt.data.engine.impl.PreparedOdaDSQuery$OdaDSQueryExecutor.executeOdiQuery(PreparedOdaDSQuery.java:503)
at org.eclipse.birt.data.engine.impl.QueryExecutor.execute(QueryExecutor.java:1222)
at org.eclipse.birt.data.engine.impl.ServiceForQueryResults.executeQuery(ServiceForQueryResults.java:233)
at org.eclipse.birt.data.engine.impl.QueryResults.getResultIterator(QueryResults.java:178)
at org.eclipse.birt.report.engine.data.dte.QueryResultSet.<init>(QueryResultSet.java:98)
at org.eclipse.birt.report.engine.data.dte.DteDataEngine.doExecuteQuery(DteDataEngine.java:168)
at org.eclipse.birt.report.engine.data.dte.DataGenerationEngine.doExecuteQuery(DataGenerationEngine.java:83)
at org.eclipse.birt.report.engine.data.dte.AbstractDataEngine.execute(AbstractDataEngine.java:275)
at org.eclipse.birt.report.engine.executor.ExecutionContext.executeQuery(ExecutionContext.java:1947)
at org.eclipse.birt.report.engine.executor.QueryItemExecutor.executeQuery(QueryItemExecutor.java:80)
at org.eclipse.birt.report.engine.executor.TableItemExecutor.execute(TableItemExecutor.java:62)
at org.eclipse.birt.report.engine.internal.executor.wrap.WrappedReportItemExecutor.execute(WrappedReportItemExecutor.java:46)
at org.eclipse.birt.report.engine.internal.executor.emitter.ReportItemEmitterExecutor.execute(ReportItemEmitterExecutor.java:46)
at org.eclipse.birt.report.engine.internal.executor.dup.SuppressDuplicateItemExecutor.execute(SuppressDuplicateItemExecutor.java:43)
at org.eclipse.birt.report.engine.internal.executor.wrap.WrappedReportItemExecutor.execute(WrappedReportItemExecutor.java:46)
at org.eclipse.birt.report.engine.internal.executor.l18n.LocalizedReportItemExecutor.execute(LocalizedReportItemExecutor.java:34)
at org.eclipse.birt.report.engine.layout.html.HTMLBlockStackingLM.layoutNodes(HTMLBlockStackingLM.java:65)
at org.eclipse.birt.report.engine.layout.html.HTMLPageLM.layout(HTMLPageLM.java:92)
at org.eclipse.birt.report.engine.layout.html.HTMLReportLayoutEngine.layout(HTMLReportLayoutEngine.java:100)
at org.eclipse.birt.report.engine.presentation.ReportDocumentBuilder.build(ReportDocumentBuilder.java:249)
at org.eclipse.birt.report.engine.api.impl.RunTask.doRun(RunTask.java:269)
at org.eclipse.birt.report.engine.api.impl.RunTask.run(RunTask.java:86)
at org.eclipse.birt.report.service.ReportEngineService.runReport(ReportEngineService.java:1325)
at org.eclipse.birt.report.service.BirtViewerReportService.runReport(BirtViewerReportService.java:158)
at org.eclipse.birt.report.service.actionhandler.BirtRunReportActionHandler.__execute(BirtRunReportActionHandler.java:81)
at org.eclipse.birt.report.service.actionhandler.AbstractBaseActionHandler.execute(AbstractBaseActionHandler.java:90)
at org.eclipse.birt.report.presentation.aggregation.layout.FramesetFragment.doService(FramesetFragment.java:191)
at org.eclipse.birt.report.presentation.aggregation.layout.FramesetFragment.service(FramesetFragment.java:86)
at org.eclipse.birt.report.servlet.ViewerServlet.__doGet(ViewerServlet.java:181)
at org.eclipse.birt.report.servlet.BirtSoapMessageDispatcherServlet.doPost(BirtSoapMessageDispatcherServlet.java:278)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at org.eclipse.birt.report.servlet.BirtSoapMessageDispatcherServlet.service(BirtSoapMessageDispatcherServlet.java:122)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.eclipse.birt.report.filter.ViewerFilter.doFilter(ViewerFilter.java:68)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:987)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:579)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:309)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:722)
Caused by: java.sql.SQLException: Unsupported feature
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:199)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:263)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:271)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:445)
at oracle.jdbc.driver.DatabaseError.throwUnsupportedFeatureSqlException(DatabaseError.java:765)
at oracle.jdbc.driver.OracleParameterMetaData.getParameterType(OracleParameterMetaData.java:156)
at org.eclipse.birt.report.data.oda.jdbc.ParameterMetaData.getParameterType(ParameterMetaData.java:155)
... 65 more
These exceptions probably refer to dataset (query) parameters rather than to report parameters because of their numbers and total amount.
The first exception "Cannot set preparedStatement null" seems to be thrown for all parameters that are initially nulls. The second exception "Cannot get parameter type" seems to be thrown for all parameters (twice for some).
The second one probably has something to do with this bug: https:\//bugs.eclipse.org/bugs/show_bug.cgi?format=multiple&id=384925 Although it is declared to be fixed in an earlier Birt runtime version (4.2.1) and I'm using a later one (4.4.2).
The first one gets critical if I change the Oracle jdbc driver to the new and the most appropriate one (ojdbc7.jar), which should be a better choice because I have Java 7. Older driver ojdbc6.jar renders the report but writes the exception to the logfile, the newer one produces the following in browser:
- org.eclipse.birt.report.engine.api.EngineException: Error happened while running the report.
AxisFault
faultCode: BirtRunReportActionHandler.__execute()
faultSubcode:
faultString: org.eclipse.birt.report.engine.api.EngineException: Error happened while running the report.
faultActor:
faultNode:
faultDetail:
stackTrace:org.eclipse.birt.report.engine.api.EngineException: Error happened while running the report.
at org.eclipse.birt.report.engine.api.impl.EngineTask.handleFatalExceptions(EngineTask.java:2363)
at org.eclipse.birt.report.engine.api.impl.RunTask.doRun(RunTask.java:277)
at org.eclipse.birt.report.engine.api.impl.RunTask.run(RunTask.java:86)
at org.eclipse.birt.report.service.ReportEngineService.runReport(ReportEngineService.java:1325)
at org.eclipse.birt.report.service.BirtViewerReportService.runReport(BirtViewerReportService.java:158)
at org.eclipse.birt.report.service.actionhandler.BirtRunReportActionHandler.__execute(BirtRunReportActionHandler.java:81)
at org.eclipse.birt.report.service.actionhandler.AbstractBaseActionHandler.execute(AbstractBaseActionHandler.java:90)
at org.eclipse.birt.report.presentation.aggregation.layout.FramesetFragment.doService(FramesetFragment.java:191)
at org.eclipse.birt.report.presentation.aggregation.layout.FramesetFragment.service(FramesetFragment.java:86)
at org.eclipse.birt.report.servlet.ViewerServlet.__doGet(ViewerServlet.java:181)
at org.eclipse.birt.report.servlet.BirtSoapMessageDispatcherServlet.doPost(BirtSoapMessageDispatcherServlet.java:278)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at org.eclipse.birt.report.servlet.BirtSoapMessageDispatcherServlet.service(BirtSoapMessageDispatcherServlet.java:122)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.eclipse.birt.report.filter.ViewerFilter.doFilter(ViewerFilter.java:68)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:987)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:579)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:309)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NullPointerException
at org.eclipse.birt.data.engine.odaconsumer.PreparedStatement.getScaleValue(PreparedStatement.java:4423)
at org.eclipse.birt.data.engine.odaconsumer.PreparedStatement.doSetBigDecimal(PreparedStatement.java:4359)
at org.eclipse.birt.data.engine.odaconsumer.PreparedStatement.setBigDecimal(PreparedStatement.java:3955)
at org.eclipse.birt.data.engine.odaconsumer.PreparedStatement.retrySetNullParamValue(PreparedStatement.java:3744)
at org.eclipse.birt.data.engine.odaconsumer.PreparedStatement.retrySetParameterValue(PreparedStatement.java:3245)
at org.eclipse.birt.data.engine.odaconsumer.PreparedStatement.setParameterValue(PreparedStatement.java:3183)
at org.eclipse.birt.data.engine.odaconsumer.PreparedStatement.setParameterValue(PreparedStatement.java:3070)
at org.eclipse.birt.data.engine.executor.DataSourceQuery.setInputParameterBinding(DataSourceQuery.java:1159)
at org.eclipse.birt.data.engine.executor.DataSourceQuery.addParameterDefns(DataSourceQuery.java:605)
at org.eclipse.birt.data.engine.executor.DataSourceQuery.prepare(DataSourceQuery.java:304)
at org.eclipse.birt.data.engine.impl.PreparedOdaDSQuery$OdaDSQueryExecutor.prepareOdiQuery(PreparedOdaDSQuery.java:517)
at org.eclipse.birt.data.engine.impl.QueryExecutor.prepareExecution(QueryExecutor.java:346)
at org.eclipse.birt.data.engine.impl.PreparedQuery.doPrepare(PreparedQuery.java:463)
at org.eclipse.birt.data.engine.impl.PreparedDataSourceQuery.produceQueryResults(PreparedDataSourceQuery.java:190)
at org.eclipse.birt.data.engine.impl.PreparedDataSourceQuery.execute(PreparedDataSourceQuery.java:178)
at org.eclipse.birt.data.engine.impl.PreparedOdaDSQuery.execute(PreparedOdaDSQuery.java:178)
at org.eclipse.birt.report.data.adapter.impl.DataRequestSessionImpl.execute(DataRequestSessionImpl.java:637)
at org.eclipse.birt.report.engine.data.dte.DteDataEngine.doExecuteQuery(DteDataEngine.java:152)
at org.eclipse.birt.report.engine.data.dte.DataGenerationEngine.doExecuteQuery(DataGenerationEngine.java:83)
at org.eclipse.birt.report.engine.data.dte.AbstractDataEngine.execute(AbstractDataEngine.java:275)
at org.eclipse.birt.report.engine.executor.ExecutionContext.executeQuery(ExecutionContext.java:1947)
at org.eclipse.birt.report.engine.executor.QueryItemExecutor.executeQuery(QueryItemExecutor.java:80)
at org.eclipse.birt.report.engine.executor.TableItemExecutor.execute(TableItemExecutor.java:62)
at org.eclipse.birt.report.engine.internal.executor.wrap.WrappedReportItemExecutor.execute(WrappedReportItemExecutor.java:46)
at org.eclipse.birt.report.engine.internal.executor.emitter.ReportItemEmitterExecutor.execute(ReportItemEmitterExecutor.java:46)
at org.eclipse.birt.report.engine.internal.executor.dup.SuppressDuplicateItemExecutor.execute(SuppressDuplicateItemExecutor.java:43)
at org.eclipse.birt.report.engine.internal.executor.wrap.WrappedReportItemExecutor.execute(WrappedReportItemExecutor.java:46)
at org.eclipse.birt.report.engine.internal.executor.l18n.LocalizedReportItemExecutor.execute(LocalizedReportItemExecutor.java:34)
at org.eclipse.birt.report.engine.layout.html.HTMLBlockStackingLM.layoutNodes(HTMLBlockStackingLM.java:65)
at org.eclipse.birt.report.engine.layout.html.HTMLPageLM.layout(HTMLPageLM.java:92)
at org.eclipse.birt.report.engine.layout.html.HTMLReportLayoutEngine.layout(HTMLReportLayoutEngine.java:100)
at org.eclipse.birt.report.engine.presentation.ReportDocumentBuilder.build(ReportDocumentBuilder.java:249)
at org.eclipse.birt.report.engine.api.impl.RunTask.doRun(RunTask.java:269)
... 32 more
For reproducing the situation in the test environment I simply modified standard test.rptdesign and added a datasource and a dataset with one sample parameter:
<?xml version="1.0" encoding="UTF-8"?>
<report xmlns="http:\//www.eclipse.org/birt/2005/design" version="3.2.23" id="1">
<property name="author">Bertie the Platypus</property>
<property name="comments">Not a very interesting report, just a "Hello World" with a param.</property>
<property name="createdBy">Eclipse BIRT Designer Version 4.3.2.v20140211-1400 Build <4.3.2.v20140225-1404></property>
<html-property name="description">Sample report used to test the BIRT viewer.</html-property>
<property name="units">in</property>
<property name="layoutPreference">auto layout</property>
<parameters>
<scalar-parameter name="sample" id="2">
<text-property name="displayName">Sample Parameter</text-property>
<property name="hidden">false</property>
<property name="valueType">static</property>
<property name="isRequired">false</property>
<property name="dataType">decimal</property>
<property name="distinct">true</property>
<list-property name="selectionList"/>
<property name="paramType">simple</property>
<property name="concealValue">false</property>
<property name="controlType">text-box</property>
<structure name="format">
<property name="category">Unformatted</property>
</structure>
</scalar-parameter>
</parameters>
<data-sources>
<oda-data-source extensionID="org.eclipse.birt.report.data.oda.jdbc" name="compl" id="27">
<list-property name="privateDriverProperties">
<ex-property>
<name>metadataBidiFormatStr</name>
<value>ILYNN</value>
</ex-property>
<ex-property>
<name>disabledMetadataBidiFormatStr</name>
</ex-property>
<ex-property>
<name>contentBidiFormatStr</name>
<value>ILYNN</value>
</ex-property>
<ex-property>
<name>disabledContentBidiFormatStr</name>
</ex-property>
</list-property>
<property name="odaDriverClass">oracle.jdbc.OracleDriver</property>
<property name="odaURL">jdbc:oracle:thin:@hawk.insoft03.lan:1521:hawkw</property>
<property name="odaUser">compl_test</property>
<encrypted-property name="odaPassword" encryptionID="base64">Y29tcGw=</encrypted-property>
<property name="odaJndiName">java:comp/env/jdbc/moonDB</property>
</oda-data-source>
</data-sources>
<data-sets>
<oda-data-set extensionID="org.eclipse.birt.report.data.oda.jdbc.JdbcSelectDataSet" name="test" id="28">
<list-property name="parameters">
<structure>
<property name="name">param_1</property>
<property name="paramName">sample</property>
<property name="dataType">string</property>
<property name="position">1</property>
<property name="isInput">true</property>
<property name="isOutput">false</property>
</structure>
</list-property>
<structure name="cachedMetaData">
<list-property name="resultSet">
<structure>
<property name="position">1</property>
<property name="name">:1</property>
<property name="dataType">string</property>
</structure>
</list-property>
</structure>
<property name="dataSource">compl</property>
<list-property name="resultSet">
<structure>
<property name="position">1</property>
<property name="name">:1</property>
<property name="nativeName">:1</property>
<property name="dataType">string</property>
</structure>
</list-property>
<xml-property name="queryText"><![CDATA[select ?
from dual]]></xml-property>
<xml-property name="designerValues"><![CDATA[]]></xml-property>
</oda-data-set>
</data-sets>
<page-setup>
<simple-master-page name="Simple MasterPage" id="3">
<property name="topMargin">1in</property>
<property name="leftMargin">1.25in</property>
<property name="bottomMargin">1in</property>
<property name="rightMargin">1.25in</property>
<page-header>
<grid id="4">
<property name="width">100%</property>
<column id="5"/>
<row id="6">
<cell id="7">
<property name="fontSize">xx-large</property>
<property name="fontWeight">bold</property>
<property name="textAlign">center</property>
<text id="8">
<text-property name="content"><![CDATA[Title]]></text-property>
</text>
</cell>
</row>
</grid>
</page-header>
<page-footer>
<grid id="9">
<property name="width">100%</property>
<column id="10"/>
<column id="11"/>
<row id="12">
<cell id="13">
<text id="14">
<property name="contentType">html</property>
<text-property name="content"><![CDATA[<value-of>new Date()</value-of>]]></text-property>
</text>
</cell>
<cell id="15">
<property name="textAlign">right</property>
<auto-text id="26">
<property name="type">page-number</property>
</auto-text>
</cell>
</row>
</grid>
</page-footer>
</simple-master-page>
</page-setup>
<body>
<text id="17">
<property name="contentType">html</property>
<text-property name="content"><![CDATA[<b>Congratulations!</b>
<br><br>
If you can see this report, it means that the BIRT viewer is installed correctly.
<br><br>]]></text-property>
</text>
<grid id="18">
<property name="width">100%</property>
<column id="19">
<property name="width">1.354in</property>
</column>
<column id="20">
<property name="width">5.083in</property>
</column>
<row id="21">
<cell id="22">
<label id="23">
<text-property name="text">Sample Parameter:</text-property>
</label>
</cell>
<cell id="24">
<data id="25">
<list-property name="boundDataColumns">
<structure>
<property name="name">params["sample"]</property>
<expression name="expression">params["sample"]</expression>
</structure>
</list-property>
<property name="resultSetColumn">params["sample"]</property>
</data>
</cell>
</row>
<row id="29">
<cell id="30">
<label id="32">
<text-property name="text">Query result:</text-property>
</label>
</cell>
<cell id="31">
<data id="33">
<property name="dataSet">test</property>
<list-property name="boundDataColumns">
<structure>
<property name="name">Column Binding</property>
<expression name="expression" type="javascript">dataSetRow[":1"]</expression>
<property name="dataType">string</property>
<property name="allowExport">true</property>
</structure>
</list-property>
<property name="resultSetColumn">Column Binding</property>
</data>
</cell>
</row>
</grid>
</body>
</report>
The exceptions raise even in such a simple case. Of course it doesn't take minutes to show, but concerning my report with several datasets taking more than 200 parameters in total, the response time drastically raised from about 30-40 seconds up to 3 minutes.
So I need help!Hello,
Were you able to solve this problem and how?
Thanks -
Question on the parameter type of DLL functions
Question on the parameter type of DLL functions
I am trying to develop an interface to control a laser with LV8.2 I am planing to use the VI “Call Library Function Node” to call the DLL and set the exact same parameters of functions in the DLL.
According to the DLL manual of the laser, there are six functions. One of the prototypes is: function getstatuspointer : pointer. I don't know how to set this parameter for the function. Is there anyone who can give some hints? Thanks!
BTW :The following is a description of the function:
This function returns a 32 bit pointer to the STATUS data structure (Tstatusrec). In the 32 bit DLL, every application is using its own copy of the data structure (local
memory). The data structure is a packed structure. "packed" means that the fields in the structure are not aligned on word or double-word boundaries.
Tstatusrec = packed record
size : word;
initstat : byte;
queuefill : byte;
anzapp16 : word; (not used)
anzapp32 : word;
anzdock16 : word; (not used)
anzdock32 : word;
dll16ver : tchararray; (not used)
dll32ver : tchararray;
excimerver : tchararray;
excimer : TExcimerStatus;
end;Hi Jack,
This is a good starting point when using Call Library Function node. Check out this Help Page
Van L
NI Applications Engineer -
Hello.
During developing Domain Index for Oracle 11.2.0.1.0 (problem also appears in 12с) i was faced with misunderstanding of parameter types of function
ODCIIndexInsert in case of creating indextype WITH ARRAY DML option
According to Oracle documentation
http://docs.oracle.com/cd/E11882_01/appdev.112/e10765/ext_idx_ref.htm#i76892
In case of WITH ARRAY DML option Oracle will invoke ODCIIndexInsert with following signature
FUNCTION ODCIIndexInsert(
ia ODCIIndexInfo,
ridlist ODCIRidList,
newvallist varray_of_column_type,
env ODCIEnv)
RETURN NUMBER
In my case indexed column has datatype NUMBER so i defined varray_of_column_type as SYS.ODCINumberList
STATIC FUNCTION ODCIIndexInsert(ia in sys.ODCIIndexInfo, ridlist in sys.ODCIRidList, newvallist in sys.ODCINumberList, env in SYS.ODCIEnv) RETURN NUMBER
Indextype was created as
CREATE INDEXTYPE test_index_type
FOR
test_eq(number, number)
USING index_methods
WITH ARRAY DML(number, sys.ODCINumberList)
WITH LOCAL RANGE PARTITION
WITH SYSTEM MANAGED STORAGE TABLES;
or
CREATE INDEXTYPE test_index_type
FOR
test_eq(number, number)
USING index_methods
WITH ARRAY DML
WITH LOCAL RANGE PARTITION
WITH SYSTEM MANAGED STORAGE TABLES;
(problem occurs in all cases)
CREATE TABLE test_table (id NUMBER (19,0));
CREATE INDEX test_index ON test_table(id) INDEXTYPE IS test_index_type;
When attempting to insert data in the table
insert into test_table values (1);
oracle raise exception
Error starting at line 53 in command:
insert into test_table values (1)
Error at Command Line:53 Column:1
Error report:
SQL Error: ORA-29925: cannot execute SCOTT.INDEX_METHODS.ODCIINDEXINSERT
ORA-06553: PLS-306: wrong number or types of arguments in call to 'ODCIINDEXINSERT'
ORA-06553: PLS-306: wrong number or types of arguments in call to 'ODCIINDEXINSERT'
29925. 00000 - "cannot execute %s"
*Cause: The specified function does not exist or does not have an
appropriate signature.
*Action: Implement the function with the appropriate signature.
So my question is.
Is it normal behavior of oracle (according to documentation)?
What is correct signature of ODCIIndexInsert function in case of INDEXTYPE creation with 'WITH ARRAY DML' option and fact that indexed column has NUMBER datatype?
By the way if i define indextype without 'WITH ARRAY DML' option signature is clear, and working. But this approach doesn't satisfies our performance needs.
Also if i define index type with option 'WITH ARRAY DML WITHOUT COLUMN DATA' and use signature
static function ODCIIndexInsert(ia sys.odciindexinfo, ridlist sys.odciridlist, env sys.ODCIEnv) return number
Everything works too. But this approach doesn't satisfies our business needs.
Is it a way to define ODCIIndexInsert parameter types (in case of indexing number column) so that batch inserting works according to documentation ?
FUNCTION ODCIIndexInsert(
ia ODCIIndexInfo,
ridlist ODCIRidList,
newvallist varray_of_column_type,
env ODCIEnv)
I am attaching full sql script to recreate environment and reproduce the problem.
Type definition:
CREATE OR REPLACE TYPE index_methods AS OBJECT
step number,
STATIC FUNCTION ODCIGetInterfaces(ifclist OUT SYS.ODCIObjectList) RETURN NUMBER,
STATIC FUNCTION ODCIIndexCreate (ia SYS.ODCIIndexInfo, parms VARCHAR2, env SYS.ODCIEnv) RETURN NUMBER,
STATIC FUNCTION ODCIIndexAlter (ia sys.ODCIIndexInfo, parms IN OUT VARCHAR2, altopt number, env sys.ODCIEnv) RETURN NUMBER,
STATIC FUNCTION ODCIIndexDrop(ia SYS.ODCIIndexInfo, env SYS.ODCIEnv) RETURN NUMBER,
STATIC FUNCTION ODCIIndexExchangePartition(ia SYS.ODCIIndexInfo, ia1 SYS.ODCIIndexInfo, env SYS.ODCIEnv) RETURN NUMBER,
STATIC FUNCTION ODCIIndexUpdPartMetadata(ia sys.ODCIIndexInfo, palist sys.ODCIPartInfoList, env sys.ODCIEnv) RETURN NUMBER,
STATIC FUNCTION ODCIIndexInsert(ia in sys.ODCIIndexInfo, ridlist in sys.ODCIRidList, newvallist in sys.ODCINumberList, env in SYS.ODCIEnv) RETURN NUMBER,
STATIC FUNCTION ODCIIndexDelete(ia SYS.ODCIIndexInfo, rid VARCHAR2, oldval number, env SYS.ODCIEnv) RETURN NUMBER,
STATIC FUNCTION ODCIIndexUpdate(ia SYS.ODCIIndexInfo, rid VARCHAR2, oldval number, newval number, env SYS.ODCIEnv) RETURN NUMBER,
STATIC FUNCTION ODCIIndexStart(sctx IN OUT index_methods, ia SYS.ODCIIndexInfo,
op SYS.ODCIPredInfo, qi sys.ODCIQueryInfo, strt number, stop number, cmpval number, env SYS.ODCIEnv) RETURN NUMBER,
MEMBER FUNCTION ODCIIndexFetch(self IN OUT index_methods, nrows NUMBER, rids OUT SYS.ODCIridlist, env SYS.ODCIEnv) RETURN NUMBER,
MEMBER FUNCTION ODCIIndexClose(self IN index_methods, env SYS.ODCIEnv) RETURN NUMBER
CREATE OR REPLACE TYPE BODY index_methods IS
STATIC FUNCTION ODCIGetInterfaces(ifclist OUT sys.ODCIObjectList) RETURN NUMBER IS
BEGIN
ifclist := sys.ODCIObjectList(sys.ODCIObject('SYS','ODCIINDEX2'));
RETURN ODCIConst.Success;
END ODCIGetInterfaces;
STATIC FUNCTION ODCIIndexCreate (ia sys.ODCIIndexInfo, parms VARCHAR2, env sys.ODCIEnv) RETURN NUMBER IS
BEGIN
RETURN ODCIConst.Success;
END ODCIIndexCreate;
STATIC FUNCTION ODCIIndexDrop(ia sys.ODCIIndexInfo, env sys.ODCIEnv) RETURN NUMBER IS
BEGIN
RETURN ODCIConst.Success;
END ODCIIndexDrop;
STATIC FUNCTION ODCIIndexAlter (
ia sys.ODCIIndexInfo,
parms IN OUT VARCHAR2,
altopt NUMBER,
env sys.ODCIEnv)
RETURN NUMBER IS
BEGIN
RETURN ODCIConst.Success;
END ODCIIndexAlter;
STATIC FUNCTION ODCIIndexUpdPartMetadata(
ia sys.ODCIIndexInfo,
palist sys.ODCIPartInfoList,
env sys.ODCIEnv)
RETURN NUMBER IS
BEGIN
RETURN ODCIConst.Success;
END ODCIIndexUpdPartMetadata;
STATIC FUNCTION ODCIIndexExchangePartition(
ia sys.ODCIIndexInfo,
ia1 sys.ODCIIndexInfo,
env sys.ODCIEnv)
RETURN NUMBER IS
BEGIN
RETURN ODCIConst.Success;
END ODCIIndexExchangePartition;
STATIC FUNCTION ODCIIndexInsert(
ia sys.ODCIIndexInfo,
ridlist sys.ODCIRidList,
newvallist sys.ODCINumberList,
env sys.ODCIEnv)
RETURN NUMBER IS
BEGIN
return ODCIConst.Success;
END;
STATIC FUNCTION ODCIIndexDelete(
ia SYS.ODCIIndexInfo,
rid VARCHAR2,
oldval number,
env SYS.ODCIEnv)
RETURN NUMBER IS
BEGIN
return ODCIConst.Success;
END;
STATIC FUNCTION ODCIIndexUpdate(
ia SYS.ODCIIndexInfo,
rid VARCHAR2,
oldval number,
newval number,
env SYS.ODCIEnv)
RETURN NUMBER AS
BEGIN
return ODCIConst.Success;
END;
STATIC FUNCTION ODCIIndexStart(
sctx IN OUT index_methods,
ia SYS.ODCIIndexInfo,
op SYS.ODCIPredInfo,
qi sys.ODCIQueryInfo,
strt number,
stop number,
cmpval number,
env SYS.ODCIEnv)
RETURN NUMBER AS
BEGIN
sctx := index_methods(1);
return ODCIConst.Success;
END;
MEMBER FUNCTION ODCIIndexFetch(
self IN OUT index_methods,
nrows NUMBER,
rids OUT SYS.ODCIridlist,
env SYS.ODCIEnv)
RETURN NUMBER AS
BEGIN
return ODCIConst.Success;
END;
MEMBER FUNCTION ODCIIndexClose(self IN index_methods, env SYS.ODCIEnv) RETURN NUMBER AS
BEGIN
return ODCIConst.Success;
END;
end;
Problem workaround:
--drop function test_eq_fun;
CREATE FUNCTION test_eq_fun(a number, b number) RETURN NUMBER AS
BEGIN
IF a = b then
RETURN 1;
ELSE
RETURN 0;
END IF;
END;
--drop operator test_eq;
CREATE OPERATOR test_eq
BINDING (number, number) RETURN NUMBER
USING test_eq_fun;
--drop indextype test_index_type;
CREATE INDEXTYPE test_index_type
FOR
test_eq(number, number)
USING index_methods
WITH ARRAY DML(number, sys.ODCINumberList)
WITH LOCAL RANGE PARTITION
WITH SYSTEM MANAGED STORAGE TABLES;
CREATE INDEXTYPE test_index_type
FOR
test_eq(number, number)
USING index_methods
WITH ARRAY DML
WITH LOCAL RANGE PARTITION
WITH SYSTEM MANAGED STORAGE TABLES;
--drop table test_table;
CREATE TABLE test_table (id NUMBER (19,0));
CREATE INDEX test_index ON test_table(id) INDEXTYPE IS test_index_type;
insert into test_table values (1);I get single for 1 row and batch for 2 or more rows in the following simplified simulation.
SCOTT@orcl12c> DESC SYS.ODCINUMBERLIST
SYS.ODCINUMBERLIST VARRAY(32767) OF NUMBER
SCOTT@orcl12c> CREATE OR REPLACE TYPE index_methods AS OBJECT
2 (
3 step number,
4 STATIC FUNCTION ODCIGetInterfaces(ifclist OUT SYS.ODCIObjectList) RETURN NUMBER,
5 STATIC FUNCTION ODCIIndexCreate (ia SYS.ODCIIndexInfo, parms VARCHAR2, env SYS.ODCIEnv) RETURN NUMBER,
6 STATIC FUNCTION ODCIIndexAlter (ia sys.ODCIIndexInfo, parms IN OUT VARCHAR2, altopt number, env sys.ODCIEnv) RETURN NUMBER,
7 STATIC FUNCTION ODCIIndexDrop(ia SYS.ODCIIndexInfo, env SYS.ODCIEnv) RETURN NUMBER,
8 STATIC FUNCTION ODCIIndexExchangePartition(ia SYS.ODCIIndexInfo, ia1 SYS.ODCIIndexInfo, env SYS.ODCIEnv) RETURN NUMBER,
9 STATIC FUNCTION ODCIIndexUpdPartMetadata(ia sys.ODCIIndexInfo, palist sys.ODCIPartInfoList, env sys.ODCIEnv) RETURN NUMBER,
10 STATIC FUNCTION ODCIIndexInsert(ia in sys.ODCIIndexInfo, rid in VARCHAR2, newval in NUMBER, env in SYS.ODCIEnv) RETURN NUMBER,
11 STATIC FUNCTION ODCIIndexInsert(ia in sys.ODCIIndexInfo, ridlist in sys.ODCIRidList, newvallist in your_type, env in SYS.ODCIEnv) RETURN NUMBER,
12 STATIC FUNCTION ODCIIndexDelete(ia SYS.ODCIIndexInfo, rid VARCHAR2, oldval number, env SYS.ODCIEnv) RETURN NUMBER,
13 STATIC FUNCTION ODCIIndexUpdate(ia SYS.ODCIIndexInfo, rid VARCHAR2, oldval number, newval number, env SYS.ODCIEnv) RETURN NUMBER,
14 STATIC FUNCTION ODCIIndexStart(sctx IN OUT index_methods, ia SYS.ODCIIndexInfo,
15 op SYS.ODCIPredInfo, qi sys.ODCIQueryInfo, strt number, stop number, cmpval number, env SYS.ODCIEnv) RETURN NUMBER,
16 MEMBER FUNCTION ODCIIndexFetch(self IN OUT index_methods, nrows NUMBER, rids OUT SYS.ODCIridlist, env SYS.ODCIEnv) RETURN NUMBER,
17 MEMBER FUNCTION ODCIIndexClose(self IN index_methods, env SYS.ODCIEnv) RETURN NUMBER
18 );
19 /
Type created.
SCOTT@orcl12c> CREATE OR REPLACE TYPE BODY index_methods IS
2 STATIC FUNCTION ODCIGetInterfaces(ifclist OUT sys.ODCIObjectList) RETURN NUMBER IS
3 BEGIN
4 ifclist := sys.ODCIObjectList(sys.ODCIObject('SYS','ODCIINDEX2'));
5 RETURN ODCIConst.Success;
6 END ODCIGetInterfaces;
7
8 STATIC FUNCTION ODCIIndexCreate (ia sys.ODCIIndexInfo, parms VARCHAR2, env sys.ODCIEnv) RETURN NUMBER IS
9 BEGIN
10 RETURN ODCIConst.Success;
11 END ODCIIndexCreate;
12
13 STATIC FUNCTION ODCIIndexDrop(ia sys.ODCIIndexInfo, env sys.ODCIEnv) RETURN NUMBER IS
14 BEGIN
15 RETURN ODCIConst.Success;
16 END ODCIIndexDrop;
17
18 STATIC FUNCTION ODCIIndexAlter (
19 ia sys.ODCIIndexInfo,
20 parms IN OUT VARCHAR2,
21 altopt NUMBER,
22 env sys.ODCIEnv)
23 RETURN NUMBER IS
24 BEGIN
25 RETURN ODCIConst.Success;
26 END ODCIIndexAlter;
27
28 STATIC FUNCTION ODCIIndexUpdPartMetadata(
29 ia sys.ODCIIndexInfo,
30 palist sys.ODCIPartInfoList,
31 env sys.ODCIEnv)
32 RETURN NUMBER IS
33 BEGIN
34 RETURN ODCIConst.Success;
35 END ODCIIndexUpdPartMetadata;
36
37 STATIC FUNCTION ODCIIndexExchangePartition(
38 ia sys.ODCIIndexInfo,
39 ia1 sys.ODCIIndexInfo,
40 env sys.ODCIEnv)
41 RETURN NUMBER IS
42 BEGIN
43 RETURN ODCIConst.Success;
44 END ODCIIndexExchangePartition;
45
46 STATIC FUNCTION ODCIIndexInsert(
47 ia sys.ODCIIndexInfo,
48 rid VARCHAR2,
49 newval NUMBER,
50 env sys.ODCIEnv)
51 RETURN NUMBER IS
52 BEGIN
53 dbms_output.put_line ('single');
54 return ODCIConst.Success;
55 END;
56
57 STATIC FUNCTION ODCIIndexInsert(
58 ia sys.ODCIIndexInfo,
59 ridlist sys.ODCIRidList,
60 newvallist your_type,
61 env sys.ODCIEnv)
62 RETURN NUMBER IS
63 BEGIN
64 dbms_output.put_line ('batch');
65 return ODCIConst.Success;
66 END;
67
68 STATIC FUNCTION ODCIIndexDelete(
69 ia SYS.ODCIIndexInfo,
70 rid VARCHAR2,
71 oldval number,
72 env SYS.ODCIEnv)
73 RETURN NUMBER IS
74 BEGIN
75 return ODCIConst.Success;
76 END;
77
78 STATIC FUNCTION ODCIIndexUpdate(
79 ia SYS.ODCIIndexInfo,
80 rid VARCHAR2,
81 oldval number,
82 newval number,
83 env SYS.ODCIEnv)
84 RETURN NUMBER AS
85 BEGIN
86 return ODCIConst.Success;
87 END;
88
89 STATIC FUNCTION ODCIIndexStart(
90 sctx IN OUT index_methods,
91 ia SYS.ODCIIndexInfo,
92 op SYS.ODCIPredInfo,
93 qi sys.ODCIQueryInfo,
94 strt number,
95 stop number,
96 cmpval number,
97 env SYS.ODCIEnv)
98 RETURN NUMBER AS
99 BEGIN
100 sctx := index_methods(1);
101 return ODCIConst.Success;
102 END;
103
104 MEMBER FUNCTION ODCIIndexFetch(
105 self IN OUT index_methods,
106 nrows NUMBER,
107 rids OUT SYS.ODCIridlist,
108 env SYS.ODCIEnv)
109 RETURN NUMBER AS
110 BEGIN
111 return ODCIConst.Success;
112 END;
113
114 MEMBER FUNCTION ODCIIndexClose(self IN index_methods, env SYS.ODCIEnv) RETURN NUMBER AS
115 BEGIN
116 return ODCIConst.Success;
117 END;
118 end;
119 /
Type body created.
SCOTT@orcl12c> CREATE FUNCTION test_eq_fun(a number, b number) RETURN NUMBER AS
2 BEGIN
3 IF a = b then
4 RETURN 1;
5 ELSE
6 RETURN 0;
7 END IF;
8 END;
9 /
Function created.
SCOTT@orcl12c> CREATE OPERATOR test_eq
2 BINDING (number, number) RETURN NUMBER
3 USING test_eq_fun
4 /
Operator created.
SCOTT@orcl12c> CREATE INDEXTYPE test_index_type
2 FOR
3 test_eq(number, number)
4 USING index_methods
5 WITH ARRAY DML(number, your_type)
6 WITH LOCAL RANGE PARTITION
7 WITH SYSTEM MANAGED STORAGE TABLES
8 /
Indextype created.
SCOTT@orcl12c> CREATE TABLE test_table (id NUMBER (19,0))
2 /
Table created.
SCOTT@orcl12c> CREATE INDEX test_index ON test_table(id) INDEXTYPE IS test_index_type
2 /
Index created.
SCOTT@orcl12c> insert into test_table values (1)
2 /
single
1 row created.
SCOTT@orcl12c> insert into test_table
2 select 2 from dual union all
3 select 3 from dual
4 /
batch
2 rows created.
SCOTT@orcl12c> insert into test_table select deptno from dept
2 /
batch
4 rows created.
SCOTT@orcl12c> insert into test_table select object_id from user_objects
2 /
batch
34 rows created.
SCOTT@orcl12c> -
When/How to use - "search" parameter type in parameter like other types.
We recently upgraded BI Publisher to 10.1.3.4. I saw new parameter type "search" in parameter section, when creating report. whats the use of it? How to use it ? like other parameter type Text, Menu,Hidden, Date.
I couldn't find any help or release notes on this !
Thanks
AyapsI started looking into this parameter type when our drop-down for customer numbers went from 13,000 (manageable) to 45,000 (completely unmanageable).
I imagine this is supposed to mimic the effects of a "Long List" type LOV in Oracle Applications (as I had inquired about in [this thread|http://forums.oracle.com/forums/thread.jspa?threadID=895521&stqc=true|Large List of Values (LoV) hangs. Is there an equivalent for a long list?]), but performance-wise, "Search" does not seem to be any more efficient that using the "Menu" type LOV. Even with the help of having a partial string with a wildcard to match, the "Search" still takes too long to pull up to be of any use to us. -
Convert binary bytes to Labview Extended Precision type
Hello All:
I am reading a binary file that was written in Windows. One of the types used in the data structure
is the Delphi extended precision type, which is 10 bytes. When reading this in using Labview's
"read binary file" VI, there is only one choice, and that is to read it in as an array of 10 bytes
(Labview's extended precision is 16 bytes.) I have tried using the type cast with no results.
So....how to convert the data in the 10 byte array to a 16 byte extended precision format in
Labview? I guess part of the problem is not really understanding how the extended precision
type is stored in IEEE format.
Has anyone performed this conversion before that could help out? I'm sure this must have
been done by someone....somewhere....I have no hair left....
Any help would be appreciated!
Thanks,
Gary.Uhm, something must have gone wrong, the link TST sent,
mentions that LabVIEW stores extended data as 80 bit (10 bytes) on Intel platform.
Complex double is stored as two doubles (=16 byes). My guess is that Altenbach's latest note mentioning the endianess should help you.
If the endiannes is right you should be able to just typecast the data:
Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas
LabVIEW, programming like it should be! -
How to send IDOC with extended message type MATMAS
Hi Experts,
I am looking for a solution to send open PR & open PO related data for diffrent materials through as IDCO in XML file.
Scenario is i have to show a report in a 3rd party system for open PR & open PR that too will come after selection some materials. That means select a materials & it will show all the open PO & related data in a report.
The rough idea for the solution i got is I can save the data in XML file in the system. For this i have to send IDOC. but the problem is there is no message type for PR. IF i am not wrong i can extend the MATMAS05 for a segment that will have PR related info.
Now what to do with that how to send the IDOC do i need to create another report to send IDOC or i can send the extended one through BD10. I tried it but it shows error message "0 communication idoc sent" so I dont no y such error is coming i think i am not filling the extended idoc. But again my QUestion is how to do that.
Can i use BAPI also for such work, if then how it can be helpful.
If anyone have any other solution Please help me out of this.
Regards,
NikHi Mahesh,
Thanks for your reply.
My requirement is bit different. i have to send Open PR data for diffrent materials. In a 3rd party application user will search for few materials which will generate a report that will show the PR related data for those material.
That means for few selected materials there will be few PR's which may be open, i have to show those in my report.
Eg: material A, B. are in PR 00001 & material B, C in PR 00002.
After selecting materials A to C report will show
Material PR No Item No Quantity
A 00001 10 1
B 00001 20 3
B 00002 10 3
C 00002 10 1
Same thing i have to do for open PO & open Sales order also.
Can u please help me to provide the solution how can i proceed for it. U have given the Message type & a bapi how it will help in my issue?
I got a suggesion from someone that extend message type matmas for PR, PO, SD related data & send the idoc. but i am confused how to pass that much data ina single IDOC.
Regards,
Nik -
Parameter type in stored procedure call
What is the best way using ODP.net to reference the parameter type?
I have several stored procedure in a Oracle 9i database.
The database looks like:
Name Null? Type
FLTID NOT NULL NUMBER(10)
PLANEID NOT NULL VARCHAR2(3)
The call in my VB.net app is:
cmd = New OracleCommand("AeronauticsUtils.Flights_insert", conn)
cmd.CommandType = CommandType.StoredProcedure
cmd.Parameters.Add(New OracleParameter("fID", OracleDbType.Int32, ParameterDirection.Input)).Value = row("FLTID")
cmd.Parameters.Add(New OracleParameter("plnid", OracleDbType.Varchar2, ParameterDirection.Input)).Value = row("PLANEID")
cmd.ExecuteNonQuery()
cmd.Dispose()
What should I use?
OracleDbType.Int32
OracleType.VarChar
Types.OracleDecimal
or something else?I use OracleDbType.Decimal for NUMBER columns and OracleDbType.Varchar2 for VARCHAR2 columns.
Are you having issues?
- Mark
===================================================
Mark A. Williams
Oracle DBA
Author, Professional .NET Oracle Programming
http://www.apress.com/book/bookDisplay.html?bID=378 -
IN,OUT and IN OUT Parameter Types
Dear All,
as per some book,
IN parameter uses Call by Reference
and OUT and IN OUT Uses Call by Value
we can use NOCOPY for Making OUT and IN OUT Call by Reference.
my small doubt is
when u r passing a reference of a Variable how oracle takes care that only IN Parameter are not allowed to change (in c and c++ we can say *para to access the variables) ,
i mean in case i use NOCOPY all parameter type are using CALL BY REFERENCE then how the "No Modify" is forced in case of IN Parameter.
Thanks for Reading Request.
Raj.The pl/sql compiler will simply not allow you to have a stmt that assigns something to an "IN" parameter. It can fully be enforced at compile time.
Tom Best -
Is it possible to extend PT type Infotype like 2005?
Hi~~~....
I wonder that I can extend PT (Time Record) type Infotype like 2005.
We can extend other type infotype using ci_ structure.
But PT type Infotypes have no ci_ structure.
Is it possible to extend???No, all absence/presence related infotypes can't be enhanced (infotypes 2000-2011).
-
How to use INVOKE function with INT parameter types
Can you tell me how to use invoke function with int parameter type ?
Pass the int as an Integer.
Maybe you are looking for
-
For the last 2 days when I try to rent a movie on my Apple TV the Apple TV attempts to access the iTunes Store and then I get a message saying Apple TV cannot connect to the server at this time. Please try again later. I have no trouble connecting to
-
Lg m197wdp connect to mac via thunderbolt port
trying to connect mac to lg m197wdp connect to mac via thunderbolt port can not find a mac friendly software update and although the mac screen goes blank for a few seconds when TV is turned on the mac doesn't seem to recognise it as there.
-
Need solution for unicode error
Hi , I am facing unicode error "ESCAPE_TRICK cannot be converted to a character-type field" for the following syntax - ESCAPE_TRICK-X1 = '1C'. Where ESCAPE_TRICK is defined as - DATA: BEGIN OF ESCAPE_TRICK, X1(1) TYPE X, END OF ESCAPE_T
-
Why not 1.2-0.1=1.1?
it's obvious that 1.2-0.1=1.1,but the result is:1.0999999999999999 any help?
-
Dynamic client invocation (6.1) question
Hi I am invoking an external webservice using a WL6.1 based client. Since I have the WSDL, I use WebSeviceProxy.getServiceAt(wsdl) to get the proxy based on the given wsdl URL. The external webservice has the following signature : void notification(M