Loading ...
Sorry, an error occurred while loading the content.

Re: What is the return code for this statement?

Expand Messages
  • don94579
    Ahhh.... Thank you so much :-) ... need ... on to ... else ... the ... on. Are ... some ... script
    Message 1 of 3 , Nov 5, 2002
    • 0 Attachment
      Ahhh....
      Thank you so much :-)


      --- In perl-beginner@y..., "Jenda Krynicky" <Jenda@K...> wrote:
      > From: "don94579" <ddachner@e...>
      > > Here's a statement for a perl program I'm trying to utilize but I
      need
      > > to understand it before I can modify it.
      > >
      > > if( $webx->Sql( "select * from db where name = '$name' "))
      > > {
      > > if true i should get dropped here, right?
      > > }
      > > else
      > > {
      > > I'm getting data, but I get dropped into here.
      > > }
      > >
      > > I get data from the select statement which I can print out later
      on to
      > > verify, but I'm still dropping into the "not true" part of the
      else
      > > statement which leaves me a little confused. If data is returned,
      the
      > > it seems to me that I should drop into the True portion of the if
      > > statement unless I'm missing something. Not sure what is going
      on. Are
      > > there any return codes I can use? Any ideas?
      >
      > The ->Sql() is a method from Win32::ODBC right?
      >
      > From the docs:
      > Returns *?* on success, or an error number on failure.
      >
      > God knows what did Dave mean by the *?*, to me it seems that it
      > returns an undef if it succeeded. (I even looked into the code.)
      >
      > So just turn the condition around.
      >
      > Jenda
      >
      > P.S.: IMHO new scripts should use DBI+DBD::ODBC unless they need
      some
      > specific feature of Win32::ODBC. It will be easier to port the
      script
      > later this way.
      > ===== Jenda@K... === http://Jenda.Krynicky.cz =====
      > When it comes to wine, women and song, wizards are allowed
      > to get drunk and croon as much as they like.
      > -- Terry Pratchett in Sourcery
    Your message has been successfully submitted and would be delivered to recipients shortly.