Long macro command string 
Author Message
 Long macro command string

I am trying to execute a long (over 254 characters) SQL SELECT statement
with a macro command.

I tried cutting the command in half and using '&string1.string2', but I
kept getting an Unrecognized keyword/command error.

Is there another way to do this?  Can you not split a SELECT statement
in half?

Thanks!

--
Jeff Davidson

 Los Angeles, CA



Wed, 20 Mar 2002 03:00:00 GMT  
 Long macro command string

Quote:

> I am trying to execute a long (over 254 characters) SQL SELECT statement
> with a macro command.

> I tried cutting the command in half and using '&string1.string2', but I
> kept getting an Unrecognized keyword/command error.

> Is there another way to do this?  Can you not split a SELECT statement
> in half?

You can write something like :

lcFieldsList = "field1, field2, ..."
LcWhereClause = "field1 = value1"

SELECT &lcFieldsList FROM myTable WHERE &lcWhereClause ...

Christian Desbourse (Belgium)



Thu, 21 Mar 2002 03:00:00 GMT  
 Long macro command string

Quote:


>> I am trying to execute a long (over 254 characters) SQL SELECT statement
>> with a macro command.

There's a limit to the length of a vfp (or maybe sql) command. In 2.6 I found this to be about 1K. In my case, I was able
to get around it by changing the column names to a,b,c,d..... but this was a very specialised situation and would be
rarely acceptable to name columns in such a way.

I suspect that the limit in vfp6 is (somewhat) longer but haven't needed to test it.

anthony shipley

<math> 2 + 2 = 5 for sufficiently large values of 2</math>



Thu, 21 Mar 2002 03:00:00 GMT  
 Long macro command string
Jeffrey,

Your macro needs to be

&string1.&string2

David Dunetz
SweetWARE

Quote:

>I am trying to execute a long (over 254 characters) SQL SELECT statement
>with a macro command.

>I tried cutting the command in half and using '&string1.string2', but I
>kept getting an Unrecognized keyword/command error.

>Is there another way to do this?  Can you not split a SELECT statement
>in half?

>Thanks!

>--
>Jeff Davidson

> Los Angeles, CA



Fri, 22 Mar 2002 03:00:00 GMT  
 Long macro command string
Please... forget my english but...
you can try with character array or writing a low level file with fcreate
fwrite(several SQL command lines)  fclose, naming it something.PRG and then
DO something.PRG

Andrea



Quote:
> I am trying to execute a long (over 254 characters) SQL SELECT statement
> with a macro command.

> I tried cutting the command in half and using '&string1.string2', but I
> kept getting an Unrecognized keyword/command error.

> Is there another way to do this?  Can you not split a SELECT statement
> in half?

> Thanks!

> --
> Jeff Davidson

>  Los Angeles, CA



Fri, 22 Mar 2002 03:00:00 GMT  
 Long macro command string
This used to be a BIG problem in older versions of FoxPro.  Here's a couple
of tricks I used to have to use...

1) If you have the alias name in the fields, such as:

SELECT ;
    customer.lastname, ;
    customer.firstname ;
    FROM customer

...change it to...

SELECT ;
    c.lastname, ;
    c.firstname ;
    FROM customer c

2) For more savings, get rid of the blanks in the front of each line (yes,
FoxPro counts them!)...

SELECT ;
c.lastname, ;
c.firstname ;
FROM customer c

3) In really bad situations, do 2 SELECTS, grabbing the first half of the
fields (plus the key field),
then the second half (with the key field), and then do a third SELECT to
JOIN on the key field,
using the asterisk (*) wildcard, as in:

SELECT a.*, b.* FROM a JOIN b on a.key == b.key

...performance probably won't be affected much at all, since RUSHMORE
concentrates on the
WHERE clause.

Good luck!
John Baerg



Mon, 25 Mar 2002 03:00:00 GMT  
 
 [ 8 post ] 

 Relevant Pages 

1. String for Pass Through command too long

2. Long, long character string

3. Help: String to Long to fit!

4. STRTRAN() to fix ASCII: Error 1903: String is too long to fit

5. String too long in PICTURE "@M"

6. ?? long strings?

7. string to long error

8. Beware the String Too Long To Fit

9. Long string problems

10. Help Anyone (who has experience processing Long Ascii Strings)

11. how long can a string be ?

12. String is too long to fit

 

 
Powered by phpBB® Forum Software