Home » Developer & Programmer » Forms » passing parameters...
passing parameters... [message #83382] Thu, 02 October 2003 23:09 Go to next message
bluebyte
Messages: 25
Registered: September 2003
Junior Member
hi!
block1 has items a,b,c,d.i need to insert a,b,c,d into table1.
block2 has items e,f,g. i need to insert a,b,c,e,f,g into table2.

package1 has 2 procedures: sp_add_tab1 & sp_add_tab2.

in the form,this is how iam passing the parameters -

go_block('block1');
sp_add_tab1(
:block1.a,
:block1.b,
:block1.c,
:block1.d);

go_block('block2');
sp_add_tab2(
:block1.a,
:block1.b,
:block1.c,
:block2.e,
:block2.f,
:block2.g);

but, iam gettin an error sayin *unable to insert null into table2.a to which :block1.a is being sent as parameter.

* is it legal to do go_block('block2') & still send a value belonging to :block1??

waitin for ur help...

thnx n regards,
ganga
Re: passing parameters... [message #83383 is a reply to message #83382] Fri, 03 October 2003 01:02 Go to previous messageGo to next message
LT
Messages: 29
Registered: August 2003
Junior Member
Hi

I'm pretty sure that it is illegal what your doing, because you have navigate out of block one. What would be much easier would be....

When you are in the first go_block assign a,b,c & d to variables as well and then when you go to the second block do everything as you were for e,f,g but for a,b,c,d use the values in the variables instead. This way you are not violating any navigational rules.
Re: passing parameters... [message #83386 is a reply to message #83383] Fri, 03 October 2003 01:59 Go to previous messageGo to next message
bluebyte
Messages: 25
Registered: September 2003
Junior Member
hi!
i tried this:

go_block('block1');
copy('block1.a','v_a');
copy('block1.b','v_b');
copy('block1.c','v_c');
sp_add_tab1(
:block1.a,
:block1.b,
:block1.c,
:block1.d):

go_block('block2');
sp_add_tab2(
v_a,
v_b,
v_c,
:block2.e,
:block2.f,
:block2.g);

even this is giving *unable to insert null into tab2.a* error :
server code is running jus fine..i tried out execute sp_add_tab1 & sp_add_tab2 in sql*plus...works.

but the problem seems to be in the form code....

iam surprised coz the scalar variables shud hav no problem in being sent as parameters...

dunno why its not workin..

sumone pls suggest the fix.

thnx again,
ganga
Re: passing parameters... [message #83410 is a reply to message #83382] Sun, 05 October 2003 00:14 Go to previous messageGo to next message
Zain
Messages: 30
Registered: October 2003
Member
go_block is a restricted built-in. This means that you cannot use it freely at all times. However, in your case, it doesn't look like that you must navigate to the actual blocks to reference values.

For example, if you are calling your package from a when-button-pressed trigger, you don't have to use go_block built-in at all. Just call the package as sp_add_tab2(
:block1.a,
:block1.b,
:block1.c,
:block2.e,
:block2.f,
:block2.g);
Re: passing parameters... [message #83411 is a reply to message #83410] Sun, 05 October 2003 03:35 Go to previous messageGo to next message
bluebyte
Messages: 25
Registered: September 2003
Junior Member
hi zain!
i eliminated go_block..
gave a message(:block1.a||:block1.b||:block1.c); jus before calling the package ..to check if iam sending null values...
but the message pop up gives
XX A A -> exactly the desired data...
yet, the ORA-1400 *unable to insert null into table2.a* persists !!

** one more observation:
key-commit trigger code is
f_pkg.fp_send_par_tab1; - - this sends parameters to sp_add_tab1
f_pkg.fp_send_par_tab2; - - this sends parameters to sp_add_tab2

i commented f_pkg.fp_send_par_tab2 ..to check if insert in the table1 is workin or not...
while i call jus sp_add_tab1 ,iam getting the same error
*ora 1400: unable to insert into TABLE2.A *

i havnt even called sp_add_tab2...had called just sp_add_tab1,yet this message appears !!!
cud anyone throw some light on this pls???
Re: passing parameters... [message #83412 is a reply to message #83410] Sun, 05 October 2003 03:37 Go to previous messageGo to next message
bluebyte
Messages: 25
Registered: September 2003
Junior Member
hi zain!
i eliminated go_block..
gave a message(:block1.a||:block1.b||:block1.c); jus before calling the package ..to check if iam sending null values...
but the message pop up gives
XX A A -> exactly the desired data...
yet, the ORA-1400 *unable to insert null into table2.a* persists !!

** one more observation:
key-commit trigger code is
f_pkg.fp_send_par_tab1; - - this sends parameters to sp_add_tab1
f_pkg.fp_send_par_tab2; - - this sends parameters to sp_add_tab2

i commented f_pkg.fp_send_par_tab2 ..to check if insert in the table1 is workin or not...
while i call jus sp_add_tab1 ,iam getting the same error
*ora 1400: unable to insert into TABLE2.A *

i havnt even called sp_add_tab2...had called just sp_add_tab1,yet this message appears !!!

cud anyone throw some light on this pls???
Re: passing parameters... [message #83414 is a reply to message #83411] Sun, 05 October 2003 12:16 Go to previous messageGo to next message
bluebyte
Messages: 25
Registered: September 2003
Junior Member
hi all!
table2 had *not null* columns - a,b,c
i made them nullable.

but, the celestial error *ora-1400:unable to insert null value into table2.a* pops up !!

i suspect there is sumthing wrong with block properties..i checked out to tht effect..nothing tht
i cud find.

*observations:
i had created :block1 & :block2 using data block wizard.then, i deleted the frames surrounding each block (default frame tht the wizard created around items of each block).
i re-arranged the items in 2 blocks for better user friendliness while doin data entry.

can this lead to the error iam gettin??

cud someone pls help me with this??
Re: passing parameters... [message #83433 is a reply to message #83382] Tue, 07 October 2003 11:36 Go to previous message
sameer_am2002
Messages: 129
Registered: September 2002
Senior Member
First of all for inserting values u dont need to send to particular blocks if they are single record blocks.
Ok tell me these blocks are single record or multi record.If possible send me the fmb.I'll fix it and mail u back
Previous Topic: Help for Convert Command Line SQL*Forms Version 2.0.21 to Developer 2000
Next Topic: Automatically changing the language from arabic to english
Goto Forum:
  


Current Time: Wed Apr 24 07:02:18 CDT 2024