>
> I have a table and I would like to reproduce the structure of it in an SQL
> command and/or to create a cursor exactly like it.
>
> Is there a way I can do this?
select the_table
=afields(aStru)
create cursor whatever_the from array aStru
rele aStru
Now you have a cursor with identical structure as the table. Just beware
the old bug - if any of the field names in the table begins with an
underscore, this won't work.
For SQL, simple
Sele * from the_table into the_cursor
....gives you the identical structure, but all the data as well, and the
cursor is read_only (you can work around this opening it AGAIN in
another workarea with a different alias). You can (I've just tried it
now)
Sele * from the_table into the_cursor where .f.
and you get empty cursor with identical structure.