Copy all data from one BO to another one

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
BLOMASKY
Posts: 1473
Joined: Wed Sep 30, 2015 10:08 pm
Location: Ocala FL

Copy all data from one BO to another one

Post by BLOMASKY »

I am using MSSQL and I have legacy data that I want to bring into Aware so here is my plan:
1) Create a new BO using the persistence External (which will retrieve all of the columns)

2) Create a 2nd BO the same way, then change the Persistance back to AwareIM. Now I have 2 objects with the same structure.

3) use a process to read all of the rows in the external table and insert them into the Aware table.

so, my question is, what is the most efficient syntax (or even the 2nd most efficient one, since I am a NOOB) to do this?

Thanks
Bruce
BenHayat
Posts: 2749
Joined: Thu Dec 23, 2010 5:48 am
Location: Fla, USA
Contact:

Re: Copy all data from one BO to another one

Post by BenHayat »

Bruce, I've put together this PDF, gathered the info from User Guide in one place related to CRUD Actions. It can help you decide what direction to go.
Attachments
Actions in Aware.zip
(228.29 KiB) Downloaded 474 times
customaware
Posts: 2405
Joined: Mon Jul 02, 2012 12:24 am
Location: Ulaanbaatar, Mongolia

Re: Copy all data from one BO to another one

Post by customaware »

BLOMASKY wrote:I am using MSSQL and I have legacy data that I want to bring into Aware so here is my plan:
1) Create a new BO using the persistence External (which will retrieve all of the columns)

2) Create a 2nd BO the same way, then change the Persistance back to AwareIM. Now I have 2 objects with the same structure.

3) use a process to read all of the rows in the external table and insert them into the Aware table.

so, my question is, what is the most efficient syntax (or even the 2nd most efficient one, since I am a NOOB) to do this?

Thanks
Bruce
Hi Bruce,
I would do it a similar way for Item 1 & 2
But, then I would remove the Attributes from the new Aware BO that you no longer need.... such as superfluous keys or indexes that were only there because you needed them in your old environment.

OK.... Legacy BO is called Legacy, New BO is called AwareData

In a process...

FIND ALL Legacy
CREATE AwareData FOR EACH Legacy WITH AwareData.Attribute1=Legacy.AttributeJ, AwareData.Attribute2=Legacy.AttributeK, AwareData.Attribute3=Legacy.AttributeL,etc etc

Leave out any Attributes that are unimportant

It does work..... Just tested it.
Cheers,
Mark
_________________
AwareIM 6.0, 8.7, 8.8, 9.0 , MariaDB, Windows 10, Ubuntu Linux. Theme: Default, Browser: Arc
Upcloud, Obsidian....
Image
BLOMASKY
Posts: 1473
Joined: Wed Sep 30, 2015 10:08 pm
Location: Ocala FL

Re: Copy all data from one BO to another one

Post by BLOMASKY »

1st Ben, thank you, that is very useful.

2nd, Mark, if the attributes have the same name, is there a way to just insert the records and have aware match them?

Bruce
BenHayat
Posts: 2749
Joined: Thu Dec 23, 2010 5:48 am
Location: Fla, USA
Contact:

Re: Copy all data from one BO to another one

Post by BenHayat »

BLOMASKY wrote:1st Ben, thank you, that is very useful.

2nd, Mark, if the attributes have the same name, is there a way to just insert the records and have aware match them?

Bruce
Instead of CREATE, Try DUPLICATE Legacy TO AwareData

I haven't tried it yet, but give it a shot and let us know.
BTW Bruce, not sure you remember me. We used to talk over Magic issues back in late 80's (Magic 2.36, 3.5, 5.x). You were always funny, and had a voice that sounded you had a sinus cold... :D
Good to see you here
BLOMASKY
Posts: 1473
Joined: Wed Sep 30, 2015 10:08 pm
Location: Ocala FL

Re: Copy all data from one BO to another one

Post by BLOMASKY »

it seems like duplicate only works if all of the attributes match. and yes, I do always sound like my nose is stuffed.
Post Reply