Received: from localhost (unknown [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id A2DDC2E0052 for ; Wed, 30 Jan 2008 06:35:58 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 24328-02 for ; Wed, 30 Jan 2008 06:35:50 -0400 (AST) Received: from smtp-out.mail-atlas.net (smtp-out.mail-atlas.net [212.47.13.37]) by postgresql.org (Postfix) with ESMTP id 20A052E003D for ; Wed, 30 Jan 2008 06:35:55 -0400 (AST) X-ASG-Debug-ID: 1201689351-7e5a038f0000-hAWazd X-Barracuda-URL: http://212.47.13.37:80/cgi-bin/mark.cgi Received: from bobek (unknown [10.0.0.49]) by smtp-out.mail-atlas.net (Spam Firewall) with ESMTP id D6997163B43 for ; Wed, 30 Jan 2008 11:35:51 +0100 (CET) Received: from bobek ([10.0.0.49]) by smtp-out.mail-atlas.net with ESMTP id grnoYq2eucWFTn7E for ; Wed, 30 Jan 2008 11:35:51 +0100 (CET) From: "Jaroslav Sivy" To: pgsql-sql@postgresql.org Message-ID: Date: Wed, 30 Jan 2008 11:35:51 +0100 X-Priority: 3 (Normal) X-ASG-Orig-Subj: Sql ORDER BY and ASC/DESC question Subject: Sql ORDER BY and ASC/DESC question x-sender: x-receiver: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_1494ef3b_e945_47e3_a761_5d67f82b4a5a" X-Barracuda-Connect: UNKNOWN[10.0.0.49] X-Barracuda-Start-Time: 1201689351 X-Barracuda-Virus-Scanned: by SMTP-out at mail-atlas.net X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using global scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=7.0 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.40868 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.001 tagged_above=0 required=5 tests=BAYES_50=0.001 X-Spam-Level: X-Archive-Number: 200801/226 X-Sequence-Number: 30079 This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. ------=_NextPart_1494ef3b_e945_47e3_a761_5d67f82b4a5a Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hello everyone, I have following problem: am using pl/sql functions to trigger some sql= code and i need to pass ORDER_BY column name and ASC/DESC sorting orde= r as an input parameters into that function and order the result based on these input parameters=2E The problem is, that the only way is to create query as "string" and th= en execute it as "string"=2E Is there any other way around how to avoid that "string query"? (i don't want to use IFs either, because 5 columns x 2 sorting orders w= ould require 10 IFfed queries with different column/sorting order combi= nation) If it's not possible, could anyone implement this feature into one of f= uture versions? I think that it would be quite handy to have something = like that=2E Thank you for your responses=2E ------------------- Menu=2Esk - Denne aktualizovany zoznam obedovych menu a restauracii s p= resnou lokalizaciou=2E=20 ------=_NextPart_1494ef3b_e945_47e3_a761_5d67f82b4a5a Content-type: text/plain Content-Transfer-Encoding: base64 Content-Description: attachment.txt Content-Disposition: attachment; filename="attachment.txt" ICBQdXQgdGhlIHRleHQgb2YgdGhlIHdlbGNvbWUgbWVzc2FnZSBoZXJlLg0KDQo= ------=_NextPart_1494ef3b_e945_47e3_a761_5d67f82b4a5a--