Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL doesn't format the way I want
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00484563
Message ID:
00484877
Views:
11
>>>>>>>Well, it creates now N 5 for both fields :( So, it's not that easy, as I hope...
>>>>>>
>>>>>>Well, can't find anything else... Looks like you'll have to mess with SET DECIMALS after all... :(
>>>>>
>>>>>Hi Sylvain,
>>>>>
>>>>>I was hoping to use just Query, without transformation after it (XForm). But this seems to be unresolved dilemma. If I would do it in a Query, I have to set decimals to 0 and then restore it back. I should use some property of global object... It becomes quite complicated.
>>>>
>>>>Nadya,
>>>>
>>>>What's the requirement for having this as a numerical value? It would seem to me that these sort of values can't be used in any sort of calculation, and the rule of thumb in these sort of instances is to use a character data type.
>>>
>>>This is the format, the customer wants. Actually, this customer needs comma-delimited file, so the field length is not that important (e.g. it could be Numeric 5), but it has to be Numeric.
>>
>>Nadya,
>>
>>So you have to put out a comma delimited string. Why then convert a string value to a numeric and then back again? Whether you retrieve a numeric or a string when you put it out as comma delimited it makes no difference. FWIW, numerics (type N) are stored in Fox tables as strings anyway.
>
>George,
>
>Character data are surrounded by quotes in comma-delimited file, while numeric don't. IOW,
>
>Town C4 Year N2 Period N2
>"AVON",0,12
>
>So, it DOES make a difference. Anyway, Yuri's solution perfectly suits my needs. Since the table is pre-populated, I don't have empty data in cYear or Period fields.

You're talking about a DELIMITED file, not DELIMITED WITH ,. IOW, a delimited with comma (COPY TO < filename > TYPE DELIMITED WITH ,)would put out:

,AVON,,0,,12,

A delimited file (created with COPY TO < filename > TYPE DELIMITED), puts out what's shown above.
George

Ubi caritas et amor, deus ibi est
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform