Home » Developer & Programmer » Forms » ordering form (10g)
icon9.gif  ordering form [message #457742] Tue, 25 May 2010 16:01 Go to next message
purelove
Messages: 32
Registered: May 2010
Location: bahrain
Member
hello,,,,



i create a form for ordering>>>that the person can enter his/her information and isbn book to make the order,but the order id i make it sequencialy!!
well first of all i create a data-block and i insert only the oid
in trigger when-new-item-instance:
i had create the sequence:
declare
create sequence seq1
start with 90
increment by 10;

end;

and i make a view form such of fields that user can enter a details o what he/she want to order!!


1- is that enough???
2- it sems there is an error in creating the sequence??!! i don't know why!! or mabye this is a wrong way to create the sequence!!!


please help me!!
I have to finish my bookstore project for next tue!!! there is no time,,


god bluss u all!!!
Re: ordering form [message #457745 is a reply to message #457742] Tue, 25 May 2010 16:13 Go to previous messageGo to next message
vamsi kasina
Messages: 2112
Registered: October 2003
Location: Cincinnati, OH
Senior Member
1. Why are you writing that code in when-new-item-instance?
2. Do you want to create that sequence those many times?
Do it as the database level. And use that sequence value in the form code.
Moreover, 'create sequence' is a sql, not pl/sql. No need to put 'declare / being / end' around it.Quote:
it sems there is an error in creating the sequence??!!
Didn't anybody tell you to read Forum Guide before posting till now? Provide the error message.

By
Vamsi
Re: ordering form [message #457747 is a reply to message #457745] Tue, 25 May 2010 16:35 Go to previous messageGo to next message
purelove
Messages: 32
Registered: May 2010
Location: bahrain
Member
i had remove the declare and end!!

the error is:
encountered the symbol "create" ,,!!
is it orrect to put this code just in tigger when new instance
i want as also is made sequencialy when the user wants to make an order in this form!!
did u have any suggetions or somethings to improve or make an advances orderning form!!


thanx for your attention..!!
Re: ordering form [message #457748 is a reply to message #457747] Tue, 25 May 2010 16:39 Go to previous messageGo to next message
purelove
Messages: 32
Registered: May 2010
Location: bahrain
Member
Do it as the database level. And use that sequence value in the form code?!!!!


i create theat sequence in the sql!!!


but how can call it in the trigger when new instance!!!plz help
Re: ordering form [message #457786 is a reply to message #457748] Wed, 26 May 2010 00:46 Go to previous messageGo to next message
purelove
Messages: 32
Registered: May 2010
Location: bahrain
Member
please help me,,,,,
Re: ordering form [message #457793 is a reply to message #457786] Wed, 26 May 2010 00:59 Go to previous messageGo to next message
Littlefoot
Messages: 21818
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Set sequence value into the "Initial value" property of the ID item as
:sequence.seq1.nextval
In that case, you don't even need a trigger.
Re: ordering form [message #457893 is a reply to message #457793] Wed, 26 May 2010 05:13 Go to previous messageGo to next message
lokeshsurana
Messages: 212
Registered: April 2010
Location: India
Senior Member
after creating sequence in sql prompt just firm .nextvalue

and then try to use sequence on trigger pre-insert
Re: ordering form [message #458084 is a reply to message #457893] Thu, 27 May 2010 05:29 Go to previous message
purelove
Messages: 32
Registered: May 2010
Location: bahrain
Member
thank you alote littlefoot it's work Smile Smile Smile
Previous Topic: new code in oracle forms 6i
Next Topic: List Item INDEX
Goto Forum:
  


Current Time: Fri Sep 20 08:21:26 CDT 2024