Home » Developer & Programmer » Forms » forms built-in : create_record/delete_record
forms built-in : create_record/delete_record [message #83349] Tue, 30 September 2003 01:03 Go to next message
bluebyte
Messages: 25
Registered: September 2003
Junior Member
hi!
hav written the followin code as a part of toolbar package...

PROCEDURE createrecord
IS
BEGIN
GO_BLOCK(':PTSH_NAME_JOINT_NAMES_TEMP');
create_record;
GO_BLOCK(':PTSH_FOLIO_ADDRS_TEMP');
create_record;
END;

my form has 2 blocks as listed above.
when i click on the button (do_key),i get a message
sayin "there's no such block as :ptsh_name_joint_names_temp"...same for the second block also.

* second issue is that....in the first block's properties, i hav set the next data navigation block as the name of second block...
but, even after i hit the tab on last item in first block...the cursor doesnt move to next block..i need to click on the first item of block 2 to input data.
how to fix this?
Re: forms built-in : create_record/delete_record [message #83350 is a reply to message #83349] Tue, 30 September 2003 01:22 Go to previous messageGo to next message
Maaher
Messages: 7065
Registered: December 2001
Senior Member
First issue: get rid of the ":" in your go_block statements.
Second issue: by pressing TAB you are invoking the NEXT_ITEM, not the NEXT_BLOCK. Change the property 'Navigation Style' of the block to 'Change Data Block' or write your own KEY-NEXT-ITEM trigger using code like:
Begin
  If Substr(:SYSTEM.CURSOR_ITEM,INSTR(:SYSTEM.CURSOR_ITEM,'.')+1) = GET_BLOCK_PROPERTY('your_block', LAST_ITEM) Then
    NEXT_BLOCK;
  Else
    NEXT_ITEM;
  End If;
End;
Hth,
MHE
package blues.... [message #83358 is a reply to message #83350] Tue, 30 September 2003 05:32 Go to previous messageGo to next message
bluebyte
Messages: 25
Registered: September 2003
Junior Member
hi!
i have a db package *psa_de* which holds
1.procedure *sp_add_name* - inserts block 1 data into table 1
2.procedure *sp_add_address* - inserts block 2 data into table 2.

i have a toolbar in my template form.when i click save button ,
*key-commit* trigger is fired.this trigger in turn calls
f_pkg_name_de.fp_commit_name_add

f_pkg_name_de is a form package. it holds procedure
fp_commit_name_add. this procedure calls the 2 db SPs...

issue: when i click save, i get an error, "unable to insert record". pls help me fix this...

regards,
ganga
Re: package blues.... [message #83359 is a reply to message #83358] Tue, 30 September 2003 05:44 Go to previous messageGo to next message
Maaher
Messages: 7065
Registered: December 2001
Senior Member
Pressing Shift+F1 right after you received the 'unable to insert record' message will show the Database error message. First look at that.

MHE
Re: package blues.... [message #83362 is a reply to message #83359] Tue, 30 September 2003 07:42 Go to previous messageGo to next message
bluebyte
Messages: 25
Registered: September 2003
Junior Member
hi!
the oracle error was ora-01400 "unable to insert NULL into table 1".
issue: i tested the 2 procedures from sql*plus...with the same data..it works jus fine! the problem is with a not null field *user_id*...
in sqlplus, i gave 'GNG'...it worked..
iam passing same string thro form..but it's not workin...

any ideas??

cheers,
ganga
Re: package blues.... [message #83366 is a reply to message #83362] Tue, 30 September 2003 23:17 Go to previous messageGo to next message
bluebyte
Messages: 25
Registered: September 2003
Junior Member
hi!
the said SP in db package has an INSERT statement like
INSERT INTO tab1 (a,b,c,d) values(p_a,p_b,p_c,p_d);

issue: when i press shift F1 in the form, the db error shows the sql statement as -
INSERT INTO tab1 (a,b,c) values (p_a,p_b,p_c) ;

column *d* & parameter *p_d* are missing!!!

this beats me...i checked out the db package n everything is intact there...

pls reply asap...

thnx,
ganga
Re: package blues.... [message #83369 is a reply to message #83366] Wed, 01 October 2003 00:35 Go to previous messageGo to next message
Maaher
Messages: 7065
Registered: December 2001
Senior Member
You haven't supplied a value for colum *d* in the form. Verify that the item in the form you suspect referring to this column is in fact doing so. Look at the database column property the column reference... . Forms ignores item references that aren't filled (NULL values) so make sure the corresponding item contains indeed a value.

If there's no corresponding item, create it.

MHE
Re: package blues....new issue [message #83370 is a reply to message #83366] Wed, 01 October 2003 01:24 Go to previous messageGo to next message
bluebyte
Messages: 25
Registered: September 2003
Junior Member
hi!
actually the parameter contained a null value..
i fixed it..

but, now a new error is croppin up..

ora-00001 :unique constraint error (pk_table1)

though this is the first record iam insertin into tht
table 1, am gettin this error...

wot's the fix??

kindly reply...
Re: package blues....new issue [message #83371 is a reply to message #83370] Wed, 01 October 2003 02:43 Go to previous messageGo to next message
Maaher
Messages: 7065
Registered: December 2001
Senior Member
Well, Oracle normally doesn't lie...
Look at the table contents and verify that it is the first record you are entering. If the table is really empty, there can't be a primary key violation.

MHE
Re: invalid program unit.... [message #83372 is a reply to message #83371] Wed, 01 October 2003 08:04 Go to previous messageGo to next message
bluebyte
Messages: 25
Registered: September 2003
Junior Member
hi!
when i get into debug mode in forms 5.0,
n try to put a break point within a package,
i get an error *pde-jsx036 invalid program unit*.

so,it's not possible to get to know the values my parameters are passing...

how do i get rid of this error?
Re: invalid program unit.... [message #83378 is a reply to message #83372] Thu, 02 October 2003 01:56 Go to previous message
Maaher
Messages: 7065
Registered: December 2001
Senior Member
Open SQL*Plus and look at the table itself and verify that the table is really empty as you suspect.

Also, you could try with different values.

MHE
Previous Topic: saving olevar to blob datatype
Next Topic: 2 blocks...2 stored procedures..common values.
Goto Forum:
  


Current Time: Fri Apr 26 10:28:20 CDT 2024