I am trying to get the default value for a column but unfortunately I get nothing.
Here is my code:
'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()
When I execute the same string in oracle it returns a Long and inside the long is the default value

How can I get the original value inside the long?
Assuming the problem is because your environment doesn’t support LONGs, you can create a function to convert the value to a VARCHAR2 first. For example:
If you have this problem with other columns, you can make the function more generic, or you can look into a utility to convert all the dictionary LONGs to CLOBs. The Dictionary Long Application can do this, although it can get very complicated.