Home » Developer & Programmer » Forms » sequences not work in form 6i
sequences not work in form 6i [message #654510] Thu, 04 August 2016 05:36 Go to next message
mfahimaamirgmailcom
Messages: 50
Registered: May 2011
Location: pakistan
Member
dear friend
i create sequences in oracle 12c that work fine in sql developer
but not work in form 6i
i try to create pre-insert trigger at data block level but that create in form module
and not work at data entry
i try to crate at table level but that also not work
please give me idea how i use sequences in form
Re: sequences not work in form 6i [message #654512 is a reply to message #654510] Thu, 04 August 2016 07:34 Go to previous messageGo to next message
John Watson
Messages: 8401
Registered: January 2010
Location: Global Village
Senior Member
I don't work with Forms so I can't comment on most of your post, but this Quote:
i try to crate at table level but that also not work
sounds as though you are trying to create a BEFORE INSERT trigger. Just saying "also not work" does not give any useful information. You need to post your code. Copy/paste what happens when you create and use the trigger, so that readers can see what it is that doesn't work.
Re: sequences not work in form 6i [message #654514 is a reply to message #654512] Thu, 04 August 2016 08:16 Go to previous messageGo to next message
Littlefoot
Messages: 21612
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Certainly, "not working" is less than descriptive. Although it seems that you aren't an active Forum member (regarding number of messages you posted so far), knowing that you use Oracle for at least 5 years means that you should have learnt how to properly ask a question.

Anyway: I don't use Forms 6i and don't have 12c database, but you can try the following: create a (stored) function (the one that is created in the database, not in your form) which returns sequence's next value, such as
create or replace function f_my_seq_nextval 
  return number
is
  retval number;
begin
  select my_seq.nextval 
    into retval
    from dual;

  return retval;
end;
and then use that function in the form, such as
:my_block.seq_item := f_my_seq_nextval;
I believe that it *should* work (based on Forms overall experience).
Re: sequences not work in form 6i [message #654515 is a reply to message #654514] Thu, 04 August 2016 08:21 Go to previous message
cookiemonster
Messages: 13895
Registered: September 2008
Location: Rainy Manchester
Senior Member
If that doesn't work then the OP is doing something weird in the form to stop it.
Previous Topic: HOw to take print on form with multi block?
Next Topic: Forms Button/Trigger
Goto Forum:
  


Current Time: Tue Oct 27 13:56:58 CDT 2020