how to query new inserted record [message #160514] |
Mon, 27 February 2006 01:25 |
juicyapple
Messages: 92 Registered: October 2005
|
Member |
|
|
I created a form which read data in text file and insert to database. After insert the new record, I would like to show it on the form automatically without user query it.
the codes like below,
/* inserting data here */
go_block('block1');
:block1.ID := <new inserted id>;
execute_query;
hide_window('block2');
The code doesn't work, please give some comment, which is wrong here?
Thanks.
|
|
|
|
|
|
Re: how to query new inserted record [message #160671 is a reply to message #160514] |
Tue, 28 February 2006 00:21 |
|
djmartin
Messages: 10181 Registered: March 2005 Location: Surges Bay TAS Australia
|
Senior Member Account Moderator |
|
|
Please supply more code. If you are reading a file then you must have a loop. Unless you want a message 'Do you want to save your data?' then I suggest issuing a 'commit' before doing the execute_query.
By the way, in what way is the code not working? What are you seeing?
David
Upd: spelling.
[Updated on: Tue, 28 February 2006 20:04] Report message to a moderator
|
|
|
Re: how to query new inserted record [message #160675 is a reply to message #160671] |
Tue, 28 February 2006 00:40 |
juicyapple
Messages: 92 Registered: October 2005
|
Member |
|
|
Thanks for your reply.
I briefly describe my code..
There are two data block, blockA and blockB.
In blockB, when-button-pressed trigger is raised,
program will begin with
1.open text file
2.get text line
3.insert data to tableA
4.commit
5.go_block('blockA')
6.blockB.Id := <new Id>
6.execute_query
7.hide_window('canvas_blockB')
8.end
Sorry if my description is not clear..
Hope to hear your ideas.
|
|
|
|
|
Re: how to query new inserted record [message #161530 is a reply to message #161258] |
Sun, 05 March 2006 23:22 |
|
djmartin
Messages: 10181 Registered: March 2005 Location: Surges Bay TAS Australia
|
Senior Member Account Moderator |
|
|
What message are you getting? What does not work? Is the data not in the data base? If you want to search for the new data then do an enter_query, assign the data to :blockB.id, then do the execute_query. Alternatively, use set_block_property ('blockB', default_query,'you work out the string'); then do the execute_query.
David
|
|
|