Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Using variables in SELECT command
Message
De
08/07/1998 06:26:54
 
 
À
07/07/1998 10:10:27
Mandy Mccord
Public Interest Breakthroughs, Inc.
Albany, New York, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00114850
Message ID:
00115202
Vues:
14
>>Hi Mandy,
>> What errors are you getting? What is the content of the variables?
>> Keep in mind that if you are instructing SQL to place a file in a non-existent subdirectory, SQL will fail--it will not automatically create the subdirectory. Your syntax looks fine and what you are trying to do should work. Your error is probably in the contents of your variables. I suggest halting the execution of the program just before the SQL Select statement and examining the contents of the variables. That will probably point you to the problem.
>> Regards, Chaim
>
>Hi Chaim,
>The error I'm getting is "Command contains unrecognized phrase/keyword". Here's my Select statement exactly:
>
> SELECT * FROM &y INTO TABLE c:\ird96\surveys\&x\&y WHERE acode=&x

Try:
DECLARE aTest[1.5]
IF ADIR(aTest,'c:\ird96\surveys\'+x,'D') = 0
   MKDIR ('c:\ird96\surveys\'+x)
ENDIF
SELECT * from (y) INTO TABLE ('c:\ird96\surveys\'+x+'\'+y) WHERE acode = x
>
>y=SYSTEM (the name of one of my files), x=00640 (char string & code for one of my agencies), and I do have a c:\ird96\surveys\00640 directory before running the command.
>
>Will my 'WHERE acode=&x' realize that &x is a character string, not a number?
>
>I just tried doing the above but using the actual values (SYSTEM & 00640) in place of the variables and it works fine.
>
>Any ideas?
>
>Mandy
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform