Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
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 ( [id://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 (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!

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (3)
As of 2024-04-24 02:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found