<!DOCTYPE html
  PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<!--
Copyright (c) 2006 UGS Corp.

All Rights Reserved.

This software and related documentation are proprietary to UGS Corp.
-->
<html>
   <head>
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <title>Creating a DB_ALIAS</title>
      <script language="javaScript">
        abridged="false";
        displayConditions=new Array();
      </script>
      <link type="text/css" href="../css/main_styles.css" rel="stylesheet">
   </head>
   <body class="bodydocs" onload="top.pageLoader()" bgcolor="#FFFFFF">
      <div class="title_topic4" id="xps10_pagetitle">Creating a DB_ALIAS</div>
      <hr noshade="true">
      <p class="para_topic">Each attribute in the database has a unique name. In NX Library, these attributes are assigned an alias and referred to as a DB_ALIAS. This alias must also be unique. You can only search for a database attribute that has been assigned a DB_ALIAS in the  <a class="links" href="javascript:void(0)" onclick="top.openFile('mfggeneral/com_lib_config_lib.html');return(false);">.def file</a>. There is a specific format to follow when defining a DB_ALIAS. In the following example, we will define an alias for flute direction, which is the attribute &quot;FD&quot; in the ASCII database (the .dat file).
      </p>
      <p class="para_topic">DB_ALIAS FluteDirection</p>
      <p class="para_topic">&nbsp; {</p>
      <p class="para_topic">&nbsp; DB_ID FD</p>
      <p class="para_topic">&nbsp; DB_ID_TYPE s</p>
      <p class="para_topic">&nbsp; OPTIONS &quot;right&quot; &quot;left&quot;</p>
      <p class="para_topic">&nbsp; OPTIONS_IDS &quot;R&quot; &quot;L&quot;</p>
      <p class="para_topic">&nbsp; DIALOG_NAME &quot;Flute Direction&quot;</p>
      <p class="para_topic">&nbsp; RSET_NAME &quot;Flute Direction&quot;</p>
      <p class="para_topic">&nbsp; }</p>
      <p class="para_topic">where:</p>
      <table bgcolor="#f7f7f7" cellspacing="3" width="100%" align="center">
         <tr valign="top">
            <td colspan="1" rowspan="1" width="14%">
               <p class="para_td">DB_ALIAS</p>
            </td>
            <td colspan="1" rowspan="1" width="85%">
               <p class="para_td">The name that you assign your DB_ALIAS is the one that you use to refer to it in the Search Criteria and Search Result Dialog configuration.</p>
            </td>
         </tr>
         <tr valign="top">
            <td colspan="1" rowspan="1" width="14%">
               <p class="para_td">DB_ID</p>
            </td>
            <td colspan="1" rowspan="1" width="85%">
               <p class="para_td">The Library uses this to identify the attribute which corresponds to the name of the DB_ALIAS. This is the identifier found in the FORMAT line of the .dat file (see  <a class="links" href="javascript:void(0)" onclick="top.openFile('mfggeneral/com_lib_filling_database.html');return(false);">Filling the Database</a>).
               </p>
            </td>
         </tr>
         <tr valign="top">
            <td colspan="1" rowspan="1" width="14%">
               <p class="para_td">DB_ID TYPE</p>
            </td>
            <td colspan="1" rowspan="1" width="85%">
               <p class="para_td">Type of identifier - the choices here are:</p>
               <p class="para_td">d - double</p>
               <p class="para_td">i - integer</p>
               <p class="para_td">s - string</p>
            </td>
         </tr>
         <tr valign="top">
            <td colspan="1" rowspan="1" width="14%">
               <p class="para_td">OPTIONS</p>
            </td>
            <td colspan="1" rowspan="1" width="85%">
               <p class="para_td">If you would like to list a finite number of options to appear in the Search Criteria dialog, you would use this command. This causes the names that appear as opt1, opt2, etc., to appear in a drop down menu in the Search Criteria dialog. This command is optional and omitting it causes an empty input field to appear beside the attribute label.</p>
            </td>
         </tr>
         <tr valign="top">
            <td colspan="1" rowspan="1" width="14%">
               <p class="para_td">OPTIONS IDS</p>
            </td>
            <td colspan="1" rowspan="1" width="85%">
               <p class="para_td">If you use the OPTIONS command above, you must assign the database identifiers to the names of the options for which you want to search. For each of the option names above, you must assign their database identifiers as id1, id2, etc., here. You only use this command in conjunction with the OPTIONS command above.</p>
            </td>
         </tr>
         <tr valign="top">
            <td colspan="1" rowspan="1" width="14%">
               <p class="para_td">DIALOG NAME</p>
            </td>
            <td colspan="1" rowspan="1" width="85%">
               <p class="para_td">The name you assign here is the label that appears in the Search Criteria dialog.</p>
            </td>
         </tr>
         <tr valign="top">
            <td colspan="1" rowspan="1" width="14%">
               <p class="para_td">RSET NAME</p>
            </td>
            <td colspan="1" rowspan="1" width="85%">
               <p class="para_td">The name that you assign here is the label that appears in the Search Result dialog.</p>
            </td>
         </tr>
      </table><br><table border="0">
         <tr>
            <td valign="top" align="left"><img align="left" src="../graphics/note.gif" alt="Note" title="Note"></td>
            <td valign="bottom" align="left" width="100%">
               <div class="para_note">
                  <p class="para_note_body">If you are using Teamcenter Engineering and are creating a new DB_ALIAS for an existing attribute, ensure that all DB_ALIAS entries correspond to attribute parameters within Teamcenter Engineering.</p>
               </div>
            </td>
         </tr>
      </table>
      <p class="para_topic">Assuming that the data for this attribute is already contained in the  <a class="links" href="javascript:void(0)" onclick="top.openFile('mfggeneral/com_lib_filling_database.html');return(false);">database</a> (in the .dat file for the ASCII database), this DB_ALIAS, once  <a class="links" href="javascript:void(0)" onclick="top.openFile('mfggeneral/com_lib_db_alias_class_hier.html');return(false);">included as a DIALOG NAME parameter in the Class Hierarchy</a> will cause the following entry to appear in the Search Criteria dialog:
      </p>
      <p align="center"><img align="bottom" src="graphics/lib_flute_dir.gif"></p>
      <p class="para_topic">Any time you want to include a new attribute in the Search Criteria dialog, you must first create a DB_ALIAS. Each DB_ALIAS you create must be included in the list of DB_ALIASes in the .def file.</p>
   </body>
</html>