last day (15 days later) » 

10:46 PM
0
Q: java.sql.SQLSyntaxErrorException: ORA-02287: sequence number not allowed here

Peter PenzovI use this SQL query to insert value into Oracle: INSERT INTO SESSIONS (SESSIONID, TYPE, ACTIVITY_START, ACTIVITY_END, ACTIVITY, USERNAME, IP_ADDRESS, LOGIN_TIME, LOGOUT_TIME) select SESSION_ID_SEQ.nextval, null, null, null, ?, ?, ?, sysdate, null FROM SESSIONS having COUNT(*) < 50 This is th...

 
ur insert query is wrong.what u r trying to do?
 
Can you show me how to fix the Insert SQL?
 
what u r trying to do, could u plz tell us?
 
I wan to insert record into table SESSIONS using sequence for generating SESSIONID. But I want to insert record only if the records are below 50 rows.
 
if the records are below 50 rows this part still unclear for me.by the way why SESSIONID is varchar2(30)?
 
10:46 PM
My mistake - it should be integer
hi
 
could plz explain ur requirement in more detail
 
well
I want to fix the SQL query
it was working fine with trigger which calls the sequence
 
basic insert syntax is :INSERT INTO table_name (column1,column2,column3,...)
VALUES (value1,value2,value3,...);
 
correct
but I need also to limit the insert to some value
 
that limit part is not clear to me
 
10:49 PM
me aslo
 
if explain that part i can try to help u
 
I was helped for this part
 
yes, but what u r trying to implement?
 
just to call sequence into the SQL code
 
INSERT INTO SESSIONS (SESSIONID, TYPE, ACTIVITY_START, ACTIVITY_END, ACTIVITY, USERNAME, IP_ADDRESS,
LOGIN_TIME, LOGOUT_TIME) values (SESSION_ID_SEQ.nextval, null, null, null, ?, ?, ?, sysdate, null)
for normal insert it should work if ur specified column names are correct along with the values
 
10:53 PM
ok
 
have u tried this
for more on .nextval u can view this link:techonthenet.com/oracle/sequences.php
r u ok now?
can I leave the chat?
 
ok
thank you
 

last day (15 days later) »