Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

field from numeric to character
How to change the type of a field from numeric to character without
changing the value of its content(field) ?


Report this thread to moderator Post Follow-up to this message
Old Post
happy
05-24-05 01:55 AM


Re: field from numeric to character
STR(x,l,d)
x = content of the field
l = total length of the field
d = decimal(s)

"happy" <ehab_aziz2001@yahoo.com> wrote in message
news:1116885250.301996.150430@f14g2000cwb.googlegroups.com...
> How to change the type of a field from numeric to character without
> changing the value of its content(field) ?
>



Report this thread to moderator Post Follow-up to this message
Old Post
mno
05-24-05 01:55 AM


Re: field from numeric to character
happy wrote:
> How to change the type of a field from numeric to character without
> changing the value of its content(field) ?

You can't change a DBF's structure once created.  Basically, you will
have to create a new dbf with the desired structure and copy your
existing data into it, manually converting any fields that have changed
(in your case, the single numeric field) and copying those that didn't.

--
Ray Marron


Report this thread to moderator Post Follow-up to this message
Old Post
Ray Marron
05-24-05 01:55 AM


Re: field from numeric to character
happy wrote:
> How to change the type of a field from numeric to character without
> changing the value of its content(field) ?
>

First, copy the .dbf to text file.

use oldb
copy to oldb deli && creates oldb.txt in delimited format
copy structure extended to estru

The file estru.dbf is a table that describes the structure of oldb.dbf
in exquisite detail. Find the numeric field entry of interest and change
its type to 'C' and decimals to 0.

create newb from estru
use newb
append from oldb deli

La voila.
--
Joe Wright                            mailto:joewwright@comcast.net
"Everything should be made as simple as possible, but not simpler."
--- Albert Einstein ---

Report this thread to moderator Post Follow-up to this message
Old Post
Joe Wright
05-24-05 08:55 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Clipper archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 10:26 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.