spebola
Well-known member
I am getting error ORA-00942 (table does not exist) when I try to get the schema from an oracle database table.
I created the table via SQLPlus worksheet in OEM, granted the user "XXXX" all privileges on the table Cont. The create table SQL is:
create table Cont
(CN_ContNo NUMBER(6) NOT NULL,
CN_AMYM Char(8) NOT NULL,
CN_CompCode Char(5) NOT NULL,
CN_OfficeCode Char(5) NOT NULL,
...
CN_Verify CHAR(1) NOT NULL,
constraint Cont_PK PRIMARY KEY (CN_ContNo, CN_AMYM)
) tablespace USERS;
I see the schema in oracle but not the DBF. How do you create the DBF? Where should it be located? I can drop the table, and execute a select (although no rows are returned since it is empty) using SQLPlus worksheet.
In vb.net (using System.Data.OracleClient namespace), I create a connection, command, data adapter and data set as follows:
Dim oConn As New OracleConnection
oConn.ConnectionString = "Data Source=TRSProd;User ID=xxxx;Password=yyyyy;"
oConn.Open()
Dim da As OracleDataAdapter
Dim ds As New DataSet
Dim cmd As New OracleCommand
Dim tran As OracleTransaction
Dim filestring As String
Dim x As Exception
cmd.CommandType = CommandType.Text
cmd.CommandText = "SELECT * FROM Cont"
cmd.Connection = oConn
da = New OracleDataAdapter(cmd)
Try
da.FillSchema(ds, SchemaType.Source)
Catch ex As Exception
MessageBox.Show(ex.Message.ToString)
End Try
oConn.Close()
The connection is successful and the error occurs in the da.fillschema line. I have tried using a semi-colon( at the end of the select statement, but get error "invalid character". I have also tried using uppercase in the select statement. I am using Oracle 9i, release 2, personal edition.
Any ideas would be greatly appreciated since I any out of ideas to try.
I created the table via SQLPlus worksheet in OEM, granted the user "XXXX" all privileges on the table Cont. The create table SQL is:
create table Cont
(CN_ContNo NUMBER(6) NOT NULL,
CN_AMYM Char(8) NOT NULL,
CN_CompCode Char(5) NOT NULL,
CN_OfficeCode Char(5) NOT NULL,
...
CN_Verify CHAR(1) NOT NULL,
constraint Cont_PK PRIMARY KEY (CN_ContNo, CN_AMYM)
) tablespace USERS;
I see the schema in oracle but not the DBF. How do you create the DBF? Where should it be located? I can drop the table, and execute a select (although no rows are returned since it is empty) using SQLPlus worksheet.
In vb.net (using System.Data.OracleClient namespace), I create a connection, command, data adapter and data set as follows:
Dim oConn As New OracleConnection
oConn.ConnectionString = "Data Source=TRSProd;User ID=xxxx;Password=yyyyy;"
oConn.Open()
Dim da As OracleDataAdapter
Dim ds As New DataSet
Dim cmd As New OracleCommand
Dim tran As OracleTransaction
Dim filestring As String
Dim x As Exception
cmd.CommandType = CommandType.Text
cmd.CommandText = "SELECT * FROM Cont"
cmd.Connection = oConn
da = New OracleDataAdapter(cmd)
Try
da.FillSchema(ds, SchemaType.Source)
Catch ex As Exception
MessageBox.Show(ex.Message.ToString)
End Try
oConn.Close()
The connection is successful and the error occurs in the da.fillschema line. I have tried using a semi-colon( at the end of the select statement, but get error "invalid character". I have also tried using uppercase in the select statement. I am using Oracle 9i, release 2, personal edition.
Any ideas would be greatly appreciated since I any out of ideas to try.