Razzak Thank you very much!
Many of the big offices seem to be sticking with my RBase app
instead of switching to the . net app that still is not up and running
in over 18 months! Also, a big distributor may start selling my app.
These big offices want to be able to export some of their notes and
email them to a friend in another town so they can import them.
These are not patient notes really but canned text they use explain
different treatment to insurance companies.
Thanks
Marc
----- Original Message -----
From: "A. Razzak Memon" <[EMAIL PROTECTED]>
To: "RBASE-L Mailing List" <[email protected]>
Sent: Tuesday, October 28, 2008 1:45 PM
Subject: [RBASE-L] - Re: Import & Export note field
At 11:15 AM 10/28/2008, Marc wrote:
Hi Razzak
Thanks, I tried the Insert method but get an error about
you can't have the destination table in the where clause
or something like that. Also, I am hitting a snag on
Loading a table from a file.
No big deal, when I get more time to sit down and work
through this I should be able to get it to work.
My time is limited because I have to finish dealing with
putting out a fire, literally!
Marc,
Remember, whatever the hurdles may be, stick to the basic
principles of success, NEVER give up!
Based upon my last reply, I have prepared a sample application
with two databases (MasterDB and ArchDB) along with a command
file to help you understand the swift technique to migrate
data between two databases using the DSN-Less connection.
Sample Application: Migrating Data using DSN-Less Connection
Supported Versions: R:BASE 7.6 and Turbo V-8 for Windows
Date Posted: October 28, 2008
URL: http://www.razzak.com/sampleapplications
-----------------------------------------------------------------------
-- Using R:BASE 7.6 for Windows
-----------------------------------------------------------------------
-- Migrating_Data_Using_DSNLessConnection76.RMD
-- Migrating data between two databases using DSN-Less Connection
-- Using R:BASE 7.6 Database ODBC Driver
-- Author: A. Razzak Memon
-- Date Created: October 28, 2008
-- Related Database: MasterDB, ArchDB
-- Common table to migrate data in both databaes: Contact
-- Assure the connection of correct database
IF (CVAL('DATABASE')) <> 'ArchDB' OR (CVAL('DATABASE')) IS NULL THEN
CONNECT ArchDB IDENTIFIED BY NONE
ENDIF
-- Make sure that previously SATTACHed table is detached
SDETACH tContact NOCHECK
-- Make sure that the previously DSN-Less Database is Disconnected
SDISCONNECT ';Driver=R:BASE 7.6 Database Driver (*.rb1);dbq=MasterDB'
-- Now Connect the Database Using the DSN-Less Connection
SCONNECT ';Driver=R:BASE 7.6 Database Driver (*.rb1);dbq=MasterDB'
-- SAttach Table(s)
SATTACH Contact AS tContact USING ALL
-- Review all records in SAttached tContact table (MasterDB Database)
BROWSE * FROM tContact
-- Review all records in actual Contact table (ArchDB Database)
BROWSE * FROM Contact
-- Project a temporary table with non matching <> records in ArchDB
SET ERROR MESSAGE 2038 OFF
DROP TABLE tmpContact
SET ERROR MESSAGE 2038 ON
PROJECT TEMPORARY tmpContact FROM tContact USING ALL +
WHERE ContID NOT IN (SELECT ContID FROM Contact)
INSERT INTO Contact +
(CustID,ContID,ContFName,ContLName,ContPhone, +
ContFax,ContCell,ContPager,ContEMail,ContInfo, +
LastContactDate) +
SELECT +
CustID,ContID,ContFName,ContLName,ContPhone, +
ContFax,ContCell,ContPager,ContEMail,ContInfo, +
LastContactDate +
FROM tempContact
-- Now review all records in actual Contact table (ArchDB Database)
BROWSE * FROM Contact
-- Drop Temporary Table
DROP TABLE tmpContact
-- Make sure that SATTACHed table is detached
SDETACH tContact NOCHECK
-- Make sure that DSN-Less Database is Disconnected
SDISCONNECT ';Driver=R:BASE 7.6 Database Driver (*.rb1);dbq=MasterDB'
RETURN
-----------------------------------------------------------------------
-- Using R:BASE Turbo V-8 for Windows
-----------------------------------------------------------------------
-- Migrating_Data_Using_DSNLessConnection80.RMD
-- Migrating data between two databases using DSN-Less Connection
-- Using R:BASE Turbo V-8 Database ODBC Driver
-- Author: A. Razzak Memon
-- Date Created: October 28, 2008
-- Related Database: MasterDB, ArchDB
-- Common table to migrate data in both databaes: Contact
-- Assure the connection of correct database
IF (CVAL('DATABASE')) <> 'ArchDB' OR (CVAL('DATABASE')) IS NULL THEN
CONNECT ArchDB IDENTIFIED BY NONE
ENDIF
-- Make sure that previously SATTACHed table is detached
SDETACH tContact NOCHECK
-- Make sure that the previously DSN-Less Database is Disconnected
SDISCONNECT ';Driver=R:BASE 8.0 Database Driver (*.rx1);dbq=MasterDB'
-- Now Connect the Database Using the DSN-Less Connection
SCONNECT ';Driver=R:BASE 8.0 Database Driver (*.rx1);dbq=MasterDB'
-- SAttach Table(s)
SATTACH Contact AS tContact USING ALL
-- Review all records in SAttached tContact table (MasterDB Database)
BROWSE * FROM tContact
-- Review all records in actual Contact table (ArchDB Database)
BROWSE * FROM Contact
-- Project a temporary table with non matching <> records in ArchDB
SET ERROR MESSAGE 2038 OFF
DROP TABLE tmpContact
SET ERROR MESSAGE 2038 ON
PROJECT TEMPORARY tmpContact FROM tContact USING ALL +
WHERE ContID NOT IN (SELECT ContID FROM Contact)
INSERT INTO Contact +
(CustID,ContID,ContFName,ContLName,ContPhone, +
ContFax,ContCell,ContPager,ContEMail,ContInfo, +
LastContactDate) +
SELECT +
CustID,ContID,ContFName,ContLName,ContPhone, +
ContFax,ContCell,ContPager,ContEMail,ContInfo, +
LastContactDate +
FROM tempContact
-- Now review all records in actual Contact table (ArchDB Database)
BROWSE * FROM Contact
-- Drop Temporary Table
DROP TABLE tmpContact
-- Make sure that SATTACHed table is detached
SDETACH tContact NOCHECK
-- Make sure that DSN-Less Database is Disconnected
SDISCONNECT ';Driver=R:BASE 8.0 Database Driver (*.rb1);dbq=MasterDB'
RETURN
Have fun!
Very Best R:egards,
Razzak.