Oracle Sequences [message #663084] |
Mon, 22 May 2017 03:01 |
|
mbudzi2017
Messages: 6 Registered: May 2017
|
Junior Member |
|
|
I am facing a challenge with oracle sequences. Seq created ok, created public synonym for it. I am failing to access the sequence Oracle forms. But if I run the same in PL/Sql it is working fine under the same user.
Pl/Sql
SQL> SELECT SEQ.NEXTVAL FROM DUAL;
NEXTVAL
---------
3780508
In forms I am getting identifier 'SEQ.NEXTVAL' must be declared.
Please help
|
|
|
Re: Oracle Sequences [message #663086 is a reply to message #663084] |
Mon, 22 May 2017 04:38 |
cookiemonster
Messages: 13925 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
If it's really the same user then that's probably a forms bug. Create a function in the DB that returns seq.nextval, call that from the form.
And PL/SQL is a language, not a program. Do you mean sqlplus, or pl/sql developer?
|
|
|
|
Re: Oracle Sequences [message #663089 is a reply to message #663087] |
Mon, 22 May 2017 06:07 |
Bill B
Messages: 1971 Registered: December 2004
|
Senior Member |
|
|
Is the sequence in a different schema then the application is running in? If it is your have to explicitly grant select on the sequence. For example if the sequence is created under the DATA schema and is called MY_SEQ and the application is running under the APPS schema then in the DATA schema you must run the following command
grant execute on MY_SEQ to APPS;
|
|
|
|
Re: Oracle Sequences [message #663096 is a reply to message #663095] |
Mon, 22 May 2017 07:27 |
Bill B
Messages: 1971 Registered: December 2004
|
Senior Member |
|
|
You have not setup a public synonym. You may have issued the command but the schema must have the priviledge to create a public synonym. To see if it is setup then issue the following command in sqlplus as the USER account
select owner,object_type
FROM all_objects
where object_name = 'SEQ' ;
you should see the synonym belonging to the PUBLIC user. IF you don't then there is no public synonym.
|
|
|
|
|
|
Re: Oracle Sequences [message #663106 is a reply to message #663104] |
Mon, 22 May 2017 07:44 |
Bill B
Messages: 1971 Registered: December 2004
|
Senior Member |
|
|
This is weird. One more thing to try. In the USER schema issue the following command
create synonym EMP for TEST.EMP;
This avoids the public synonym and still stops you needing to hard code the other schema.
|
|
|
|
|