Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> BroadVision - How I use .src file to create indexes?

BroadVision - How I use .src file to create indexes?

From: Dan Bikle <dbikle_at_rahul.net>
Date: 10 Jun 1999 20:04:07 GMT
Message-ID: <7jp5nn$5ng$1@samba.rahul.net>

Hello comp.infosystems.www.servers.unix:

In BroadVision...

How do I use a .src file to create indexes?

I've run some experiments with the key word ATTR_KIND and I have not detected consistent behavior of the sch_gen utility.

I just created the .src file displayed below:

oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo
REPLACEMENT: BV_MM_CAMPAIGN_DESTINATION_REPL STORE: ALL_STORE
CONTENT: CAMPAIGN_DESTINATION TABLE: BV_MM_CAMPAIGN_DESTINATION /* ATTRIBUTE: OID will be generated automatically */

ATTRIBUTE: DESTINATION_KEY
TYPE: STRING NOT_NULL
COLUMN: varchar(255)
FRIENDLY_NAME: Destination Key
SEMANTICS: Destination Key

ATTRIBUTE: STORE_ID
TYPE: LONG NOT_NULL
FRIENDLY_NAME: Service ID
SEMANTICS: Service ID

ATTRIBUTE: CREATION_TIME
TYPE: DATETIME NOT_NULL
ATTR_KIND: REQ_ATTR, RONLY
FRIENDLY_NAME: Creation Time
SEMANTICS: Creation Time

ATTRIBUTE: STATUS
TYPE: STATUS_TYPE NOT_NULL
ATTR_KIND: REQ_ATTR
FRIENDLY_NAME: On-line
SEMANTICS: Online/Offline Status

ATTRIBUTE: DELETED
TYPE: LONG NOT_NULL
ATTR_KIND: REQ_ATTR, RONLY, HIDDEN
FRIENDLY_NAME: Deleted Status
SEMANTICS: Deleted Status

ATTRIBUTE: LAST_MOD_TIME
TYPE: DATETIME NOT_NULL
ATTR_KIND: REQ_ATTR, RONLY
FRIENDLY_NAME: Last Modified Time
SEMANTICS: Last Modified Time

ATTRIBUTE: DESTINATION_URL
TYPE: STRING NOT_NULL
COLUMN: varchar(500)
FRIENDLY_NAME: Destination URL
SEMANTICS: Destination URL

ATTRIBUTE: OTHER_DESTINATION_URL
TYPE: STRING NOT_NULL
COLUMN: varchar(500)
FRIENDLY_NAME: Other Destination URL
SEMANTICS: Other Destination URL

oooooooooooooooooooooooooooooooooooooooooooooooooooo

Next, I used make to generate a .sql script:

natalino-tcsh-44% make -f schema.mk mm_camp_dest_db_replace.sql
/bin/touch mm_camp_dest_spec_replace.tmp mm_camp_dest_db_replace.sql
/bin/rm -f mm_camp_dest_spec_replace.tmp mm_camp_dest_db_replace.sql
/usr/ccs/lib/cpp -B mm_camp_dest_spec_replace.src mm_camp_dest_spec_replace.tmp
/opt/bv1to1/bin/sch_gen -schema mm_camp_dest_spec_replace.tmp -script mm_camp_dest_db_replace.sql -cnt -class_only BV_MM_CAMPAIGN_DESTINATION to be replaced. id 1

natalino-tcsh-45% cat mm_camp_dest_db_replace.sql

drop table OLD_BV_MM_CAMPAIGN_DESTINATION
;

RENAME BV_MM_CAMPAIGN_DESTINATION TO OLD_BV_MM_CAMPAIGN_DESTINATION
;

delete from BV_ATTRIBUTES where SCHEMA_NAME = 'MM_CAMPAIGN_DESTINATION' and TABLE_NAME = 'BV_MM_CAMPAIGN_DESTINATION' and SYSTEM_ID = 'CT'
;

delete from BV_ATTRIBUTES_EXT where SCHEMA_NAME = 'MM_CAMPAIGN_DESTINATION' and TABLE_NAME = 'BV_MM_CAMPAIGN_DESTINATION' and SYSTEM_ID = 'CT'
;

delete from BV_ATTR_GROUP where SCHEMA_NAME = 'MM_CAMPAIGN_DESTINATION' and TABLE_NAME = 'BV_MM_CAMPAIGN_DESTINATION'
;

delete from BV_EXT_MAP where SCHEMA_NAME = 'MM_CAMPAIGN_DESTINATION' and EXT_TABLE = 'BV_MM_CAMPAIGN_DESTINATION'
;

insert into BV_ATTRIBUTES values('MM_CAMPAIGN_DESTINATION', 0, 'BV_MM_CAMPAIGN_DESTINATION', 'OID', 'OID', 'CT', 'Object ID', 'Object ID', 11, -1, 0, 0, 0, 0)
;

insert into BV_ATTRIBUTES values('MM_CAMPAIGN_DESTINATION', 1, 'BV_MM_CAMPAIGN_DESTINATION', 'DESTINATION_KEY', 'STRING', 'CT', 'Destination Key', 'Destination Key', 144, -1, 0, 0, 0, 0)
;

insert into BV_ATTRIBUTES values('MM_CAMPAIGN_DESTINATION', 2, 'BV_MM_CAMPAIGN_DESTINATION', 'STORE_ID', 'LONG', 'CT', 'Service ID', 'Service ID', 16, -1, 0, 0, 0, 0)
;

insert into BV_ATTRIBUTES values('MM_CAMPAIGN_DESTINATION', 3, 'BV_MM_CAMPAIGN_DESTINATION', 'CREATION_TIME', 'DATETIME', 'CT', 'Creation Time', 'Creation Time', 3, -1, 0, 0, 0, 0)
;

insert into BV_ATTRIBUTES values('MM_CAMPAIGN_DESTINATION', 4, 'BV_MM_CAMPAIGN_DESTINATION', 'STATUS', 'STATUS_TYPE', 'CT', 'On-line', 'Online/Offline Status', 17, -1, 0, 0, 0, 0)
;

insert into BV_ATTRIBUTES values('MM_CAMPAIGN_DESTINATION', 5, 'BV_MM_CAMPAIGN_DESTINATION', 'DELETED', 'LONG', 'CT', 'Deleted Status', 'Deleted Status', 11, -1, 0, 0, 0, 0)
;

insert into BV_ATTRIBUTES values('MM_CAMPAIGN_DESTINATION', 6, 'BV_MM_CAMPAIGN_DESTINATION', 'LAST_MOD_TIME', 'DATETIME', 'CT', 'Last Modified Time', 'Last Modified Time', 3, -1, 0, 0, 0, 0)
;

insert into BV_ATTRIBUTES values('MM_CAMPAIGN_DESTINATION', 7, 'BV_MM_CAMPAIGN_DESTINATION', 'DESTINATION_URL', 'STRING', 'CT', 'Destination URL', 'Destination URL', 16, -1, 0, 0, 0, 0)
;

insert into BV_ATTRIBUTES values('MM_CAMPAIGN_DESTINATION', 8, 'BV_MM_CAMPAIGN_DESTINATION', 'OTHER_DESTINATION_URL', 'STRING', 'CT', 'Other Destination URL', 'Other Destination URL', 16, -1, 0, 0, 0, 0)
;

drop table BV_MM_CAMPAIGN_DESTINATION
;

create table BV_MM_CAMPAIGN_DESTINATION (

        OID int not null,
        DESTINATION_KEY varchar(255) not null,
        STORE_ID int not null,
        CREATION_TIME date not null,
        STATUS int not null,
        DELETED int not null,
        LAST_MOD_TIME date not null,
        DESTINATION_URL varchar(500) not null,
        OTHER_DESTINATION_URL varchar(500) not null
)
;

create unique index BV_MM_CAMPAIGN_DESTINAT_ID_IDX on BV_MM_CAMPAIGN_DESTINATION(OID)
;

create unique index BV_MM_CAMPAIGN_DESTINA_KEY_IDX on BV_MM_CAMPAIGN_DESTINATION(DESTINATION_KEY,STORE_ID)
;

natalino-tcsh-46%

Notice the last statement in the sql script.

Why did the sch_gen utility put the statement in the script?

I suspect that the 'create unique index' commands are not dependent on the .src file.

I need to know how to control the placement of 'CREATE UNIQUE INDEX' commands in sql scripts created by the sch_gen utility.

-Dan



Daniel B. Bikle/Independent Oracle Consultant bikle_at_bikle.com | 650/941-6276 | P.O. BOX AG LOS ALTOS CA 94023 http://www.bikle.com
Received on Thu Jun 10 1999 - 15:04:07 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US