Professional Web Applications Themes

For NULL values. Getting "uninitialized value" error msg., d on't know why (Win32::ODBC) - PERL Beginners

>  Sorry to reply to my own post, but it seems that NULL values in the tables themselves cause the "uninitialized value" warnings. This seems like strange behavior-- if anyone can suggest a way to shut them down without losing -w, please make a suggestion... -Chris (again)...

  1. #1

    Default For NULL values. RE: Getting "uninitialized value" error msg., d on't know why (Win32::ODBC)



    Sorry to reply to my own post, but it seems that NULL values in the
    tables themselves cause the "uninitialized value" warnings.
    This seems like strange behavior-- if anyone can suggest a way to
    shut them down without losing -w, please make a suggestion...
    -Chris (again)
    Chris Guest

  2. #2

    Default Re: For NULL values. RE: Getting "uninitialized value" error msg., d on't know why (Win32::ODBC)

    McMahon, Chris wrote: 
    >
    >
    > Sorry to reply to my own post, but it seems that NULL values in the
    > tables themselves cause the "uninitialized value" warnings.
    > This seems like strange behavior-- if anyone can suggest a way to
    > shut them down without losing -w, please make a suggestion...
    > -Chris (again)
    >[/ref]

    That will depend on what FetchRow and Data are doing... maybe using DBI
    instead of Win32::ODBC?

    perldoc perllexwarn

    For more on silencing unwanted warnings...

    You aren't using 'strict' and I assume you are doing 'use Win32::ODBC'
    instead of with 1 colon, what does your real code look like...

    http://danconia.org
    Wiggins Guest

  3. #3

    Default Re: For NULL values. RE: Getting "uninitialized value" error msg., d on't know why (Win32::ODBC)

    Chris McMahon wrote: 
    >
    > Sorry to reply to my own post, but it seems that NULL values in the
    > tables themselves cause the "uninitialized value" warnings.
    > This seems like strange behavior-- if anyone can suggest a way to
    > shut them down without losing -w, please make a suggestion...[/ref]

    Hi Chris.

    The usual way of representing a NULL database value in Perl is as
    'undef' which is the value a scalar takes before it has been
    assigned.

    Change your code to:

    my values = map { defined() ? $_ : 'NULL' } $db->Data;
    print values;

    and the warning will go away. Beware, though, that you must
    change the 'NULL' strings back to undef if you need to write
    the data back to the database.

    HTH,

    Rob


    Rob Guest

Similar Threads

  1. Replies: 2
    Last Post: October 4th, 09:47 PM
  2. "null null" error on line -1
    By multiscan01 in forum Coldfusion - Advanced Techniques
    Replies: 3
    Last Post: August 10th, 06:20 PM
  3. "Unable to load library null" error?
    By ColdDrink in forum Coldfusion - Getting Started
    Replies: 0
    Last Post: August 4th, 07:18 PM
  4. odbc, oracle --> error "internal error occured"
    By biense1 in forum Coldfusion Server Administration
    Replies: 0
    Last Post: July 22nd, 03:15 PM
  5. Stuck email, getting error "undefined mailbox domainstring is null"
    By KIN618 in forum Coldfusion Server Administration
    Replies: 0
    Last Post: June 23rd, 11:22 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139