Re: Why character instead of numerics?

From: Cindy Winegarden (cindy_winegarden_at_msn.com)
Date: 09/15/04

  • Next message: Hitendra: "Re: C0000005 Error with Oracle Backend"
    Date: Tue, 14 Sep 2004 20:32:30 -0400
    
    

    Hi Tom,

    Please create some representative data -

    Create Cursor Test (CharField C(15))
    Insert Into Test Values ("AG548-CNN765-3")
    * etc.

    Then post the code you are using in your SQL and also the code for the
    function you are calling.

    -- 
    Cindy Winegarden  MCSD, Microsoft Visual FoxPro MVP
    cindy_winegarden@msn.com  www.cindywinegarden.com
    "Tom Edelbrok" <anonymous@anonymous.com> wrote in message 
    news:NvJ1d.20305$KU5.4794@edtnps89...
    > If is create a numeric field in a table and then browse the table (VFP 
    > 8.1)
    > it shows up right-justified in the column and is understood by VFP to be a
    > numeric (not numeric digits in a character string that looks like a 
    > number).
    >
    > However, if I decode a character string that is composed of various digits
    > using string functions like leftc or rightc, I will end up with a shorter
    > charcter string. For example, if I strip the '548' out of 
    > 'AG548-CNN765-3',
    > the '548' is still a string rather than a numeric. So I use the VAL()
    > function to change it to numeric, and the result goes into a cursor that I
    > browse. BUT the final result is still a character string!!! What am I 
    > doing
    > wrong?
    >
    > The numeric value (stripped out of the character string) is returned to me
    > by a function I made, ie: 'function whatever(thesourcestring) as integer'.
    > Yet it still gets returned as character (and shows up left justifed in the
    > column when browsed). If I use the '?' symbol from the command window to
    > display the VAL() of a numeric character string I get the correct result,
    > ie: '? val('123')' yields a number.
    >
    > So what am I doing wrong? All I want is to get a numeric back from the
    > string so that my 'inner join anothertable on thisnumber = thatnumber' 
    > will
    > work.
    >
    > Thanks for help in advance,
    >
    > Tom Edelbrok
    >
    > 
    

  • Next message: Hitendra: "Re: C0000005 Error with Oracle Backend"

    Relevant Pages

    • F is evil (was: XML::LibXML UTF-8 toString() -vs- nodeValue())
      ... And with C<use encoding 'utf8';> you'll get the same character string, ... A script is the complete program text, ...
      (comp.lang.perl.misc)
    • Why character instead of numerics?
      ... If is create a numeric field in a table and then browse the table (VFP 8.1) ... numeric (not numeric digits in a character string that looks like a number). ...
      (microsoft.public.fox.vfp.queries-sql)
    • Re: Cell formatting issue
      ... the query process select Preserve cell formatting ... The character string should be ... than opening it intoExceland found the character string did ... Looking at the .xls file I do not see a difference ...
      (microsoft.public.excel.misc)
    • Re: Question about Descriptors
      ... > let you effortlessly do math with numbers that were stored in strings. ... If you moved a character string with numeric characters ... I think I missed the posting that defined string processing. ... String processing includes a native ability to define character string variables ...
      (comp.os.vms)
    • Re: Can somebody point me in the right direction?
      ... ten from the ten character string. ... There should be little probability of entering a random character string ... If you use encryption you have a potential problem at the second black ...
      (sci.crypt)