You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by Curtis Ruck <ru...@yahoo.com> on 2011/05/12 23:04:06 UTC

SDB Oracle Support

I just tested setting up SDB with Oracle support and I ran into the below
errors on the Slice 1-6 tests.  It appears that the Slice Tests are using
LIMIT and OFFSET which arn't part of Oracle's SQL as the proper Oracle way
is with a subselect (select * from (select ... from ...) where rownum
between 3 and 200

[jena@oracle SDB-1.3.3]$ bin/sdbtest --sdb=cruck.ttl
testing/Modifiers/manifest.ttl
Test: Slice 1
 WARN [main] (SDBConnection.java:326) - execQuery: SQLException
ORA-00933: SQL command not properly ended

SELECT CASE WHEN LENGTH(R_1.lex) <= 2000 THEN NULL ELSE R_1.lex END V_1_lex,
  CASE WHEN LENGTH(R_1.lex) <= 2000 THEN TO_NCHAR(R_1.lex) ELSE NULL END
 V_1_lexNChar,
  R_1.datatype V_1_datatype, R_1.lang V_1_lang, R_1.type V_1_type,
  CASE WHEN LENGTH(R_1.lex) <= 2000 THEN NULL ELSE R_1.lex END V_2_lex,
  CASE WHEN LENGTH(R_1.lex) <= 2000 THEN TO_NCHAR(R_1.lex) ELSE NULL END
 V_2_lexNChar,
  R_1.datatype V_2_datatype, R_1.lang V_2_lang, R_1.type V_2_type
FROM
    Triples T_1
  LEFT OUTER JOIN
    Nodes R_1
  ON ( T_1.p = R_1.hash )
LIMIT 3


** Error:    Slice 1(com.hp.hpl.jena.sdb.test.junit.QueryTestSDB)
  SQLException in executing SQL statement
com.hp.hpl.jena.sdb.compiler.SDB_QC.exec(SDB_QC.java:72)
Test: Slice 2
** Error:    Slice 2(com.hp.hpl.jena.sdb.test.junit.QueryTestSDB)
  SQLException in executing SQL statement
com.hp.hpl.jena.sdb.compiler.SDB_QC.exec(SDB_QC.java:72)
Test: Slice 3
** Error:    Slice 3(com.hp.hpl.jena.sdb.test.junit.QueryTestSDB)
  SQLException in executing SQL statement
com.hp.hpl.jena.sdb.compiler.SDB_QC.exec(SDB_QC.java:72)
Test: Slice 4
** Error:    Slice 4(com.hp.hpl.jena.sdb.test.junit.QueryTestSDB)
  SQLException in executing SQL statement
com.hp.hpl.jena.sdb.compiler.SDB_QC.exec(SDB_QC.java:72)
Test: Slice 5
** Error:    Slice 5(com.hp.hpl.jena.sdb.test.junit.QueryTestSDB)
  SQLException in executing SQL statement
com.hp.hpl.jena.sdb.compiler.SDB_QC.exec(SDB_QC.java:72)
Test: Slice 6
** Error:    Slice 6(com.hp.hpl.jena.sdb.test.junit.QueryTestSDB)
  SQLException in executing SQL statement
com.hp.hpl.jena.sdb.compiler.SDB_QC.exec(SDB_QC.java:72)
Test: Distinct 1
Test: Distinct 2

===========================================
Tests = 8 : Successes = 2 : Errors = 6 : Failures = 0

Error:    Slice 1(com.hp.hpl.jena.sdb.test.junit.QueryTestSDB): SQLException
in executing SQL statement

Error:    Slice 2(com.hp.hpl.jena.sdb.test.junit.QueryTestSDB): SQLException
in executing SQL statement

Error:    Slice 3(com.hp.hpl.jena.sdb.test.junit.QueryTestSDB): SQLException
in executing SQL statement

Error:    Slice 4(com.hp.hpl.jena.sdb.test.junit.QueryTestSDB): SQLException
in executing SQL statement

Error:    Slice 5(com.hp.hpl.jena.sdb.test.junit.QueryTestSDB): SQLException
in executing SQL statement

Error:    Slice 6(com.hp.hpl.jena.sdb.test.junit.QueryTestSDB): SQLException
in executing SQL statement


--
Curtis Ruck
Anytime: 347-542-7825

Re: SDB Oracle Support

Posted by Curtis Ruck <ru...@yahoo.com>.
I have no issues submitting a patch (and I already started...) but there is
another issue, you can't just do a limit/offset without an ordering...
otherwise you may get varying results depending on which blocks were read
first... but since none of the GenerateSQL classes care about ordering...
implementing it should be fairly easy even with the subselect.

--
Curtis Ruck
Anytime: 347-542-7825


On Fri, May 13, 2011 at 11:54, Andy Seaborne
<an...@epimorphics.com>wrote:

> Temporary: I've turned the feature off for Oracle, while waiting for a fix.
>
> I don't have easy access to an Oracle installation to test anything and
> would need to install Oracle Express or something.
>
> Looking around, the form:
>
> SELECT * from T WHERE ROWNUM <= 10
>
> works, which is LIMIT, and is easy to add to SDB (see
> ...core.sqlnode.GenerateSQLOracle)
>
> The full OFFSET+LIMIT needs a subSELECT -- that's going to be harder.
>
> Contributions welcome - please put patches on the JIRA for Jena at Apache.
>
>        Andy
>
>
>
> On 12/05/11 22:04, Curtis Ruck wrote:
>
>> I just tested setting up SDB with Oracle support and I ran into the below
>> errors on the Slice 1-6 tests.  It appears that the Slice Tests are using
>> LIMIT and OFFSET which arn't part of Oracle's SQL as the proper Oracle way
>> is with a subselect (select * from (select ... from ...) where rownum
>> between 3 and 200
>>
>> [jena@oracle SDB-1.3.3]$ bin/sdbtest --sdb=cruck.ttl
>> testing/Modifiers/manifest.ttl
>> Test: Slice 1
>>  WARN [main] (SDBConnection.java:326) - execQuery: SQLException
>> ORA-00933: SQL command not properly ended
>>
>> SELECT CASE WHEN LENGTH(R_1.lex)<= 2000 THEN NULL ELSE R_1.lex END
>> V_1_lex,
>>   CASE WHEN LENGTH(R_1.lex)<= 2000 THEN TO_NCHAR(R_1.lex) ELSE NULL END
>>  V_1_lexNChar,
>>   R_1.datatype V_1_datatype, R_1.lang V_1_lang, R_1.type V_1_type,
>>   CASE WHEN LENGTH(R_1.lex)<= 2000 THEN NULL ELSE R_1.lex END V_2_lex,
>>   CASE WHEN LENGTH(R_1.lex)<= 2000 THEN TO_NCHAR(R_1.lex) ELSE NULL END
>>  V_2_lexNChar,
>>   R_1.datatype V_2_datatype, R_1.lang V_2_lang, R_1.type V_2_type
>> FROM
>>     Triples T_1
>>   LEFT OUTER JOIN
>>     Nodes R_1
>>   ON ( T_1.p = R_1.hash )
>> LIMIT 3
>>
>>
>> ** Error:    Slice 1(com.hp.hpl.jena.sdb.test.junit.QueryTestSDB)
>>   SQLException in executing SQL statement
>> com.hp.hpl.jena.sdb.compiler.SDB_QC.exec(SDB_QC.java:72)
>> Test: Slice 2
>> ** Error:    Slice 2(com.hp.hpl.jena.sdb.test.junit.QueryTestSDB)
>>   SQLException in executing SQL statement
>> com.hp.hpl.jena.sdb.compiler.SDB_QC.exec(SDB_QC.java:72)
>> Test: Slice 3
>> ** Error:    Slice 3(com.hp.hpl.jena.sdb.test.junit.QueryTestSDB)
>>   SQLException in executing SQL statement
>> com.hp.hpl.jena.sdb.compiler.SDB_QC.exec(SDB_QC.java:72)
>> Test: Slice 4
>> ** Error:    Slice 4(com.hp.hpl.jena.sdb.test.junit.QueryTestSDB)
>>   SQLException in executing SQL statement
>> com.hp.hpl.jena.sdb.compiler.SDB_QC.exec(SDB_QC.java:72)
>> Test: Slice 5
>> ** Error:    Slice 5(com.hp.hpl.jena.sdb.test.junit.QueryTestSDB)
>>   SQLException in executing SQL statement
>> com.hp.hpl.jena.sdb.compiler.SDB_QC.exec(SDB_QC.java:72)
>> Test: Slice 6
>> ** Error:    Slice 6(com.hp.hpl.jena.sdb.test.junit.QueryTestSDB)
>>   SQLException in executing SQL statement
>> com.hp.hpl.jena.sdb.compiler.SDB_QC.exec(SDB_QC.java:72)
>> Test: Distinct 1
>> Test: Distinct 2
>>
>> ===========================================
>> Tests = 8 : Successes = 2 : Errors = 6 : Failures = 0
>>
>> Error:    Slice 1(com.hp.hpl.jena.sdb.test.junit.QueryTestSDB):
>> SQLException
>> in executing SQL statement
>>
>> Error:    Slice 2(com.hp.hpl.jena.sdb.test.junit.QueryTestSDB):
>> SQLException
>> in executing SQL statement
>>
>> Error:    Slice 3(com.hp.hpl.jena.sdb.test.junit.QueryTestSDB):
>> SQLException
>> in executing SQL statement
>>
>> Error:    Slice 4(com.hp.hpl.jena.sdb.test.junit.QueryTestSDB):
>> SQLException
>> in executing SQL statement
>>
>> Error:    Slice 5(com.hp.hpl.jena.sdb.test.junit.QueryTestSDB):
>> SQLException
>> in executing SQL statement
>>
>> Error:    Slice 6(com.hp.hpl.jena.sdb.test.junit.QueryTestSDB):
>> SQLException
>> in executing SQL statement
>>
>>
>> --
>> Curtis Ruck
>> Anytime: 347-542-7825
>>
>>

Re: SDB Oracle Support

Posted by Andy Seaborne <an...@epimorphics.com>.
Temporary: I've turned the feature off for Oracle, while waiting for a 
fix.

I don't have easy access to an Oracle installation to test anything and 
would need to install Oracle Express or something.

Looking around, the form:

SELECT * from T WHERE ROWNUM <= 10

works, which is LIMIT, and is easy to add to SDB (see 
...core.sqlnode.GenerateSQLOracle)

The full OFFSET+LIMIT needs a subSELECT -- that's going to be harder.

Contributions welcome - please put patches on the JIRA for Jena at Apache.

	Andy


On 12/05/11 22:04, Curtis Ruck wrote:
> I just tested setting up SDB with Oracle support and I ran into the below
> errors on the Slice 1-6 tests.  It appears that the Slice Tests are using
> LIMIT and OFFSET which arn't part of Oracle's SQL as the proper Oracle way
> is with a subselect (select * from (select ... from ...) where rownum
> between 3 and 200
>
> [jena@oracle SDB-1.3.3]$ bin/sdbtest --sdb=cruck.ttl
> testing/Modifiers/manifest.ttl
> Test: Slice 1
>   WARN [main] (SDBConnection.java:326) - execQuery: SQLException
> ORA-00933: SQL command not properly ended
>
> SELECT CASE WHEN LENGTH(R_1.lex)<= 2000 THEN NULL ELSE R_1.lex END V_1_lex,
>    CASE WHEN LENGTH(R_1.lex)<= 2000 THEN TO_NCHAR(R_1.lex) ELSE NULL END
>   V_1_lexNChar,
>    R_1.datatype V_1_datatype, R_1.lang V_1_lang, R_1.type V_1_type,
>    CASE WHEN LENGTH(R_1.lex)<= 2000 THEN NULL ELSE R_1.lex END V_2_lex,
>    CASE WHEN LENGTH(R_1.lex)<= 2000 THEN TO_NCHAR(R_1.lex) ELSE NULL END
>   V_2_lexNChar,
>    R_1.datatype V_2_datatype, R_1.lang V_2_lang, R_1.type V_2_type
> FROM
>      Triples T_1
>    LEFT OUTER JOIN
>      Nodes R_1
>    ON ( T_1.p = R_1.hash )
> LIMIT 3
>
>
> ** Error:    Slice 1(com.hp.hpl.jena.sdb.test.junit.QueryTestSDB)
>    SQLException in executing SQL statement
> com.hp.hpl.jena.sdb.compiler.SDB_QC.exec(SDB_QC.java:72)
> Test: Slice 2
> ** Error:    Slice 2(com.hp.hpl.jena.sdb.test.junit.QueryTestSDB)
>    SQLException in executing SQL statement
> com.hp.hpl.jena.sdb.compiler.SDB_QC.exec(SDB_QC.java:72)
> Test: Slice 3
> ** Error:    Slice 3(com.hp.hpl.jena.sdb.test.junit.QueryTestSDB)
>    SQLException in executing SQL statement
> com.hp.hpl.jena.sdb.compiler.SDB_QC.exec(SDB_QC.java:72)
> Test: Slice 4
> ** Error:    Slice 4(com.hp.hpl.jena.sdb.test.junit.QueryTestSDB)
>    SQLException in executing SQL statement
> com.hp.hpl.jena.sdb.compiler.SDB_QC.exec(SDB_QC.java:72)
> Test: Slice 5
> ** Error:    Slice 5(com.hp.hpl.jena.sdb.test.junit.QueryTestSDB)
>    SQLException in executing SQL statement
> com.hp.hpl.jena.sdb.compiler.SDB_QC.exec(SDB_QC.java:72)
> Test: Slice 6
> ** Error:    Slice 6(com.hp.hpl.jena.sdb.test.junit.QueryTestSDB)
>    SQLException in executing SQL statement
> com.hp.hpl.jena.sdb.compiler.SDB_QC.exec(SDB_QC.java:72)
> Test: Distinct 1
> Test: Distinct 2
>
> ===========================================
> Tests = 8 : Successes = 2 : Errors = 6 : Failures = 0
>
> Error:    Slice 1(com.hp.hpl.jena.sdb.test.junit.QueryTestSDB): SQLException
> in executing SQL statement
>
> Error:    Slice 2(com.hp.hpl.jena.sdb.test.junit.QueryTestSDB): SQLException
> in executing SQL statement
>
> Error:    Slice 3(com.hp.hpl.jena.sdb.test.junit.QueryTestSDB): SQLException
> in executing SQL statement
>
> Error:    Slice 4(com.hp.hpl.jena.sdb.test.junit.QueryTestSDB): SQLException
> in executing SQL statement
>
> Error:    Slice 5(com.hp.hpl.jena.sdb.test.junit.QueryTestSDB): SQLException
> in executing SQL statement
>
> Error:    Slice 6(com.hp.hpl.jena.sdb.test.junit.QueryTestSDB): SQLException
> in executing SQL statement
>
>
> --
> Curtis Ruck
> Anytime: 347-542-7825
>