EclipseLink Test suite and Ingres [message #381667] |
Mon, 29 September 2008 20:33  |
Eclipse User |
|
|
|
Hi,
Running eclipselink foundation SRG tests against Ingres results in the
following syntax error. I was wondering how to tell the EclipseLink
framework that keywords such as CASCADE or RESTRICT must be followed by
the ALTER TABLE statement for Ingres. i.e for example:
ALTER TABLE SALARY DROP CONSTRAINT FK_SALARY_EMP_ID CASCADE
Which DatabasePlatform interface method need to be implemented in
IngresPlatform.java so that EclipseLink framework knows that these
keywords need to be used with Ingres for the ALTER TABLE DML statement? OR
is there any other configuration that I am missing?
Eclipselink foundation core tests (ant test-core) seems to have run
succesfully.
Any pointers appreciated.
Regards,
Usha
snippet from test-results.xml:
Call: ALTER TABLE SALARY DROP CONSTRAINT FK_SALARY_EMP_ID
Query: DataModifyQuery()
[EL Warning]: 2008.09.29
19:35:04.143--DatabaseSessionImpl(1377187)--Exception [EclipseLink-4002]
(Eclipse Persistence Services - 1.0 (Build SNAPSHOT-20080929)):
org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: com.ingres.gcf.util.SqlEx: line 1, Syntax error on
'EOF'. The correct syntax is:
ALTER TABLE tablename
ADD [CONSTRAINT constraint_name] constraint_clause
| DROP CONSTRAINT constraint_name RESTRICT | CASCADE
| ADD [COLUMN] columnname format [default_clause] [null_clause]
[column_constraint]
| DROP [COLUMN] column_name RESTRICT | CASCADE
| ALTER [COLUMN] columnname format [default_clause] [null_clause]
Error Code: 3850
|
|
|
|
Re: EclipseLink Test suite and Ingres [message #381674 is a reply to message #381672] |
Tue, 30 September 2008 20:44   |
Eclipse User |
|
|
|
Thanks James. I think I got this working... But I hit another syntax issue
with reference to Ingres: "For Update NOWAIT" in "select" queries.
Ingres Syntax:
==============
* help sql select\g
Executing . . .
The syntax of a SELECT statement is:
subselect { UNION [ALL] (subselect) }
[ ORDER BY column [ASC|DESC] {, column [ASC|DESC] } ]
where a subselect has the syntax:
SELECT [ALL|DISTINCT] expression [AS column] {,expression [AS
column]}
FROM from_clause
[ WHERE search_condition]
[ GROUP BY column {, column} ]
[ HAVING search_condition ]
and a from_clause has either the syntax:
tablename [corr_name] {, tablename [corr_name] }
or the syntax:
tablename [corr_name] {[INNER | LEFT | RIGHT | FULL] JOIN
tablename [corr_name] ON search_condition}
Note: UNION [ALL] is not supported by Open SQL.
Examples:
select pno, sno from sp;
select x.pno, y.sno from p x, s y
where x.color='red';
select sum(qty), pno
from sp
where sno != 's1'
group by pno;
continue
*
Query recieved by the Ingres JDBC driver from Eclipselink:
===========================================================
Prep[7418]: 'SELECT ADDRESS_ID, CITY, COUNTRY, P_CODE, PROVINCE, STREET
FROM ADDRESS WHERE (ADDRESS_ID = ?) FOR UPDATE OF ADDRESS_ID NOWAIT'
DrvPrep[7420]: preparing statement 'SELECT ADDRESS_ID, CITY, COUNTRY,
P_CODE, PROVINCE, STREET FROM ADDRESS WHERE (ADDRESS_ID = ?) FOR UPDATE OF
ADDRESS_ID NOWAIT'
Msg[0]: begin message QUERY
Msg[0]: sending message QUERY length 151 EOD EOG
Msg[0]: check TL data
Msg[0]: received message ERROR length 122 EOD
DrvPrep[7420]: Received error '42000' 0xa11 -- line 1, Syntax error on
'NOWAIT'.
Ingres-PreparedStatement[7418]: error preparing statement
Exception: 42000, 0xa11
Message: line 1, Syntax error on 'NOWAIT'.
Any pointers on eliminating "NOWAIT", and "FOR UPDATE OF" in "SELECT" for
Ingres is greatly appreciated.
Regards,
Usha
|
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.13709 seconds