Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Convert table structure to create cursor
Message
From
01/11/2002 15:21:26
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00717941
Message ID:
00718004
Views:
14
If all you're doing is duplicating the table structure in memory into a cursor, then all you really need is:
AFIELDS(aArray, 'mytable')
CREATE CURSOR temp from Array aArray
Alan

>>You can use SELECT statement to do that.
SEELCT * ;
>>  FROM mytable ;
>>  WHERE 1=2 ;
>>  INTO CURSOR crsMycursor READWRITE
>>
>>>Is there a fast way to create a new cursor by copying the table structure field name and character type. I have a temporary table that has 157 fields, and I now want to use a temporary cursor. However, I have so many fields to define for cursor and was wondering the quickest way to create cursor definition from existing table stucture.
>>>
>>>Thanks
>>>Nick Patel
>
>Thank for replying back Sergey, actually your solution works well, but I am trying to get rid of my temporary table, and I need to dynamically create a cursor as follows:
>
>
>CREATE CURSOR download_table1 (t1_ipin c(10), t1_ccdn1 c(10), t1_ccdn2 c(10), t1_ds d, t1_ts c(4), ;
>					t1_sn c(3), t1_aft c(1), t1_df d, t1_tf c(4), t1_cen c(9), ...
>
>
>is there way I can assembly my cursor (this is a one time thing) without writing out eaching individual field name and type. The field names are a little bit wierd and there a about 157 of them.
>
>Thanks
>Nick
Previous
Reply
Map
View

Click here to load this message in the networking platform