Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL against a hold file ?

Status
Not open for further replies.

jif26

Programmer
Oct 29, 2003
1
0
0
CA
Is it possible to use SQL against a HOLD file ?
For example :

TABLE FILE CAR
PRINT *
ON TABLE HOLD AS HOLD1
END

then

I want to do this

SELECT * FROM HOLD1

HOLD1 is not DB2...how can I achieve this, if possible ?
 
Your first TABLE command in the example you post creates a flat file which is not really recognized by SQL. If you need to select data, why not do it with the first TABLE command. SQL will work great against an RDB file and you can execute it from within FOCUS.

How about
TABLE FILE CAR
PRINT THE_FIELDS_I_WANT
WHERE ARGUMENT EQ FIELDX
ON TABLE HOLD AS HOLD1 FORMAT fmt
END

See Chapter 9 in WF5.2 Creating Reports for fmt

And fmt can be DB2

If you can provide more details as to what your requirements are, you can get a better answer.
 
Hellow!

YOU CAN SELECT * FROM HOLD, THE FOLLOWING.

TABLE FILE CAR
PRINT *
ON TABLE HOLD
END
SQL
SELECT * FROM HOLD;
END

GOOD LUCK!
 
SET SQLENGINE=SQLMSS -* In this case SQLServer
SQL SQLMSS
SELECT Field1, Field2 FROM PathToTable;
TABLE FILE SQLOUT
PRINT *
END

Make sure you put the semicolon after the select statement and that you
fully qualify your table names. You can look in
the acx files for the path to the table. Once the data is brought back
to the hold file called sqlout, you can then use focus to format the report
any way that you want.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top