G'day Dennis,
While what you say has merit, doing it that way I would never have found
the glich that I believe has to do with other problems...
By the way, I tried that idea of using four of the same characters when
resetting
the QUOTES and while it (and other things like:
SET VAR vQuoteVar TEXT = '^'
SET QUOTES=&vQuoteVar ) might work at the R> they do not when codelocked.
If anyone is interested in some code that allows the user to set the quote
character and between LOAD and GATEWAY here is some code that may
be of assistance.
$COMMAND
LoadData
-- Loads data from file into selected table
-- Called by:
-- ImptAdr2 in DataXfer.apx
-- ImptCD2 in DataXfer.apx
-- ImptJob2 in DataXfer.apx
-- ImptOCD2 in DataXfer.apx
-- ImptOCN2 in DataXfer.apx
-- ImptPCD2 in DataXfer.apx
-- ImptPCN2 in DataXfer.apx
-- ImptPsn2 in DataXfer.apx
-- ImptPS2 in DataXfer.apx
*( Requires var
vFileName
vTableName
Returns var - none
)
-- Created by Tom Grimshaw 05-03-2001
-- Modification history
-- 18-04-2001 tlg Modified setting of QUOTES and usage of & vars
-- 20-04-2001 tlg added option to choose between LOAD and GATEWAY
--
SET QUOTES=NULL
SET QUOTES='
SET DELIMIT=NULL
SET DELIMIT=','
SET LINEEND=NULL
SET LINEEND='¦'
SET SEMI=NULL
SET SEMI=';'
SET PLUS=NULL
SET PLUS='+'
SET SINGLE=NULL
SET SINGLE='_'
SET MANY=NULL
SET MANY='%'
SET IDQUOTES=NULL
SET IDQUOTES='`'
SET CURRENCY '$' PREF 2 B
SET CASE OFF
SET AUTOSKIP ON
SET REVERSE ON
SET BELL OFF
SET NULL -0-
SET DATE YEAR 50
SET DATE CENTURY 19
SET DATE SEQUENCE DDMMYYYY
SET TIME SEQUENCE HHMMSS
SET TOLERANCE 0.
SET ZERO ON
SET RULES OFF
SET VAR vScreenMsg TEXT = 'You can choose to import data with minimal+
quoting around text strings (quotes only around strings that have a comma+
in them - such as that exported from a spreadsheet) or quotes around all+
text strings.|+
Click [Yes] to import from a file with minimal quoting,|+
Click [No] to import from a file with full quoting,|+
Press [Esc] to quit:'
SET VAR vScrnMsgChoice TEXT = 'Q'
RUN SM6YesNo IN GlobBlok.apx
IF vScrnMsgChoice = 'Q' THEN
RETURN
ENDIF
IF vScrnMsgChoice = 'Y' THEN
SET VAR vImportCmd TEXT = +
('GATEWAY IMPORT CSV ' + .vFileName + ' APPEND ' + .vTableName)
ENDIF
IF vScrnMsgChoice = 'N' THEN
SET VAR vImportCmd TEXT = +
('LOAD ' + .vTableName + ' FROM ' + .vFileName + ' AS ASCII')
*( Tried LOAD &vTableName FROM &vFileName AS ASCII
but returned error message vTableName FROM illegal table name)
ENDIF
-- Select text quoting character
LABEL LBegQChr
SET VAR vScreenMsg TEXT = 'You need to specify the character used to+
surround text strings and date values.|+
Click [Yes] to set it to something other than single quotes,|+
Click [No] or press [Esc] to leave it as a single quote:'
SET VAR vScrnMsgChoice TEXT = 'N'
RUN SM4YesNo IN GlobBlok.apx
IF vScrnMsgChoice = 'Y' THEN
SET VAR vQuoteChar TEXT = NULL
DIALOG 'Enter the character:' vQuoteChar=1 vEndKey 1
IF vQuoteChar IS NULL THEN
PAUSE 1 USING 'No character entered.' AT CENTER CENTER
GOTO LBegQChr
ENDIF
IF vQuoteChar IN ('a','b','c','d','e','f','g','h','i','j','k','l','m','n',+
'o','p','q','r','s','t','u','v','w','x','y','z','1','2','3',+
'4','5','6','7','8','9','0','.') THEN
PAUSE 1 USING 'Ilegal character entered.' AT CENTER CENTER
GOTO LBegQChr
ENDIF
IF vQuoteChar IN ('\','/','!','@','#','$','(',')','=',':') THEN
PAUSE 1 USING 'That character not recommended.' AT CENTER CENTER
GOTO LBegQChr
ENDIF
SET VAR vCmd3 TEXT = ('SET QUOTES=' + .vQuoteChar)
&vCmd3
ENDIF
&vImportCmd
SET VAR vErrorTest = .SQLCODE
SET QUOTES=NULL
SET QUOTES='
IF vErrorTest = 0 THEN
SET VAR vScreenMsg TEXT = 'Data loading appears to have succeeded.|+
Click [Yes] to view data in table format,|+
Click [No] or press [Esc] to quit:'
SET VAR vScrnMsgChoice TEXT = 'N'
SET VAR vScreenMsg TEXT = (SRPL(.vScreenMsg,'|',(CHAR(13) + CHAR(10)),0))
SET VAR MICRORIM_NOSTATUS INTEGER
EDIT USING ScrnMsgYesNo3 +
AT 35,20,762,146 +
CAPTION 'Message'
CLEAR VAR MICRORIM_NOSTATUS
IF vScrnMsgChoice = 'Y' THEN
BROWSE * FROM &vTableName
ENDIF
ELSE
PAUSE 1 USING 'There was a problem with data loading.' AT CENTER CENTER
ENDIF
CLEAR VAR vCmd,vCmd2,vImportCmd
SET RULES ON
RETURN
At 20:47 19/04/01 -0500, you wrote:
>All the more reason to select the data from the sys tables into tables of
>your own design. then use that data to drive app. I never rely on sys table
>working beyond simple select to populate other tables.
Warmest regards,
Tom Grimshaw
coy: Just For You Software
tel: 61 (0)2 9552 3311
fax: 61 (0)2 9566 2164
email: [EMAIL PROTECTED]
mobile: 0414 675 903
street: 3/66 Wentworth Park Rd Glebe NSW 2037
post: PO Box 470 Glebe NSW 2037 Australia
_/_/_/_/_/_/_/_/ _/_/_/_/_/_/ _/ _/ _/_/_/_/_/
_/ _/ _/ _/ _/
_/ _/ _/ _/ _/
_/ _/_/_/_/ _/ _/_/_/_/_/
_/ _/ _/ _/
_/ _/ _/ _/ _/
_/ _/ _/ _/_/_/_/_/