Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Want to do "TYPE mytype IS tablename%ROWTYPE"....
I'm hoping that there's something obvious I'm just missing, but have a feeling, I may be mis-understanding the whole Packages/Types thing.
Trying to define a package that will allow a VB developer to interact with our Oracle DB, to access a set of tables, without allowing the VB app to execute SQL against the tables.
One of the first tasks I've started on is defining some data types. I'd like them to automagically match my table definitions, but so far I'm only able to define variables as records like the table, not to create a TYPE. Is what I'm trying to do unsupported?
Table 1:
CREATE TABLE TNInfo (
TN VARCHAR2(10) NOT NULL,
CustID NUMBER(38),
ModBy VARCHAR2(10) NOT NULL,
ModDate DATE
);
CREATE OR REPLACE PACKAGE mypack IS
type TNInfoType IS TNInfo%ROWTYPE;
But of course this fails. The closest I can get is
type TNInfoType IS RECORD (tninfo TNInfo%ROWTYPE);
MyTNRec1 TNInfoType;
MyTNRec2 TNInfoType;
--- But that means the VB app would have to do an extra level of derefernce, ie. MyTNRec1.tninfo.Modby Is there anyway to end up with a TYPE definition that matches the table, without having to manually code that record defintion? Thanx, Don Simon dejadon_at_simonindustries.cc Sent via Deja.com http://www.deja.com/ Before you buy.Received on Tue May 16 2000 - 00:00:00 CDT
![]() |
![]() |