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

Home -> Community -> Usenet -> c.d.o.server -> Re: How to "order by" on long data type

Re: How to "order by" on long data type

From: Stan Brown <stanb_at_panix.com>
Date: 28 Aug 2001 18:16:31 -0400
Message-ID: <9mh57v$8pq$1@panix3.panix.com>


In <9mg7qq031dv_at_drn.newsguy.com> Thomas Kyte <tkyte_at_us.oracle.com> writes:

>ops$tkyte_at_ORA815> create or replace function get_long( p_pk_name in varchar2,
> 2 p_pk_val in varchar2,
> 3 p_long_name in varchar2,
> 4 p_tname in varchar2 ) return varchar2
> 5 is
> 6 l_long long;
> 7 begin
> 8 execute immediate
> 9 'select ' || p_long_name || ' from ' || p_tname ||
> 10 ' where ' || p_pk_name || ' = :x'
> 11 into l_long
> 12 using in p_pk_val;
> 13
> 14 return substr( l_long, 1, 4000 );
> 15 end;
> 16 /

>Function created.

>ops$tkyte_at_ORA815>
>ops$tkyte_at_ORA815> column sc format a40
>ops$tkyte_at_ORA815>
>ops$tkyte_at_ORA815> select constraint_name,
>2 get_long( 'constraint_name', constraint_name, 'search_condition',
>'user_constraints' ) sc
> 3 from user_constraints
> 4 where rownum < 5
> 5 /

>CONSTRAINT_NAME SC
>------------------------------ ----------------------------------------
>SYS_C00790 "OWNER" IS NOT NULL
>SYS_C00791 "OBJECT_NAME" IS NOT NULL
>SYS_C00792 "OBJECT_ID" IS NOT NULL
>SYS_C00793 "CREATED" IS NOT NULL
Cool, thanks very much! Received on Tue Aug 28 2001 - 17:16:31 CDT

Original text of this message

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