Previous Page | Next Page

Metadata API Class

_UPDATE_METADATA_



Updates specified metadata in a repository
Category: Write Methods

Syntax
Parameters
Details
Using _UPDATE_METADATA_
Examples
Example 1: Add New Columns to the Selected Table
Example 2: Add Extended Attributes
See Also

Syntax

CALL SEND(i_api, '_UPDATE_METADATA_', l_rc, l_meta);

Parameters

Parameter Type Description
i_api Class specifies the passed instance of METAAPI.CLASS. See Using the Metadata API Class.
l_rc N specifies the return codes for the method. A nonzero code indicates failure and means that l_rc is an error list identifier. For the error list format, see Error Codes.
l_metadata L specifies the passed metadata property list for the object that is to be updated. For the general format of this list, see Metadata Property List.


Details

l_meta

specifies the passed metadata property list for the object that is to be updated. The ID value in l_meta should be reposid.typeid.instanceid.

To add properties to an existing object, the ID value in l_meta should be reposid.typeid.instanceid.


Using _UPDATE_METADATA_

Keep the following in mind when you use the _UPDATE_METADATA_ method:


Examples


Example 1: Add New Columns to the Selected Table

l_meta=makelist(); 

   /* 
    * object_id is the ID of an existing Data Table object.  
    */ 

l_meta=insertc(l_meta,object_id,-1,'ID');
            
   /*                     
    *  Define a column.  The COLUMNS property 
    *  contains a sublist per column. 
    */                  
              
l_cols=makelist();  
l_col=makelist();  
              
l_cols=insertl(l_cols,l_col,-1); 
                           
l_meta=insertl(l_meta,l_cols,-1,'COLUMNS');
                           
col_id=repos_id||'.'||'WHCOLUMN'; 
                
l_col=insertc(l_col,col_id,-1,'ID');
l_col=insertc(l_col,'SaleDate',-1,'NAME'); 
l_col=insertc(l_col,'Date of Sale',-1,'DESC');
l_col=insertc(l_col,'N',-1,'TYPE');
l_col=insertn(l_col,8,-1,'LENGTH'); 
l_col=insertc(l_col,'DATE7.',-1,'FORMAT');
l_col=insertc(l_col,'DATE7.',-1,'INFORMAT');  
                                     
   /*                     
    *  Update any additional properties.
    *  :              
    *  :  
    */          
            
   /*         
    *  Update the table. 
    */           
               
call send(i_api,'_UPDATE_METADATA_',l_rc,l_meta); 
       
if l_rc = 0 then do; 
   
   put 'Table Updated successfully'; 
                  
   end; /* if */    
else do;    
        
   msg=getnitemc(l_rc,'MSG',1,1,'ERROR: 
       _UPDATE_METADATA_ FAILED');
   put msg;
                
   list_rc=dellist(l_rc);
                
   end; /* else */
        
    
l_meta=dellist(l_meta,'Y');


Example 2: Add Extended Attributes

   /* 
    * object_id is the ID of an existing Data Table object.  
    */ 

l_meta=makelist();

l_meta=insertc(l_meta,object_id,-1,'ID');

   /*
    * Attributes
    */ 

l_attrs=makelist(); 
l_attr=makelist(); 

l_attr=insertc(l_attr,'Loader',1,'NAME'); 
l_attr=insertc(l_attr,'Oracle',-1,'VALUE');

l_attr=insertc(l_attr,'Name of loader used',-1,'DESC');
l_attrs=insertl(l_attrs,l_attr,-1); 


l_meta=insertl(l_meta,l_attrs,-1,'EXTENDED ATTRIBUTES'); 
call send(i_api, '_UPDATE_METADATA_',l_rc,l_meta);


See Also

_ADD_METADATA_, _DELETE_METADATA_

Previous Page | Next Page | Top of Page