VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
END
Attribute VB_Name = "c_DBColumnDescriptor"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
'Generated by IDL2VB v120. Copyright (c) 1999 Martin.Both
'Source File Name: ../demos/db_query/database.idl
'Target File Name: c_DBColumnDescriptor.cls

Option Explicit

'struct ::DB::ColumnDescriptor
Const sTypeId As String = "IDL:DB/ColumnDescriptor:1.0"

'Member
Public name As String
Public p_type As Long
Public sqltype As Integer
Public length As Integer
Public p_scale As Integer
Public precision As Integer
Public nullable As Boolean

'Helper
Public Sub initByRead(ByVal oIn As cOrbStream)
    On Error GoTo ErrHandler
    name = oIn.readString()
    p_type = oIn.readUlong()
    sqltype = oIn.readShort()
    length = oIn.readShort()
    p_scale = oIn.readShort()
    precision = oIn.readShort()
    nullable = oIn.readBoolean()
    Exit Sub
ErrHandler:
    Call VBOrb.ErrReraise(Err, "ColumnDescriptor.read")
End Sub

'Helper
Public Sub writeMe(ByVal oOut As cOrbStream)
    On Error GoTo ErrHandler
    Call oOut.writeString(name)
    Call oOut.writeUlong(p_type)
    Call oOut.writeShort(sqltype)
    Call oOut.writeShort(length)
    Call oOut.writeShort(p_scale)
    Call oOut.writeShort(precision)
    Call oOut.writeBoolean(nullable)
    Exit Sub
ErrHandler:
    Call VBOrb.ErrReraise(Err, "ColumnDescriptor.write")
End Sub

'Helper
Public Sub initByAny(ByVal oAny As cOrbAny)
    On Error GoTo ErrHandler
    name = oAny.getString()
    Call oAny.nextPos
    p_type = oAny.getUlong()
    Call oAny.nextPos
    sqltype = oAny.getShort()
    Call oAny.nextPos
    length = oAny.getShort()
    Call oAny.nextPos
    p_scale = oAny.getShort()
    Call oAny.nextPos
    precision = oAny.getShort()
    Call oAny.nextPos
    nullable = oAny.getBoolean()
    Call oAny.nextPos
    Exit Sub
ErrHandler:
    Call VBOrb.ErrReraise(Err, "initByAny")
End Sub

'Helper
Public Sub insertIntoAny(ByVal oAny As cOrbAny)
    On Error GoTo ErrHandler
    Call oAny.insertString(name)
    Call oAny.nextPos
    Call oAny.insertUlong(p_type)
    Call oAny.nextPos
    Call oAny.insertShort(sqltype)
    Call oAny.nextPos
    Call oAny.insertShort(length)
    Call oAny.nextPos
    Call oAny.insertShort(p_scale)
    Call oAny.nextPos
    Call oAny.insertShort(precision)
    Call oAny.nextPos
    Call oAny.insertBoolean(nullable)
    Call oAny.nextPos
    Exit Sub
ErrHandler:
    Call VBOrb.ErrReraise(Err, "insertIntoAny")
End Sub
