![](/img/trans.png)
[英]Update a custom column of sales_flat_order table after order complete in magento
[英]sas update column order in metadata
我們正在使用proc元數據 (開放元數據接口)從XML更新一些元數據。 使用updatemetadata方法,我們如何實現以下目標:
我們正在使用版本9.3。
提前致謝!
我們找到了一個解決方案:必須分兩個步驟完成。
第一步,必須添加新列。 根據您使用的功能,它將是表元數據中的第一列或最后一列。
在第二步中,您必須對updatemetadata使用function =“ replace”選項,其中列按所需順序排列。
例:
在第一個updatemetadata塊中,將字段TEST_PCT添加到HBR.TEST_7表中。 由於它是使用function =“ replace”添加的,因此它將是表的第一列,而舊列將在此之后。
因此,需要第二個updatemetadata塊並具有正確的列順序,並且由於此時所有列均已存在,因此它將正確地對其重新排序。
<Multiple_Requests>
<UpdateMetadata>
<Metadata>
<PhysicalTable id="A52YJRW0.B30005KO" name="HBR.TEST_7" MemberType="DATA" PublicType="Table" desc="Test_1_Notes á, é, í, ó, ö, ő, ü, ű" sastablename="TEST_7" UsageVersion="1000000">
<Columns function="replace">
<Column objref="A52YJRW0.B80008J0">
<Table>
<PhysicalTable objref="A52YJRW0.B30005KO"/>
</Table>
</Column>
<Column objref="A52YJRW0.B80008J1">
<Table>
<PhysicalTable objref="A52YJRW0.B30005KO"/>
</Table>
</Column>
<Column objref="A52YJRW0.B80008J2">
<Table>
<PhysicalTable objref="A52YJRW0.B30005KO"/>
</Table>
</Column>
<Column objref="A52YJRW0.B80008J3">
<Table>
<PhysicalTable objref="A52YJRW0.B30005KO"/>
</Table>
</Column>
<Column id="$o601" name="TEST_PCT" desc=" " isnullable="1" PublicType="Column" sascolumnlength="8" sascolumnname="TEST_PCT" SASColumnType="N" SASFormat="COMMAX22.2" SASInformat="COMMAX22.2" UsageVersion="1000000">
<Notes>
<TextStore Name="PrivateNote" storedtext=" " TextRole="Note" UsageVersion="0"/>
</Notes>
<Table>
<PhysicalTable objref="A52YJRW0.B30005KO"/>
</Table>
</Column>
<Column objref="A52YJRW0.B80008J5">
<Table>
<PhysicalTable objref="A52YJRW0.B30005KO"/>
</Table>
</Column>
<Column objref="A52YJRW0.B80008J6">
<Table>
<PhysicalTable objref="A52YJRW0.B30005KO"/>
</Table>
</Column>
<Column objref="A52YJRW0.B80008J7">
<Table>
<PhysicalTable objref="A52YJRW0.B30005KO"/>
</Table>
</Column>
<Column objref="A52YJRW0.B80008J8">
<Table>
<PhysicalTable objref="A52YJRW0.B30005KO"/>
</Table>
</Column>
<Column objref="A52YJRW0.B80008J9">
<Table>
<PhysicalTable objref="A52YJRW0.B30005KO"/>
</Table>
</Column>
</Columns>
</PhysicalTable>
</Metadata>
<Reposid>A0000001.A52YJRW0</Reposid>
<Type>PhysicalTable</Type>
<Objects/>
<NS>SAS</NS>
<Flags>268435456</Flags>
</UpdateMetadata>
<UpdateMetadata>
<Metadata>
<PhysicalTable id="A52YJRW0.B30005KO" name="HBR.TEST_7" UsageVersion="1000000">
<Columns function="replace">
<Column objref="A52YJRW0.B80008J0">
<Table>
<PhysicalTable objref="A52YJRW0.B30005KO"/>
</Table>
</Column>
<Column objref="A52YJRW0.B80008J1">
<Table>
<PhysicalTable objref="A52YJRW0.B30005KO"/>
</Table>
</Column>
<Column objref="A52YJRW0.B80008J2">
<Table>
<PhysicalTable objref="A52YJRW0.B30005KO"/>
</Table>
</Column>
<Column objref="A52YJRW0.B80008J3">
<Table>
<PhysicalTable objref="A52YJRW0.B30005KO"/>
</Table>
</Column>
<Column objref="$o601">
<Table>
<PhysicalTable objref="A52YJRW0.B30005KO"/>
</Table>
</Column>
<Column objref="A52YJRW0.B80008J5">
<Table>
<PhysicalTable objref="A52YJRW0.B30005KO"/>
</Table>
</Column>
<Column objref="A52YJRW0.B80008J6">
<Table>
<PhysicalTable objref="A52YJRW0.B30005KO"/>
</Table>
</Column>
<Column objref="A52YJRW0.B80008J7">
<Table>
<PhysicalTable objref="A52YJRW0.B30005KO"/>
</Table>
</Column>
<Column objref="A52YJRW0.B80008J8">
<Table>
<PhysicalTable objref="A52YJRW0.B30005KO"/>
</Table>
</Column>
<Column objref="A52YJRW0.B80008J9">
<Table>
<PhysicalTable objref="A52YJRW0.B30005KO"/>
</Table>
</Column>
</Columns>
</PhysicalTable>
</Metadata>
<Reposid>A0000001.A52YJRW0</Reposid>
<Type>PhysicalTable</Type>
<Objects/>
<NS>SAS</NS>
<Flags>268435456</Flags>
</UpdateMetadata>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.