LAE

Welcome to the LAE community!  Please feel free to start a discussion in the discussion tab or join in a conversation.

Discussions

Members

Resources

Events

 View Only
  • 1.  Linking Tables with different Data Types

    Employee
    Posted 02-03-2010 13:32

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: sherchen

    I have two tables to XREF
    Input 1 is DOC long
    INPUT 2 is DOC string

    My solution is to put a filter in the Input 1 to covert to string. The node runs without errors but does not convert. Code below. Whats wrong?

    FILTER

    DOC = str(DOC)

    emit *


  • 2.  RE: Linking Tables with different Data Types

    Employee
    Posted 02-03-2010 13:55

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: ltolleson

    The emit * takes the fields that are part of the input (meta-data) and does not take into account that you have overridden the value of DOC unless you specifically tell the emit.

    Here are a couple of examples of ways to override the value of the field DOC.

    EXAMPLE 1 - Create a variable with the same name as the input field

    DOC = DOC.str()

    emit *
    override emit DOC as DOC


    EXAMPLE 2 - Create a variable with a different name from the input field.

    I prefer to use a variable name that is different from the field name. This keeps me from confusing the field name from a variable name


    tempDOC = DOC.str()

    emit *
    override emit tempDOC as DOC


    EXAMPLE 3
    Instead of changing the fields type in a FILTER node, you can simple use DOC.str() in the key of the X-REF node. This only changes the type for use by the node. It does not change the type in the meta-data. It also reduces the number of required nodes.