Solved

vfp9 Select * Command   field name in correct

Posted on 2013-01-05
6
659 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
Industry Leaders: 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

Webinar: Aligning, Automating, Winning

Join Dan Russo, Senior Manager of Operations Intelligence, for an in-depth discussion on how Dealertrack, leading provider of integrated digital solutions for the automotive industry, transformed their DevOps processes to increase collaboration and move with greater velocity.

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…
Had a business requirement to store the mobile number in an environmental variable. This is just a quick article on how this was done.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

734 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