Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

I don't know how to update value into the table from another table.

Could anyone help me to figure out how to update a value into the table from another table?

As far as I knew, the way I can update is to enable Dynamic Data Update feature in the desktop. So, I already tried on my document. I didn't work on my doc. However, I found some an example file from this excellent QV discussion forum here. It worked on it.  I don't know the reason why the document I created did NOT update anyway.

Below is the example update script I ran. 

UPDATE List60, tbStatus SET List60.Inc_Dec_Flag = tbStatus.CIFStatusLatest

WHERE List60.Cif = tbStatus.Cif;

According to the attached pic below, I wanna replace Inc_Dec_Flag field with CIFStatusLatest field.

10-02-2017 17-21-03 PM.png

Thanks.

5 Replies
vardhancse
Specialist III
Specialist III

Hi,

Why can't you try with ApplyMap().

using that based on some ID field you can get the text/value required.

rahulpawarb
Specialist III
Specialist III

Hello Natthapol,

You can use below given sample code snippet in your script:

//Add this mapping table before the List60 table load statement

Mapping_Flag:

Mapping LOAD

Cif,

CIFStatusLate

Resident tbStatus;

//Replace Inc_Dec_Flag field in List60 table by below code

ApplyMap('Mapping_Flag', Cif) AS Inc_Dec_Flag

Regards!

Rahul

Not applicable
Author

Hi,

I already tried with ApplyMap func. but, it seems like it doesn't work. What I hv done in order is to load data to List60 table first and then do some calculation in tbStatus table by using data from List60 table. That's all.

Thanks

rahulpawarb
Specialist III
Specialist III

If this is the situation then create a table with new Inc_Dec_Flag field and join it with List60 table.

//Table containing new Inc_Dec_Flag field will be joined with List60 table

LEFT JOIN (List60)

NewInc_Dec_Flag: 

LOAD 

Cif, 

CIFStatusLate AS Inc_Dec_Flag

Resident tbStatus;

Hope this will help.

Regards!

Rahul

Not applicable
Author

Hi Rahul,

This is such an interesting approach.

Let me try when im available. then , im gonna let you know how it's going to be.

Thanks