Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^2: fetchall_arrayref hangs with placeholders query with no results

by afoken (Chancellor)
on Apr 18, 2021 at 10:46 UTC ( [id://11131425]=note: print w/replies, xml ) Need Help??


in reply to Re: fetchall_arrayref hangs with placeholders query with no results
in thread fetchall_arrayref hangs with placeholders query with no results

Maybe having no table confuses the system?

It should not. Executing a table-less query like

SELECT 42 AS result

works on most SQL databases. The remaining ones, Oracle being probably the most known example, always expects a dummy table or view, but also always provides that dummy table or view specifically for this purpose. Its name is DUAL on Oracle, and you need to use

SELECT 42 AS result FROM dual

on Oracle. Some databases also provide a table or view named DUAL just for Oracle compatibility.

See Wikipedia: DUAL table for a nice overview.

Alexander

--
Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)

Replies are listed 'Best First'.
Re^3: fetchall_arrayref hangs with placeholders query with no results
by erix (Prior) on Apr 18, 2021 at 11:18 UTC

    I know.

    PostgreSQL, for instance, knows how to since time immemorial (and certainly all maintained versions).

    SQL Server too (I checked all the same on sqlfiddle).

    In fact, I was writing a post to Marshall containing pretty much everything that you said...

    Anyhow, it seems the OP has lost interest, or maybe solved his problem.

      Still interested, just busy. My problem isn't solved, but I have an okay workaround for now: I'm not using placeholders in any of my queries. The other things that cause the hang (specifying a TDS level and a query that produces no results) aren't really an option to not do. Connecting with no TDS level doesn't work on my production machine.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (6)
As of 2024-04-18 05:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found