×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

SQL against a hold file ?

SQL against a hold file ?

SQL against a hold file ?

(OP)
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 ?

RE: SQL against a hold file ?

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.

RE: SQL against a hold file ?

Hellow!

YOU CAN SELECT * FROM HOLD, THE FOLLOWING.

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

GOOD LUCK!

RE: SQL against a hold file ?

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.   

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close