Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Help:Pl/SQL Pass variable for sequence into SQL Select
morris_gary_at_bah.com wrote:
> I'm somewhat of a beginner trying to write a fairly simple sequence
> .....
> FUNCTION getRpuInsert(Client IN VARCHAR2) RETURN NUMBER IS --
> Client=0021
> v_Result VARCHAR2(100);
> CURSOR c_getRpuInsert IS
> SELECT 's'||Client||'.NEXTVAL'
> FROM DUAL;
> BEGIN
> OPEN c_getRpuInsert;
> FETCH c_getRpuInsert INTO v_Result;
> RETURN v_Result;
> END getRpuInsert;
> _________
Hi Gary,
try
select sequence_name.nextval into v_Result from dual; (to get the actual number)
and then concat the string like
Result := 's'||Client||'.'||v_Result; (if you want a dot in your
result string)
or
Result := 's'||Client||v_Result;
and then return the complete result string in Result.
it's only a hint.
I didn't test this possible solution.
best wishes and good luck
Udo
Received on Thu Jul 10 1997 - 00:00:00 CDT
![]() |
![]() |