Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
What is missing
Message
From
25/05/1999 08:31:49
 
 
To
25/05/1999 06:50:23
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Miscellaneous
Thread ID:
00222382
Message ID:
00222417
Views:
19
>I want to create a new table using all fields of another table
>
>create table products_tmp as;
>select * from products_tbl
>

If all you want to do is duplicate the structure, not pulling out any records:

USE products_tbl
COPY STRUCTURE TO products_tmp

IF this is truly a temporary table that you want to have go away automagically when you close it:

USE products_tbl
LOCAL aFldList[1,16]
=AFIELDS(aFldList)
CREATE CURSOR products_tmp FROM ARRAY aFldList

If you want to pull some of the data into the table:

SELECT * FROM products_tbl ;
INTO TABLE products_tmp ;
WHERE record selection conditions

If the data you pull here is read-only, you could use INTO CURSOR to create a read-only cursor here.

Lots of ways to skin this cat...

>The syntax is wrong ????????
>I am working from an ansi standard sql book and I'm stuck !!!!!!
>
>any sample code of other sql basic commands would be great and save me many frustrating hours.
>
>Best wishes
>Colette
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform