>I have run some SQL statements that are less than 1000 characters. These I execute as a macro , ie
>cSQL = "create SQL view as select * from specs .... etc"
>&cSQL
>
>- this works in all cases.
>
>So the problem is when I text to file, compile the file and run it.
Hmm... if your goal is to run a long CREATE SQL VIEW statement I'm not sure why you're writing it out to a separate .PRG in the first place.
Some things you might try instead:
- this is really basic, but I've got to ask: you *do* know about the use of * in SELECT - SQL e.g.
SELECT ;
FROM MyTable...
SELECT ;
Spec.*, ;
...some other columns from other tables...
FROM Spec, OtherTables...
- use the alias clause for tables in the join. This can shorten the string length:
SELECT ;
A.Col1, ;
A.Col2, ;
... ;
FROM Spec A ;
...
Another thing you can do is use macro expansion for individual clauses in SELECT, rather than for the whole thing:
SELECT ;
&lcColumnExpression ;
FROM &lcJoinExpression ;
WHERE &lcWhereExpression ;
ORDER BY &lcOrderByExpression ;
...
Regards. Al
"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov
Neither a despot, nor a doormat, be
Every app wants to be a database app when it grows up