I am closing this as invalid.
I am not sure what version of oracle you are looking at, but with 10g,
I get this with both sql*plus and SQL Developer:
== sql*plus ==
SQL> select ids.nextval() from dual;
select ids.nextval() from dual
*
ERROR at line 1:
ORA-02287: sequence number not allowed here
SQL> select ids.nextval from dual;
NEXTVAL
----------
8858411
SQL>
== SQL Developer ===
Error starting at line 1 in command:
select ids.nextval() from dual
Error at Command Line:1 Column:11
Error report:
SQL Error: ORA-02287: sequence number not allowed here
NEXTVAL
----------------------
8858412
1 rows selected
===
Seems like it is behaving as expected to me.
Larry
On 3/23/07, Nathan Maves <[EMAIL PROTECTED]> wrote:
really not sure that this is a bug. I have never seen anyone ever try to
use () after a NEXTVAL.
In fact just a did a search on oracles forums and I did not find anything.
On 3/22/07, Anaximandro de Godinho (JIRA) <[email protected]>
wrote:
> <selectKey> reporting error using a valid JDBC expression in Oracle
>
-------------------------------------------------------------------
>
> Key: IBATIS-410
> URL:
https://issues.apache.org/jira/browse/IBATIS-410
> Project: iBatis for Java
> Issue Type: Bug
> Affects Versions: 2.3.0
> Environment: Oracle 10g, OC4J 10.1.3.0, eclipse 3.2.2
> Reporter: Anaximandro de Godinho
>
>
> Hi guys, I got one exception using a valid JDBC expression, see below:
>
> <insert id="incluir_Projeto" parameterClass="ProjetoTO">
> <selectKey type="pre" resultClass="Integer"
keyProperty="idProjeto">
> SELECT
${DBALIAS}.FVGPROJT_SEQ.NextVal() AS ID FROM DUAL
> </selectKey>
> INSERT
> INTO ${DBALIAS}.FVGPROJT(
> FVGIDPRO,
> FVGIDMOD,
> FVGIDPRF,
> FVGNMPRO
> ) VALUES (
> #idProjeto#,
> #idModelo#,
> #idProjetoPai#,
> #nomeProjeto#
> )
> </insert>
>
> If you try to use "SELECT MySCHEMA.FVGPROJT_SEQ.NextVal() FROM DUAL" with
jdbc it works fine (FVGPROJT_SEQ is a oracle sequence).
>
> I just removed the () at the end of the NEXTVAL function and it worked,
but, IMO, since this is a valid JDBC and NextVal is a function (not a
keywork) this is a bug.
>
> Woody
>
>
> --
> This message is automatically generated by JIRA.
> -
> You can reply to this email to add a comment to the issue online.
>
>