in reply to Re: uninitialized value in Tk::DBI::Table
in thread uninitialized value in Tk::DBI::Table

Hi zentara,

I initialized $sql_query & $dbh, but it doesn't help me. The following below is a print of $sql_query and the message that is being generated when one clicks on first column:

select cdate AS 'Creation Date/Time', case when statusType = '1' then 'Debug' when statusType = '2' then 'Info' when statusType = '3' then 'Warning' when statusType = '4' then 'Error' else 'unknown' end as Status, statusValue AS 'Description' from statusmessages order by cdate desc LIMIT 100


Use of uninitialized value in string eq at E:/Perl/site/lib/Tk/DBI/Table.pm line 294.
Use of uninitialized value in string eq at E:/Perl/site/lib/Tk/DBI/Table.pm line 294.
Use of uninitialized value in string eq at E:/Perl/site/lib/Tk/DBI/Table.pm line 294.
Use of uninitialized value in string eq at E:/Perl/site/lib/Tk/DBI/Table.pm line 294.


Note that the message is being generated 4 times -> I click only 1 time...

Replies are listed 'Best First'.
Re^3: uninitialized value in Tk::DBI::Table
by TonyDonker (Novice) on Feb 16, 2005 at 15:22 UTC
    I think you just CAN'T sort the first column if you put:

    -display_id => 1,

    switch for displaying the index column...

    Is that right?
Re^3: uninitialized value in Tk::DBI::Table
by zentara (Cardinal) on Feb 16, 2005 at 18:53 UTC
    Well I can barely feel my way around DBI stuff myself, and I've never used Tk::DBI::Table, so I really can't say what the glitch is. Maybe someone else knows. All I can tell you to do is this: try to get the simplest example possible which works the way you want. Then start adding the extras into it, until it fails, then try to sort out the reason. So maybe try a very simple $sql_query statement, and see if you can get it to work, like "select * from statusmessages" or whatever is the simplest. You probably have some syntax error in the $sql_query.

    Like for starters...you have

    when statusType = '1' then 'Debug'
    maybe that should be == (or eq) not = ; which is sort of hinted at in the error message 4 times....

    Use of uninitialized value in string eq

    = is for assignment

    == or eq is for testing equality

    You may need 'eq' if you quote your numbers.


    I'm not really a human, but I play one on earth. flash japh
      The '=' you are referring to is from a sql statement, not a perl statement, so it is for equality, not assignment.
        Yes, but he did have his numbers quoted, like '1' , '2'; and he did get 4 errors, one for each line with a style like
        = '1' = '2' = '3' = '4'
        saying "unitililized eq in statement...". So why is the error saying 'eq' if it's supposed to be = ?

        Is it the quoted numbers, or should it be 'eq'; or if he unquotes his numbers, == ?


        I'm not really a human, but I play one on earth. flash japh