Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: order by problem with stored procedure

Re: order by problem with stored procedure

From: <sybrandb_at_yahoo.com>
Date: 31 May 2006 04:04:38 -0700
Message-ID: <1149073478.406941.180290@y43g2000cwc.googlegroups.com>

Alen Cappelletti wrote:
> Hi,
> I try to short dinamically the result my stored procedure.
> SP seems not validate the field passed.
>
> I try durectly from my query sw with -ORDER BY 'no word' -
> and effecly ther is no error and record return are the same present
> ordered into the table.
> So I think the problem is in the SP.
> The field passed is read like varchar.
> No i'ts impossible pass teh real name dinamically or I must use
> numbers?
> Like ORDER BY 1....
>
> Thanks,
> Alen Italy
> ------
> CREATE OR REPLACE PACKAGE BODY "PKG_UTENTI" AS
> PROCEDURE Utenti(
> strCookieMD5 IN varchar2,
> intDaRs IN number,
> intArs IN number,
> strOrdinamento IN varchar2,
> OBJ_CUR_Utenti OUT CUR_Utenti
> )
> AS
> var_TotaleRs number;
> BEGIN
>
> --Tot record
> SELECT
> NVL(Count(*),0)
> INTO
> var_TotaleRs
> FROM UTENTI
> WHERE (STATO = 1);
>
> --Rs principale
> OPEN OBJ_CUR_Utenti FOR
>
> SELECT
> u.*,
> var_TotaleRs TotRs,
> rownum SeqNum,
> strOrdinamento Ord
> FROM UTENTI u
> WHERE (STATO = 1)
> ORDER BY strOrdinamento;
>
> END Utenti;
> END PKG_UTENTI;
I already explained to you you needed *dynamic sql*. What in that explanation you didn't understand, so you reposted this?

-- 
Sybrand Bakker
Senior Oracle DBA
Received on Wed May 31 2006 - 06:04:38 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US