| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.theory -> Re: Self documenting program in SQL
On 20 May 2005 11:42:34 -0700, "Vadim Tropashko"
<vadimtro_invalid_at_yahoo.com> wrote:
>Did anybody write a query that duplicates itself as an output in SQL
>yet? In the list of languages at
>
>http://www.nyx.net/~gthompso/quine.htm
>
>SQL is absent.
In Postgres:
SELECT substr(source,1,93) || chr(39) || source || chr(39) || substr(source,94) FROM (SELECT 'SELECT substr(source,1,93) || chr(39) || source || chr(39) || substr(source,94) FROM (SELECT ::text as source) q;'::text as source) q;
This should work with slight modifications in other systems.
/Nis
-- Nis Jorgensen Midlertidigt uden ae oe og aa. Jeg beklager.Received on Sat May 21 2005 - 05:40:36 CDT
![]() |
![]() |