New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exception in thread "main" org.firebirdsql.jdbc.FBSQLException: GDS Exception. 335544569. Dynamic SQL Error [JDBC94] #132
Comments
Modified by: Roman Rokytskyy (rrokytskyy)Fix Version: Jaybird 2.2 [ 10053 ] |
Modified by: Roman Rokytskyy (rrokytskyy)Fix Version: Jaybird 2.2 [ 10053 ] => |
Modified by: @mrotteveel |
Modified by: @mrotteveel |
Modified by: @mrotteveel |
Commented by: @mrotteveel This is a limitation of Firebird itself: the type of the parameter in '? IN (subselect)' cannot be determined. It will be fixed in Firebird 3.0 (see CORE2697, see CORE3842 for an example which also demonstrates the problem from ISQL). The change will potentially be backported to a future sub-release of Firebird 2.5 as well. The workaround is to rewrite the query to use EXISTS (SELECT 1 FROM ... WHERE field=?). |
Commented by: @mrotteveel Marked as won't fix, as this can't be fixed in Jaybird itself. |
Submitted by: Dainius Daujotas (ddaujotas)
Assigned to: Roman Rokytskyy (rrokytskyy)
Relate to CORE2697
Is related to CORE3842
I tested with latest 2.1.1 driver;
SQL command is corrent wnd well runs directly in isql. But from jdbc prepared statement throws exception:
Exception in thread "main" org.firebirdsql.jdbc.FBSQLException: GDS Exception. 335544569. Dynamic SQL Error
SQL error code = -804
Data type unknown
at org.firebirdsql.jdbc.AbstractPreparedStatement.<init>(AbstractPreparedStatement.java:119)
at org.firebirdsql.jdbc.FBPreparedStatement.<init>(FBPreparedStatement.java:41)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at org.firebirdsql.jdbc.FBStatementFactory.createPreparedStatement(FBStatementFactory.java:90)
at org.firebirdsql.jdbc.AbstractConnection.prepareStatement(AbstractConnection.java:869)
at org.firebirdsql.jdbc.AbstractConnection.prepareStatement(AbstractConnection.java:824)
at org.firebirdsql.jdbc.AbstractConnection.prepareStatement(AbstractConnection.java:817)
at org.firebirdsql.jdbc.AbstractConnection.prepareStatement(AbstractConnection.java:293)
at test2.Main.main(Main.java:48)
at org.firebirdsql.gds.GDSException: Dynamic SQL Error
SQL error code = -804
Data type unknown
at org.firebirdsql.gds.impl.wire.AbstractJavaGDSImpl.readStatusVector(AbstractJavaGDSImpl.java:2124)
at org.firebirdsql.gds.impl.wire.AbstractJavaGDSImpl.receiveResponse(AbstractJavaGDSImpl.java:2074)
at org.firebirdsql.gds.impl.wire.AbstractJavaGDSImpl.iscDsqlPrepare(AbstractJavaGDSImpl.java:1498)
at org.firebirdsql.gds.impl.GDSHelper.prepareStatement(GDSHelper.java:196)
at org.firebirdsql.jdbc.AbstractStatement.prepareFixedStatement(AbstractStatement.java:1129)
at org.firebirdsql.jdbc.AbstractPreparedStatement.prepareFixedStatement(AbstractPreparedStatement.java:1157)
at org.firebirdsql.jdbc.AbstractPreparedStatement.<init>(AbstractPreparedStatement.java:116)
at org.firebirdsql.jdbc.FBPreparedStatement.<init>(FBPreparedStatement.java:41)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at org.firebirdsql.jdbc.FBStatementFactory.createPreparedStatement(FBStatementFactory.java:90)
at org.firebirdsql.jdbc.AbstractConnection.prepareStatement(AbstractConnection.java:869)
at org.firebirdsql.jdbc.AbstractConnection.prepareStatement(AbstractConnection.java:824)
at org.firebirdsql.jdbc.AbstractConnection.prepareStatement(AbstractConnection.java:817)
at org.firebirdsql.jdbc.AbstractConnection.prepareStatement(AbstractConnection.java:293)
at test2.Main.main(Main.java:48)
Java Result: 1
SQL generated by hibernate:
select newstopice0_.id as id13_, newstopice0_.topicName as topicName13_, newstopice0_.deploymentDate as deployme3_13_, newstopice0_.undeploymentDate as undeploy4_13_, newstopice0_.status as status13_ from n$topics newstopice0_ where (? in (select interests1_.interests_id from n$topics_n$interests interests1_ where newstopice0_.id=interests1_.n$topics_id)) and newstopice0_.status=?
Tables DDL:
CREATE TABLE N$INTERESTS(
ID Numeric(18,0) NOT NULL,
GROUPNAME Varchar(255),
PRIMARY KEY (ID)
);
GRANT DELETE, INSERT, REFERENCES, SELECT, UPDATE
ON N$INTERESTS TO SYSDBA WITH GRANT OPTION;
CREATE TABLE N$TOPICS(
ID Numeric(18,0) NOT NULL,
TOPICNAME Varchar(255),
DEPLOYMENTDATE Date,
UNDEPLOYMENTDATE Date,
STATUS Smallint,
PRIMARY KEY (ID)
);
GRANT DELETE, INSERT, REFERENCES, SELECT, UPDATE
ON N$TOPICS TO SYSDBA WITH GRANT OPTION;
CREATE TABLE N$TOPICS_N$INTERESTS(
N$TOPICS_ID Numeric(18,0) NOT NULL,
INTERESTS_ID Numeric(18,0) NOT NULL
);
ALTER TABLE N$TOPICS_N$INTERESTS ADD CONSTRAINT FKD52C732E5DCE65D6
FOREIGN KEY (INTERESTS_ID) REFERENCES N$INTERESTS (ID);
ALTER TABLE N$TOPICS_N$INTERESTS ADD CONSTRAINT FKD52C732EC0D028C
FOREIGN KEY (N$TOPICS_ID) REFERENCES N$TOPICS (ID);
GRANT DELETE, INSERT, REFERENCES, SELECT, UPDATE
ON N$TOPICS_N$INTERESTS TO SYSDBA WITH GRANT OPTION;
The text was updated successfully, but these errors were encountered: