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: ianal Vista <ianal_vista_at_hotmail.com>
Date: Wed, 31 May 2006 13:32:38 GMT
Message-ID: <Xns97D442A96AD67ianalvistahotmailcom@70.169.32.36>


"Alen Cappelletti" <cocker_at_libero.it> wrote in news:1149082095.610699.144750_at_i40g2000cwc.googlegroups.com:

> This is my last code...I compile without error...but when run on my
> asp page got this error:
> ORA-01006: bind variable does not exist ORA-06512: at
> "MVS.PKG_UTENTI", line 35 ORA-06512: at line 1
>
>
> -------
> 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;
> var_Query varchar2(2000);
> BEGIN
>
> --Tot record
> SELECT
> NVL(Count(*),0)
> INTO
> var_TotaleRs
> FROM UTENTI
> WHERE (STATO = 1);
>
>
> var_Query := 'SELECT * FROM ( '||
> 'SELECT '||
> 'u.*, '||
> var_TotaleRs||'
> TotRs, '||
> 'rownum SeqNum '||
> 'FROM UTENTI u '||
> 'WHERE u.STATO = 1 '||
> 'ORDER BY
> '||strOrdinamento||
> ' )'||
> 'WHERE SeqNum > '||intDaRs||
> ' AND SeqNum <= '||intArs;
> --Rs principale
> OPEN OBJ_CUR_Utenti FOR var_Query USING var_TotaleRs,
> strOrdinamento,
> intDaRs, intArs;
> END Utenti;
> END PKG_UTENTI;
>
>

One thing to keep in mind is that privs acquired via a ROLE never apply within a PL/SQL procedure.

Which user/schema is invoking this code? Received on Wed May 31 2006 - 08:32:38 CDT

Original text of this message

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