Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ROWID FOR UPDATE

Status
Not open for further replies.

alexdbora

Programmer
Oct 25, 2004
25
0
0
RO
Hi!
Here is my problem.
I work in Developer Forms6.0
When I make UPDATE for a record, I want to use for it ROWID.

EXAMPLE:
I have one block named bloc1.
I'm using LOV to get the record that I need to change.
After that, I put the rowid for this record into block item named bloc1.item1;
For example,bloc1.item1 contain this value AAAPE9AAOAAJhLJAAC

Until this point everything is OK.

After that my command is :

UPDATE table1 SET col1=value1 WHERE table1.rowid=bloc1.item1;
commit;

My problem is - after this command my changes will appears in two records not in only one!

I know that ROIWD is character.
If I type,for example,
UPDATE table1 SET col1=value1 WHERE table1.rowid='AAAPE9AAOAAJhLJAAC'; it works.

So,I think I need something to get bloc1.item1 in form like this
'AAAPE9AAOAAJhLJAAC' , meaning with apostrophes.

How can I do this?
I've tried with
UPDATE table1 SET col1=value1 WHERE table1.rowid='''||bloc1.item1||''';
but it didn't work.
I tried to use
to_number(table1.rowid)=to_number(bloc1.item1),but it didn't work ,not at all.

So,if somebody can help me,I will thank a lot.




 
Are you giving us the whole picture? How are you setting up the data in your blocks? Are you querying back some records, then perhaps updating the current on display as well as the one pointed to by your ROWID?

What triggers have you placed your code in?
 
I was setting up the data with "Query Data Source Name " property for my block with my table name(table1).
In when-new-form-instance I write
go_block('bloc1');
execute_query;

From a LOV i'm getting a record and display it.
After that I need to UPDATE it(with when-button-pressed trigger)
For this,I'm getting this record ROWID and try to use it for update.
But,like I said,the update command is made on 2 records.




 
Well,I rezolved my problem.
The LOV(with his query) that I used in my form and populating my block with EXECUTE_QUERY command (block which was made with WIZARD), these things have doubled my UPDATE .
Somewhere the query didn't work great.
So I made my block mannually and it works with my LOV and with ROWID.
Anyway,thanks for your support.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top