May 19, 2006, 10:15 AM
<Aparna>FILEDEF HOLDINGS DISK C:\REP
SQL SQLORA SET SERVER SER1
SQL SQLORA
SELECT * from tab1;
TABLE FILE SQLOUT
PRINT *
ON TABLE HOLD AS myhold
END
TABLE FILE myhold
PRINT
fld1
fld2
BY HIGHEST fld3 NOPRINT
BY fld4 NOPRINT
ON TABLE SET PAGE-NUM OFF
ON TABLE NOTOTAL
ON TABLE HOLD AS myhold FORMAT COMMA
END
I did this and it gives the error:
(FOC1517) UNRECOGNIZED COMMAND null
0 NUMBER OF RECORDS IN TABLE= 28 LINES= 28
0 NUMBER OF RECORDS IN TABLE= 28 LINES= 28
May 19, 2006, 11:53 AM
JimRiceI get the FOC1517 error message alot and just ignore it. It's complaining about something but doesn't have any effect on your focexec. It looks like your code created a temporary hold file named myhold.prn containing 28 records. You then need to copy that file somewhere or use a filedef to place it where you want. I create .csv files using FORMAT COMT (this includes titles) or FORMAT COM (no titles) and then use a copy command to copy the file to a network drive.
Here's an example using the CAR file:
----------------------------------------------------
TABLE FILE CAR
PRINT
CAR
BY COUNTRY
ON TABLE HOLD AS FORUM859 FORMAT COMT
END
-*
CMD COPY FORUM859.* \\some\network\drive\forum
----------------------------------------------------
Here's the messages returned: (I ignore the FOC1517 message)
----------------------------------------------------
(FOC1517) UNRECOGNIZED COMMAND null
0 NUMBER OF RECORDS IN TABLE= 10 LINES= 10
forum859.csv
forum859.mas
2 file(s) copied.
----------------------------------------------------
Here's the contents of forum859.csv in directory \\some\network\drive\forum
----------------------------------------------------
"COUNTRY","CAR"
"ENGLAND","JAGUAR"
"ENGLAND","JENSEN"
"ENGLAND","TRIUMPH"
"FRANCE","PEUGEOT"
"ITALY","ALFA ROMEO"
"ITALY","MASERATI"
"JAPAN","DATSUN"
"JAPAN","TOYOTA"
"W GERMANY","AUDI"
"W GERMANY","BMW"
---------------------------------------------------
Here's the contents of forum859.mas in directory \\some\network\drive\forum
---------------------------------------------------
FILE=FORUM859 ,SUFFIX=COMT
SEGNAME=FORUM859,SEGTYPE=S01
FIELDNAME =COUNTRY ,E01 ,A10 ,A10 ,$
FIELDNAME =CAR ,E02 ,A16 ,A16 ,$
---------------------------------------------------
Hope this helps.
Jim
May 19, 2006, 12:28 PM
TerryWAparna, on that last sample you submitted, change the statement:
ON TABLE HOLD AS myhold FORMAT COMMA
to
ON TABLE HOLD AS HOLDINGS FORMAT COMMA
I use an older version of Focus and use FORMAT LOTUS for this, but if COMMA is valid, then this should work.
May 22, 2006, 03:12 AM
<Aparna>I tried the following:
TABLE FILE CAR
PRINT
CAR
BY COUNTRY
ON TABLE HOLD AS FORUM859 FORMAT COMT
END
-*
CMD COPY FORUM859.* C:\TEMP\BRIO
Message given is:
0 NUMBER OF RECORDS IN TABLE= 10 LINES= 10
(FOC1569) SYSTEM COMMANDS DISABLED. CAN NOT EXECUTE cmd COPY FORUM859.*
C:\TEMP\BRIO
No files were written in teh path specified. My IBI version is : 524
May 22, 2006, 09:28 AM
JimRiceAparna,
Try using a FILEDEF command as follows:
FILEDEF FORUM859 DISK \\some\network\drive\forum\forum859_test.csv
-*
TABLE FILE CAR
PRINT
CAR
BY COUNTRY
ON TABLE HOLD AS FORUM859 FORMAT COMT
END
Jim