Solved

vfp9 Select * Command   field name in correct

Posted on 2013-01-05
6
666 Views
Last Modified: 2013-01-07
Hi experts
I have a table called  customer and it has field email_offer
when i use the following

select * from customer into table temp

when I open table temp it has field
                                                         email_offe

r is missing of that field.

Please help
0
Comment
Question by:b001
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 3

Expert Comment

by:peterhupp
ID: 38747041
Is it a free table?  Long file names need to be part of the DBC.  

See "How to: Name Fields" in vfp help

You specify names for fields as you build a table. For free tables, field names can be up to 10 characters long. For database tables, field names can be up to 128 characters long.

So if your customer table was inside the DBC the query would show the long file names
0
 
LVL 29

Assisted Solution

by:Olaf Doschke
Olaf Doschke earned 250 total points
ID: 38747072
Select INTO CURSOR and the field name will not be truncated. Selecting INTO TABLE creates a free table, which only can have short field names.

Bye, Olaf.
0
 
LVL 42

Assisted Solution

by:pcelba
pcelba earned 250 total points
ID: 38747075
You may simply place the output table into some temporary database:

CREATE DATABASE SYS(2023) + '\TempDatabase'
select * from customer into table temp DATABASE TempDatabase
BROWSE

If you create a cursor instead of the table then you may use long field names without database creation.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:b001
ID: 38747105
my table customer is part of a dbc

when I copy it to cursor like

select * from customer into cursor test

it is ok. it does have full field name

but when I copy it to a table

select * from customer into table temp

all the field name are  10 character.

Please help
0
 
LVL 29

Assisted Solution

by:Olaf Doschke
Olaf Doschke earned 250 total points
ID: 38747118
You already have the answer, why it's that way.

There is no way to change the limitations of free tables, so if you need a DBF with the same field name, first create a DBC and add the DATABASE clause, as in Pavels answer. You may also simply USE customer, and then COPY TO, also using the DATABASE clause.

Bye, Olaf.
0
 
LVL 42

Accepted Solution

by:
pcelba earned 250 total points
ID: 38747168
One question: Why do you need the temp table?

VFP offers cursors which are much better for temporary use. Tables are derived for permanent data storage where the name "temp" is not so relevant probably... Could you imagine several processes each one creating the temp.dbf? Of course, it is OK for this simple testing purpose.

So, to create the table having long field names you will need to open or create a database container (DBC) which preserves long field names (field names stored in the table are still 10 chars max).

Theoretically you could use the same database which is used for customer table but the temp table creation in this database would mean the garbage creation which is not good practice.
0

Featured Post

The Orion Papers

Are you interested in becoming an AWS Certified Solutions Architect?

Discover a new interactive way of training for the exam.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft Visual FoxPro (short VFP) is a programming language with it’s own IDE and database, ranking somewhat between Access and VB.NET + SQL Server (Express). Product Description: http://msdn.microsoft.com/en-us/vfoxpro/default.aspx (http://msd…
Part Two of the two-part Q&A series with MalwareTech.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…

622 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question