Skip to content
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

Closed
firebird-automations opened this issue Jan 9, 2007 · 9 comments

Comments

@firebird-automations
Copy link

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;

@firebird-automations
Copy link
Author

Modified by: Roman Rokytskyy (rrokytskyy)

Fix Version: Jaybird 2.2 [ 10053 ]

@firebird-automations
Copy link
Author

Modified by: Roman Rokytskyy (rrokytskyy)

Fix Version: Jaybird 2.2 [ 10053 ] =>

@firebird-automations
Copy link
Author

Modified by: @dyemanov

Link: This issue relate to CORE2697 [ CORE2697 ]

@firebird-automations
Copy link
Author

Modified by: @mrotteveel

Link: This issue depends on CORE3842 [ CORE3842 ]

@firebird-automations
Copy link
Author

Modified by: @mrotteveel

Link: This issue depends on CORE3842 [ CORE3842 ] =>

@firebird-automations
Copy link
Author

Modified by: @mrotteveel

Link: This issue is related to CORE3842 [ CORE3842 ]

@firebird-automations
Copy link
Author

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=?).

@firebird-automations
Copy link
Author

Commented by: @mrotteveel

Marked as won't fix, as this can't be fixed in Jaybird itself.

@firebird-automations
Copy link
Author

Modified by: @mrotteveel

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Won't Fix [ 2 ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant