From: Robert Klemme Date: 2009-03-14T01:01:12+09:00 Subject: Re: OCI-8, Oracle : 'ORDER BY' doesn't work with 'bind_param' 2009/3/13 B. Randy : > # Request with 3 parameters. > request = "select * from emp > where SUBSTR(ENAME,1,LENGTH(:who)) = :who AND SAL > :paid order by :how" > cursor = connex.parse(request) > > # Bind the parameters. > cursor.bind_param(':who', 'A')      # This work. > cursor.bind_param(':paid', 1000)    # This work. > cursor.bind_param(':how', 'ENAME')  # !! This doesn't work ??? > cursor.exec() You cannot give the column name as a bind parameter. You either have to insert it when constructing the statement or you have to have several statements. Btw, I doubt that *any* RDBMS will allow to select a column used for ordering with a bind parameter because that changes semantics of the SQL statement. This would make a recompile of the SQL statement necessary because the execution plan will change every time you invoke it rendering bind parameters useless. Kind regards robert -- remember.guy do |as, often| as.you_can - without end