Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

vfp9 Select * Command   field name in correct

Posted on 2013-01-05
6
Medium Priority
?
679 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 30

Assisted Solution

by:Olaf Doschke
Olaf Doschke earned 1000 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 43

Assisted Solution

by:pcelba
pcelba earned 1000 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
Certified OpenStack Administrator Course

We just refreshed our COA course based on the Newton exam.  With 14 labs, this course goes over the different OpenStack services that are part of the certification: Dashboard, Identity Service, Image Service, Networking, Compute, Object Storage, Block Storage, and Orchestration.

 

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 30

Assisted Solution

by:Olaf Doschke
Olaf Doschke earned 1000 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 43

Accepted Solution

by:
pcelba earned 1000 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

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…
What we learned in Webroot's webinar on multi-vector protection.
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

704 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