Attribute VB_Name = "m_DBColumnData"
'Generated by IDL2VB v120. Copyright (c) 2000 Martin.Both
'Source File Name: ../demos/db_query/database.idl

Option Explicit

'union ::DB::ColumnData
Public Const TypeId As String = "IDL:DB/ColumnData:1.0"

'Helper
Public Function TypeCode() As cOrbTypeCode
    On Error GoTo ErrHandler
    Dim oOrb As cOrbImpl
    Set oOrb = VBOrb.defaultOrb()
    'Get previously created recursive or concrete TypeCode
    Dim oRecTC As cOrbTypeCode
    Set oRecTC = oOrb.getRecursiveTC(TypeId, 16) 'mCB.tk_union
    If oRecTC Is Nothing Then
        'Create place holder for TypeCode to avoid endless recursion
        Set oRecTC = oOrb.createRecursiveTc(TypeId)
        On Error GoTo ErrRollback
        Dim oDiscTC As cOrbTypeCode
        Set oDiscTC = m_DB.DataType_TypeCode()
        'Describe union members
        Dim oMemSeq As cCBUnionMemberSeq
        Set oMemSeq = New cCBUnionMemberSeq
        oMemSeq.Length = 6
        Dim oAny As cOrbAny
        Set oMemSeq.Item(0) = New cCBUnionMember
        Set oAny = New cOrbAny
        Call oAny.insertUlong(1)
        Set oMemSeq.Item(0).label = oAny
        oMemSeq.Item(0).name = "stringValue"
        Set oMemSeq.Item(0).p_type = oOrb.createStringTc(0)
        Set oMemSeq.Item(1) = New cCBUnionMember
        Set oAny = New cOrbAny
        Call oAny.insertUlong(2)
        Set oMemSeq.Item(1).label = oAny
        oMemSeq.Item(1).name = "shortValue"
        Set oMemSeq.Item(1).p_type = oOrb.createPrimitiveTc(2) 'VBOrb.TCShort
        Set oMemSeq.Item(2) = New cCBUnionMember
        Set oAny = New cOrbAny
        Call oAny.insertUlong(3)
        Set oMemSeq.Item(2).label = oAny
        oMemSeq.Item(2).name = "integerValue"
        Set oMemSeq.Item(2).p_type = oOrb.createPrimitiveTc(3) 'VBOrb.TCLong
        Set oMemSeq.Item(3) = New cCBUnionMember
        Set oAny = New cOrbAny
        Call oAny.insertUlong(4)
        Set oMemSeq.Item(3).label = oAny
        oMemSeq.Item(3).name = "doubleValue"
        Set oMemSeq.Item(3).p_type = oOrb.createPrimitiveTc(7) 'VBOrb.TC...
        Set oMemSeq.Item(4) = New cCBUnionMember
        Set oAny = New cOrbAny
        Call oAny.insertUlong(9)
        Set oMemSeq.Item(4).label = oAny
        oMemSeq.Item(4).name = "textValue"
        Set oMemSeq.Item(4).p_type = oOrb.createStringTc(0)
        Set oMemSeq.Item(5) = New cCBUnionMember
        Set oAny = New cOrbAny
        Call oAny.insertUlong(10)
        Set oMemSeq.Item(5).label = oAny
        oMemSeq.Item(5).name = "binaryValue"
        Set oMemSeq.Item(5).p_type = oOrb.createPrimitiveTc(10) 'VBOrb.TCOctet
        Set oMemSeq.Item(5).p_type = oOrb.createSequenceTc(0, oMemSeq.Item(5).p_type)
        'Overwrite place holder
        Call oRecTC.setRecTc2UnionTc("ColumnData", oDiscTC, oMemSeq)
    End If
    Set TypeCode = oRecTC
    Exit Function
ErrRollback:
    Call oRecTC.destroy
ErrHandler:
    Call VBOrb.ErrReraise(Err, "TypeCode")
End Function
