Convert a structured array from a m1 to a1 table. (298 Views)
Reply
Frequent Advisor
Shawn Proskin
Posts: 77
Registered: ‎10-11-2007
Message 1 of 2 (298 Views)

Convert a structured array from a m1 to a1 table.

We have SM 9.30 running on SQL 2008.  We have several Structured Array's in several dbdict's that are currently mapped to the sql "m1" table as an "IMAGE".  What we would like to do is to convert the structured array out of the m1 table as an array into an a1 table with distinct fields in SQL.

 

Is there a set procedure for performing such an action? 

 

Thanks in advance,

Shawn

Honored Contributor
Jacob Heubner
Posts: 4,177
Registered: ‎07-21-2008
Message 2 of 2 (285 Views)

Re: Convert a structured array from a m1 to a1 table.

I don't think there's a set procedure. Personally, what I'd do is create a new structured array with your new fields, then mass update the records through the tool, then rename the fields. I don't think it works to simply remap the fields.

 

For example, if you've got:

all.status array IMAGE m1

all.status structure

approval character

desc character

status character

level character

date date/time

 

I'd make a new structured array:

all.status.new array a1

all.status.new structure a1

approval.new character a1

desc.new character a1

status.new character a1

level.new character a1

date.new character a1

 

Then mass update the records using Complex Update like:

all.status.new in $file = all.status in $file

 

then, after that is complete, rename the original fields and add .old to the end, and then rename the .new fields to get rid of the .new

 

I think that's the best way - you don't run the risk of losing your data if something goes wrong.

The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation.