Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re^2: dbi odbc return string getting truncated

by soonix (Canon)
on Aug 07, 2019 at 14:07 UTC ( [id://11104098]=note: print w/replies, xml ) Need Help??


in reply to Re: dbi odbc return string getting truncated
in thread dbi odbc return string getting truncated

I was astonished at first, too, but "AS" probably is optional. Don't know about OP's database, but for SQLite, it is for the result column (not in CAST, though).

My next question would be: what table or column definitions are used when there is no "FROM"?

  • Comment on Re^2: dbi odbc return string getting truncated

Replies are listed 'Best First'.
Re^3: dbi odbc return string getting truncated
by afoken (Chancellor) on Aug 07, 2019 at 18:42 UTC
    I was astonished at first, too, but "AS" probably is optional. Don't know about OP's database, but for SQLite, it is for the result column (not in CAST, though).

    Yes, that's standard SQL. The AS in column-or-expression AS alias is optional.

    My next question would be: what table or column definitions are used when there is no "FROM"?

    None.

    SELECT 42 AS RESULT

    is perfectly legal SQL. It returns a single row with - in this case - a single column with a type matching the type of the expression left of AS. Only Oracle insists on a table or view, and it has a dummy table called DUAL for exactly that purpose. So, Oracle wants

    SELECT 42 AS RESULT FROM DUAL

    See also DUAL_table, Selecting from the DUAL table.

    Alexander

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

Log In?
Username:
Password:

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

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

    No recent polls found