Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQLExec Help Desperate!
Message
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
00462163
Message ID:
00462172
Views:
13
>I have always used Remote Views to get Oracle data into VFP. Now I have to
>do some Oracle database manipulation, via VFP of course. But I have never
>used SQL Passthru. I was wondering if you had any code examples, etc I
>could look at to
>1. drop/create a view
>2. drop/create a table
>3. create keys
>4. set regular/simple indexes
>5. set persistent relations (primary/foreign keys)
>
>Thanks.

You use the SQLExec() function in VFP. I have a free ODBC DSN Class in the Files Section, Win32/API category. It has examples and is commented extensively to help get you started on creating a connection to Oracle.

Some syntax for the SPT from one of my script files. A script file is just a text file with a .SQL extension. This files can be run directly from SQL*Plus by issuing the following command: @c:\path_to_script_files\my_script_file_name If you use a script file, all the commands below must end with a semi-colon.
create index I_ADDRESS_HISTORY_FACILITY_ID 
   on npdes.ADDRESS_HISTORY (FACILITY_ID) 
   tablespace npdes

drop index I_ADDRESS_HISTORY_FACILITY_ID 

ALTER TABLE nonfiler 
   add constraint unq_nonfilenum Unique (nonfilenum)

alter table state_code_types drop primary key

alter table state_code_types 
   add constraint pk_state_cdtp_keyid PRIMARY KEY (KeyID)

ALTER TABLE Permits drop constraint fk_permits_facility

ALTER TABLE Permits 
   add constraint pk_permits_keyid PRIMARY KEY (KeyID)

ALTER TABLE Permits 
   add constraint fk_permits_facility 
   FOREIGN KEY (Facility_ID) 
   REFERENCES NPDES.Facility (KeyID)

ALTER TABLE Permits 
   add constraint fk_permits_agency
   FOREIGN KEY (Permit_Authority) 
   REFERENCES NPDES.Permit_Agencies (KeyID)

create table waterbody_parms
   (KeyID          Number(8)    CONSTRAINT pk_wb_parms_keyid  PRIMARY KEY,
    WaterBody_ID   Number(8)    CONSTRAINT fk_waterbody_keyid REFERENCES
                                  NPDES.Waterbody (KeyID) ON DELETE CASCADE,
    Parm_ID        Number(8)    CONSTRAINT fk_parmcodes_keyid REFERENCES 
                                  NPDES.Parameter_Codes (KeyID))
    Tablespace NPDES
Mark McCasland
Midlothian, TX USA
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform