http://www.perlmonks.org?node_id=11108169


in reply to Re^2: DBD::Sybase prepare statement returns empty query hash but no errstr
in thread DBD::Sybase prepare statement returns empty query hash but no errstr

The thing is there's no need to close and reopen the string literal. You are working too hard and if you then need to copy&paste the SQL elsewhere you have to work again.

my $st = $dbh->prepare(q[ SELECT foo, bar, baz FROM whatever WHERE foo = xyz AND bar IS NOT NULL AND ... ]);

Jenda
1984 was supposed to be a warning,
not a manual!

  • Comment on Re^3: DBD::Sybase prepare statement returns empty query hash but no errstr
  • Download Code

Replies are listed 'Best First'.
Re^4: DBD::Sybase prepare statement returns empty query hash but no errstr
by jcb (Parson) on Nov 01, 2019 at 03:46 UTC

    You do have to close and reopen the literal if you want Emacs to indent your code properly. Emacs indentation commands will not change multi-line string constants.

      The decision is yours. I'd rather have to eventually (un)indent a bit of SQL manually after some refactoring, than to have to add lots of cruft after pasting the SQL into the code and remove the cruft again when copying the SQL somewhere. With syntax highlighting it's going to stand out enough even if not indented properly.

      Jenda
      1984 was supposed to be a warning,
      not a manual!