Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^3: DBD::Sybase prepare statement returns empty query hash but no errstr

by Jenda (Abbot)
on Oct 31, 2019 at 12:23 UTC ( #11108169=note: print w/replies, xml ) Need Help??


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 (Curate) 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!

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://11108169]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (5)
As of 2020-04-08 18:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    The most amusing oxymoron is:
















    Results (45 votes). Check out past polls.

    Notices?