Re: Forms 4.5 problem, pl. help!!!

From: <mlanda_at_vnet.ibm.com>
Date: 1996/06/21
Message-ID: <4qec6g$f02_at_watnews1.watson.ibm.com>#1/1


In <4qdal4$5b6_at_newsbf02.news.aol.com>, nvedula_at_aol.com (NVedula) writes:
>Hi,
>
>Thanx in advance!!
>I have 2 blocks, subject (base table block) and test ( a control block).
>i am working on the where clause of the subject block. The subject block
>has 2 cols: subject_name and subject_id. usually if i do not specify a
>where clause in the properties window of the subject block, i get all
>records when i execute a query. however, what i would like to do is put
>in a where clause such that
>
> subject_id = :test.sub (sub can be a display item or text item in the
>control block, test).
>
> in other words i am basically referencing value of an item in another
>block (it could be control block or base table block). also, i did put in
>a value in the default value property of the "sub" item.
>
>my question is why am i not being able to retreive any records. i get an
>error frm 40350: forms cannot do query.
>
>
>*****Here is an example too to explain better my situation:******
>
>Subject block is like this:
>
>subject_id subject_name
>10 physics
>20 chemistry
>
>The control block "test" has one item only and it is "sub". i put in a
>default value of 20 in its property window.
>
>Now, without a where clause, i get both records. however, lets say i want
>only the 20.
>so i put in a where clause and state
>WHERE subject_id = :test.sub -- i am referencing an item in a block;
>
>so, the query should be executed like this right?
>WHERE subject_id = 20;
>
>well it does not work. i need to do this cause i will learn referncing
>items in other blocks etc.
>
>i think i am not storing the value 20 in the sub item properly! but,
>where do i store it?
>
>please help!
>
>thank you for your time!!

If I understand your problem correctly...one way to accomplish what you are after is to create a pre-query trigger on your subject block and assign test.sub to subject_id. For example:

   subject_id = :test.sub;

Then execute the query using execute_query in a when-button-pushed trigger from your test block. For example:

  go_field('subject_Id');
  execute_query;

M.Landa Received on Fri Jun 21 1996 - 00:00:00 CEST

Original text of this message