Problems with FillSChema on ORACLE

  • Thread starter Andrea Temporin
  • Start date
A

Andrea Temporin

We are working on a Db Oracle accessed by Oledb. We get connection using
MSDAORA.1 provider ad ORACLE 9.2 drivers on the PC.
We create datatables associated to the tables on the db, using FillSchema.
Some tables don't include primary key, even if they have the correct
structure on the db.
The datatables without primary key are few.
The others inlude the corrrect information.

The code we used is the following:

Dim da As OleDbDataAdapter
Dim dt As New DataTable
Dim cmd As New OleDbCommand(sSelect, cn)
cmd.CommandTimeout = 0
da = New OleDbDataAdapter(cmd)
da.FillSchema(dt, SchemaType.Mapped)
dt.TableName = sTabella

We report the code we used for creating a table, whose datatable doesn't
include the primary key:

Create table UTTAPPR
(CAPP VARCHAR2(40) not null
,CPADRE VARCHAR2(80) not null
,CMENU VARCHAR2(40) not null
,NUMORD NUMBER(5,0) null
,TIPOMENU VARCHAR2(1) null
,CFUNZ VARCHAR2(30) null
,CGRUPPOMENU VARCHAR2(30) null
,XMENU VARCHAR2(50) null
,SHORTCUT NUMBER(10,0) null
,FORM VARCHAR2(50) null
,PARAMETRI VARCHAR2(2000) null
,PULSANTI VARCHAR2(2000) null);
alter table UTTAPPR
Add Constraint UTTAPPRPK
Primary key (CAPP,CPADRE,CMENU);
Create Index UTTAPPR01
on UTTAPPR (NUMORD);

and the code for a table whose datatable includes the primary key:

Create table STTG001
(CDIT NUMBER(5,0) not null
,CENT VARCHAR2(6) not null
,XENT VARCHAR2(70) null
,XRID VARCHAR2(20) null
,XIND VARCHAR2(50) null
,CCOM NUMBER(7,0) null
,CIST VARCHAR2(6) null
,XIVA VARCHAR2(11) null
,CFIS VARCHAR2(16) null
,XTEL1 VARCHAR2(20) null
,XTEL2 VARCHAR2(20) null
,XFAX1 VARCHAR2(20) null
,XFAX2 VARCHAR2(20) null
,XEMA1 VARCHAR2(40) null
,XEMA2 VARCHAR2(40) null
,DVAD DATE null
,XNOT VARCHAR2(2000) null
,FRIGCAN NUMBER(5,0) null
,XINSUTE VARCHAR2(25) null
,XAGGUTE VARCHAR2(25) null
,XLAVUTE VARCHAR2(25) null);
alter table STTG001
Add Constraint STTG001PK
Primary key (CDIT,CENT);
Create Index STTG00101
on STTG001 (CDIT,CCOM);
Create Index STTG00102
on STTG001 (CDIT,CFIS);
Create Index XRID
on STTG001 (XRID);

Why does this happen just with few tables?
What is the problem with them?
Is it due to the table structure on Oracle, or to the FillSchema?

Thanks!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top