|
|
|
|
|
Re: Display All records of my DB in a table [message #573538 is a reply to message #573537] |
Sun, 30 December 2012 11:30 |
|
Littlefoot
Messages: 21818 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
Right; you chose "form" layout, but you should have chosen "tabular" one.
[EDIT]
As this is a very simple form, perhaps the easiest way would be to start over (i.e. delete current form and create a new one). Or, you can set that manually - open data block's Property Palette and set its "Number of records displayed" to a value higher than 1 (which is, I suppose, set now) - for example, set it to 10. Then, select the frame and adjust output if necessary.
[Updated on: Sun, 30 December 2012 11:33] Report message to a moderator
|
|
|
|
|
Re: Display All records of my DB in a table [message #573541 is a reply to message #573539] |
Sun, 30 December 2012 12:50 |
|
Littlefoot
Messages: 21818 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
No, there isn't. At least, a simple one. You can't set number of records in a block during runtime, so just leave it as is.
You could (but I strongly suggest you not to) create multiple form layout blocks, one below the other, populate them one by one so that they look like a tabular block, and then - depending on number of records - hide certain blocks (actually, their items). Another option is to create a stacked canvas; display it and move its position depending on number of records.
Once again: it's not worth it. Empty records are free of charge, you don't have to feed them, they aren't that ugly. Let them be.
|
|
|
|
|
|
Re: Display All records of my DB in a table [message #573554 is a reply to message #573548] |
Mon, 31 December 2012 05:21 |
|
Littlefoot
Messages: 21818 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
I still don't understand that "images" question. Could you illustrate it (using Paint, for example) and attach the image? This time, please, resize the image to display only the important part, not with a huge white background.
As of the "delete" part of the question: here's an example (taken from one of my forms). I hope it'll give you an idea. Generally speaking, alerts have buttons (one (OK), two (Yes, No), three (Yes, No, Cancel)) so - depending on your alert - you have to check which one of them has been pressed and do something.
declare
alertgumb number;
begin
if :obrada.zone_id is null
then
alertgumb := alertf('AATTENTION', 'Zone ID is empty. Is that OK?;
if alertgumb = alert_button1 --> this line!
then
prc_do_something;
else
prc_do_something_else;
end if;
end if;
end;
|
|
|
|
|
|
Re: Display All records of my DB in a table [message #573566 is a reply to message #573565] |
Mon, 31 December 2012 05:51 |
|
Littlefoot
Messages: 21818 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
(There's no RECORD_DELETE; it is DELETE_RECORD - unless you wrote your own procedure whose name is RECORD_DELETE. If so, what did you put in there and - why did you do that? As Cookiemonster told you, Forms does all that for you.)
If it is a data block, then "DELETE_RECORD; COMMIT;" really deletes the record from both data block and database. If you claim different, please, prove it.
As of the image issue: as far as I can tell, you can put 1 image in there at a time. If you want to use another image, the first one won't be visible any more (i.e. will be overwritten by the second one). However: I still think that 2 buttons would easily solve your "problem". You can even put icons onto those buttons, if you wish.
|
|
|
|
|
Re: Display All records of my DB in a table [message #573599 is a reply to message #573590] |
Mon, 31 December 2012 12:06 |
|
Littlefoot
Messages: 21818 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
Well, there's something wrong from the beginning. As soon as you run the form, there's the FRM-40102 error (record must be entered or deleted first), and when you tried to delete a record, Forms removed it from a block but was unable to do that in the database because of FRM-40508 (unable to insert record).
So, how do you get these 3 records in there? If it is a database block, you should have performed EXECUTE_QUERY which would fetch records from the database. If you did that in a loop, Forms thinks that you, actually, inserted new values so when your code came to COMMIT, it tried to insert values that already exist and failed for some reason (for example, unique/primary key violation). In order to find out the reason, when you get the error, go to runtime form's Help menu and choose "Display Error" which will provide some more information. If you don't understand it, please, copy/paste the message over here.
Finally, maybe you should really pay attention to the following:
Cookiemonster
You need to spend some time reading up on how forms works
[EDIT]
The simplest option is usually the best: create a new form. Use data block wizard. Base the block on a table. When the wizard finishes, you have a fully operational form which is capable of selecting existing records, modifying them, deleting them, inserting new records. You don't have to code ANYTHING of that. Perhaps you should first make your form work, then make it fancy.
[Updated on: Mon, 31 December 2012 12:10] Report message to a moderator
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|