Home » Developer & Programmer » Forms » i need help
i need help [message #503013] Tue, 12 April 2011 05:25 Go to next message
rania_saleh
Messages: 16
Registered: April 2011
Location: Egypt
Junior Member
I'm doing a "Purchasing" database :

First form: "Supplier information" ,it contains a list of all suppliers when i choose one supplier(EX. supplier1) it shows all information about (supplier1)
it also contains a button called (ORDERS) .. i need a trigger on button orders as when i pressed the button it calls the "second form" which contains a list of all orders but only the orders of (supplier1) .. how can i do this ???

i tried this trigger but it didnt work :


if :PACKAGE_SUP.SUP_NO is not null then
go_block('package_qu');
set_block_property('package_qu',default_where,'qsup_no=:package_sup.sup_no');
execute_query;
end if;

also i tried to use global variable but it didnt work too..

i think there is a problem in primary key and foriegn key because i couldnt build a relation between the two blocks .. i get the error ("FRM-15004 Error while parsing join condition" )
but i cant solve it..
i dont know what to do any more and its emergency


how to maximize the forms in the runtime to be suitable for any resolution ??


my mail is (rania_saleh88@live.com)
for any question please send me email..
i need help quickly please ..
  • Attachment: SQL 2.txt
    (Size: 6.70KB, Downloaded 1465 times)
Re: i need help [message #503015 is a reply to message #503013] Tue, 12 April 2011 05:36 Go to previous messageGo to next message
Littlefoot
Messages: 21818
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
There are two forms, right? Not one form with two blocks?
But, the second form (the one that is supposed to display orders contains two blocks? At least, that's what I understood from your "primary/foreign key & relation between blocks" sentence.

What is :PACKAGE_SU.SUP_NO? Where does it get its value from? The second form doesn't know its value, unless you passed it from the first form (either by a parameter, or by a global variable).

Which Forms version do you use? If 10g, run the form in debug mode in order to trace its execution - it would show all items, parameters and system variables' values. If 6i, include MESSAGE statements if you want to see what's going on.
Re: i need help [message #503016 is a reply to message #503013] Tue, 12 April 2011 05:42 Go to previous messageGo to next message
cookiemonster
Messages: 13938
Registered: September 2008
Location: Rainy Manchester
Senior Member
Does qu_package not have a primary key?
What exactly did you do to try and create the relationship between the blocks?
How many forms are actually involved here? You mention two but your description of what you are doing implies one.
When you say the trigger didn't work what do you mean? Did you get an error? The wrong data? what?
Re: i need help [message #503018 is a reply to message #503015] Tue, 12 April 2011 05:50 Go to previous messageGo to next message
rania_saleh
Messages: 16
Registered: April 2011
Location: Egypt
Junior Member
i have one form it contains all the blocks of the program.
i attached the fmb file and the sql file.
the primary/foriegn key & realtion problem ,it between the supplier form and the order form.
In my program , there are two types of suppliers (package supplier & raw supplier) each one has a its block and has its orders and quotation blocks.
package_sup . sup_no >> it refers to the package supplier block and its primary key is (sup_no).
i hope u get it now after u see the fmb file and the sql file.
I'm working on 11G version.
  • Attachment: LOGIN.fmb
    (Size: 1.36MB, Downloaded 1099 times)
Re: i need help [message #503021 is a reply to message #503018] Tue, 12 April 2011 05:56 Go to previous messageGo to next message
rania_saleh
Messages: 16
Registered: April 2011
Location: Egypt
Junior Member
No qu_package doesnt have aprimary key ,it has a foriegn key references to package_sup.
I try to creat relation between the blocks by add realtion from the navigator and when i write the join condition i get error ("FRM-15004 Error while parsing join condition" )
i have one form contains all the blocks as i disscussed before ..
Re: i need help [message #503022 is a reply to message #503016] Tue, 12 April 2011 06:01 Go to previous messageGo to next message
cookiemonster
Messages: 13938
Registered: September 2008
Location: Rainy Manchester
Senior Member
rania_saleh wrote on Tue, 12 April 2011 11:50

the primary/foriegn key & realtion problem ,it between the supplier form and the order form.

Will you stop using the word form to describe things that aren't forms - you mean blocks here I believe.

rania_saleh wrote on Tue, 12 April 2011 11:56
I try to creat relation between the blocks by add realtion from the navigator and when i write the join condition i get error ("FRM-15004 Error while parsing join condition" )

And what exactly did you put in the join condition?

You still haven't answered this question:
cookiemonster wrote on Tue, 12 April 2011 11:42

When you say the trigger didn't work what do you mean? Did you get an error? The wrong data? what?

Re: i need help [message #503024 is a reply to message #503022] Tue, 12 April 2011 06:28 Go to previous messageGo to next message
rania_saleh
Messages: 16
Registered: April 2011
Location: Egypt
Junior Member
yes , i mean blocks , sorry for that.
I put (sup_no=osup_no) in the join condition when the Master block is (package_sup) and the detail block is (package_or).
It didnt work as i wish,i didnt get errors,it just didnt work in the runtime(when i press orders button the next form appears all orders not just order for supplier1 as in Example)
i hope i could answer all your questions :)Smile
Re: i need help [message #503027 is a reply to message #503024] Tue, 12 April 2011 07:07 Go to previous messageGo to next message
kame
Messages: 69
Registered: July 2009
Member
I assume you have supplier form single record(no tabular)
Try this
at supplier form when button press

:global.sup_no := :PACKAGE_SUP.SUP_NO;
call_form('Order',no_hide);

at Order Form
in table properties
Under database properties
set where clause as qsup_no = :global.Sup_no
Re: i need help [message #503032 is a reply to message #503024] Tue, 12 April 2011 07:46 Go to previous messageGo to next message
cookiemonster
Messages: 13938
Registered: September 2008
Location: Rainy Manchester
Senior Member
rania_saleh wrote on Tue, 12 April 2011 12:28
I put (sup_no=osup_no) in the join condition when the Master block is (package_sup) and the detail block is (package_or).

Your original post talks about package_qu not package_or. Can we fix one relationship at a time please.

rania_saleh wrote on Tue, 12 April 2011 12:28

It didnt work as i wish,i didnt get errors,it just didnt work in the runtime(when i press orders button the next form appears all orders not just order for supplier1 as in Example)

You're still talking about forms.
I suspect you're looking at the wrong block, since you set the where clause you shouldn't get all records. Use get_block_property(<block_name>, last_query) to find out what query the form issued to the DB.
Re: i need help [message #503163 is a reply to message #503032] Wed, 13 April 2011 05:24 Go to previous messageGo to next message
rania_saleh
Messages: 16
Registered: April 2011
Location: Egypt
Junior Member
i used the global variable ,and the sup_no is shown in the order form
but it doesnt match the orders with the sup_no
and when i add new order it also doesnt match the sup_no
so..the problem is not solved yet
what i have to write in the ADD(when-button-pressed) trigger to connect each sup_no with its orders
not the orders of another sup_no ??



Re: i need help [message #503172 is a reply to message #503163] Wed, 13 April 2011 06:22 Go to previous messageGo to next message
cookiemonster
Messages: 13938
Registered: September 2008
Location: Rainy Manchester
Senior Member
How about trying to fix the relationship between the blocks. Have you tried using the datablock wizard to create the relationship?
Re: i need help [message #503174 is a reply to message #503172] Wed, 13 April 2011 06:25 Go to previous messageGo to next message
rania_saleh
Messages: 16
Registered: April 2011
Location: Egypt
Junior Member
yes , i tried this but i get the ("FRM-15004 Error while parsing join condition" )
and i dont know if i have a problem with the tables in the first way or what ??
u saw my sql file ??
do u see any problem with it ??
Re: i need help [message #503176 is a reply to message #503174] Wed, 13 April 2011 06:39 Go to previous messageGo to next message
cookiemonster
Messages: 13938
Registered: September 2008
Location: Rainy Manchester
Senior Member
Can't see a problem with the sql file.
And if I create your tables and then create blocks based on them I can create the relationship just fine.
So what are you doing?
/forum/fa/8881/0/
/forum/fa/8882/0/
Re: i need help [message #503178 is a reply to message #503176] Wed, 13 April 2011 06:46 Go to previous messageGo to next message
rania_saleh
Messages: 16
Registered: April 2011
Location: Egypt
Junior Member
Aha .. i can do this ,but after i create the realtion ..

Will The ((i used the global variable ,and the sup_no is shown in the order form
but it doesnt match the orders with the sup_no
and when i add new order it also doesnt match the sup_no
so..the problem is not solved yet
what i have to write in the ADD(when-button-pressed) trigger to connect each sup_no with its orders
not the orders of another sup_no ??
))
problem be solved ???
Re: i need help [message #503179 is a reply to message #503178] Wed, 13 April 2011 06:48 Go to previous messageGo to next message
rania_saleh
Messages: 16
Registered: April 2011
Location: Egypt
Junior Member
i'm sorry but this is my biggest problem for now
Re: i need help [message #503180 is a reply to message #503179] Wed, 13 April 2011 06:52 Go to previous messageGo to next message
cookiemonster
Messages: 13938
Registered: September 2008
Location: Rainy Manchester
Senior Member
With a relationship in place you shouldn't need any global variables.
Re: i need help [message #503182 is a reply to message #503180] Wed, 13 April 2011 06:55 Go to previous messageGo to next message
rania_saleh
Messages: 16
Registered: April 2011
Location: Egypt
Junior Member
what about the triggers i should write on (ADD NEW ORDER)button to make me able to add new order which matches the sup_no i choose in the first form??
this is after i fix the relationship ..
Re: i need help [message #503183 is a reply to message #503182] Wed, 13 April 2011 07:07 Go to previous messageGo to next message
cookiemonster
Messages: 13938
Registered: September 2008
Location: Rainy Manchester
Senior Member
The relationship should take care of that as well.
Re: i need help [message #503315 is a reply to message #503183] Thu, 14 April 2011 05:48 Go to previous messageGo to next message
rania_saleh
Messages: 16
Registered: April 2011
Location: Egypt
Junior Member
ON-CHECK-DELETE-MASTER TRIGGER

CURSOR QU_PACKAGE_cur IS
SELECT 1 FROM QU_PACKAGE Q
WHERE Q.QSUP_NO = (SELECT REF(P) FROM PACKAGE_SUP P WHERE rowid = :PACKAGE_SUP.rowid);


i get that error (non-object-table"p"illegal in this context)&(sql statement ignored)

why i get that error ??
Re: i need help [message #503316 is a reply to message #503315] Thu, 14 April 2011 06:14 Go to previous messageGo to next message
cookiemonster
Messages: 13938
Registered: September 2008
Location: Rainy Manchester
Senior Member
Have you modified that trigger in anyway?
Re: i need help [message #503317 is a reply to message #503316] Thu, 14 April 2011 06:17 Go to previous messageGo to next message
rania_saleh
Messages: 16
Registered: April 2011
Location: Egypt
Junior Member
NO , I Didnt
Re: i need help [message #503319 is a reply to message #503317] Thu, 14 April 2011 06:46 Go to previous messageGo to next message
cookiemonster
Messages: 13938
Registered: September 2008
Location: Rainy Manchester
Senior Member
When I do it my cursor looks like this:
CURSOR QU_PACKAGE_cur IS      
    SELECT 1 FROM QU_PACKAGE Q     
    WHERE Q.QSUP_NO = :PACKAGE_SUP.SUP_NO;


What are the Database Data Block, Query Data Source Name and Query Data Source Type properties of the two blocks set to?
Re: i need help [message #503320 is a reply to message #503319] Thu, 14 April 2011 07:58 Go to previous messageGo to next message
rania_saleh
Messages: 16
Registered: April 2011
Location: Egypt
Junior Member
Package_sup :
Database Data Block = YES
Query Data Source Name= Package_sup
Query Data Source Type= Table
Qu_package:
Database Data Block = YES
Query Data Source Name = Qu_package
Query Data Source Type= Table


Re: i need help [message #503321 is a reply to message #503320] Thu, 14 April 2011 08:00 Go to previous messageGo to next message
rania_saleh
Messages: 16
Registered: April 2011
Location: Egypt
Junior Member
when i write your trigger it works ..
Thank u Smile Smile
Re: i need help [message #503519 is a reply to message #503321] Sun, 17 April 2011 05:01 Go to previous messageGo to next message
rania_saleh
Messages: 16
Registered: April 2011
Location: Egypt
Junior Member
i fixed the relation and i wrote that trigger in the button (ORDERS):

if :PACKAGE_SUP.SUP_NO is not null then
go_block('OR_PACKAGE');
set_block_property('OR_PACKAGE',default_where,'osup_no='||:package_sup.sup_no);
execute_query;
end if;


but when i pressed the button the new form appears all the orders not only the orders of the supplier i choose
and the same problem with (ADD NEW ORDER) button which should add order to the supplier i choose
that means that i still have the same problem ,,what to do next ???
Re: i need help [message #503521 is a reply to message #503519] Sun, 17 April 2011 05:41 Go to previous messageGo to next message
cookiemonster
Messages: 13938
Registered: September 2008
Location: Rainy Manchester
Senior Member
rania_saleh wrote on Sun, 17 April 2011 11:01

but when i pressed the button the new form appears

A block is not a form. Repeat that to yourself until it sinks in.
Cause if you don't you're going to confuse a lot of people when asking questions on forums.

If you've a got a relationship set up properly between the two blocks then you don't need to set the where clause.
So I can only assume the relationship isn't set up properly.
Re: i need help [message #504560 is a reply to message #503521] Tue, 26 April 2011 10:07 Go to previous message
rania_saleh
Messages: 16
Registered: April 2011
Location: Egypt
Junior Member
Thanks alot..

i solved my problem .

but i need some documents which discuss how to do reports , i f u can help me with this i'll be very pleasant

Thank you so so much Smile



Regards,



Rania

Previous Topic: WEBUTIL_HOST.HOST
Next Topic: Help to use nested name_in function in oracle forms 6i
Goto Forum:
  


Current Time: Tue Sep 17 03:11:19 CDT 2024