我正在尝试获取列的默认值,但不幸的是我什么也没得到。这是我的代码:
'ColumnName is the Column Name in question
'BaseTableName is the Table Name
Dim myCon As New OracleConnection
myCon.ConnectionString = gApp.ConnectString
myCon.Open()
Dim myCmd As New OracleCommand
myCmd.Connection = myCon
myCmd.CommandType = CommandType.Text
myCmd.CommandText = "select data_default " & _
"from all_tab_columns " & _
"where table_name='" & BaseTableName & "' " & _
"and column_name='" & ColumnName & "'"
Dim dr As OracleDataReader
dr = myCmd.ExecuteReader
dr.Read()
Dim val = dr.GetValue(0).ToString
' Dim val = myCmd.ExecuteScalar 'I tried also with executeScalar but it was the same
myCon.Close()
当我在 oracle 中执行相同的字符串时,它返回一个 Long 并且 long 里面是默认值
如何在 long 中获取原始值?