Home » SQL & PL/SQL » SQL & PL/SQL » Procedure needed without creating arrays
icon9.gif  Procedure needed without creating arrays [message #391537] Thu, 12 March 2009 08:38 Go to next message
J1357
Messages: 33
Registered: November 2008
Member
Can someone give a procedure only without creating arrays ?
create table t1(col1 number,col2 varchar2(4000));
insert into t1 values (1111,'abcd');
insert into t1 values (1111,'bcde');
insert into t1 values (2222,'qwer');
insert into t1 values (2222,'asdf');
insert into t1 values (1111,'rtyuio');
commit;
SQL> select * from t1;

COL1 COL2
---------- -------------
1111 abcd
1111 bcde
2222 qwer
2222 asdf
1111 rtyuio

Now,
if the user gives i/p=1111,exp o/p=>'abcd$bcde$rtyuio'
i/p=2222,exp o/p=>'qwer$asdf'

I know this would be using max(decode(col2,col2,col2)) but i'm not able to put the same in loop..
Re: Procedure needed without creating arrays [message #391538 is a reply to message #391537] Thu, 12 March 2009 08:40 Go to previous messageGo to next message
BlackSwan
Messages: 25041
Registered: January 2009
Location: SoCal
Senior Member
You need to help us by following the Posting Guidelines as stated below.
http://www.orafaq.com/forum/t/88153/0/
Re: Procedure needed without creating arrays [message #391542 is a reply to message #391537] Thu, 12 March 2009 08:49 Go to previous messageGo to next message
Mahesh Rajendran
Messages: 10672
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
It is a frequently asked question with multiple solutions.
Search for STRAGG.
Re: Procedure needed without creating arrays [message #391545 is a reply to message #391537] Thu, 12 March 2009 08:52 Go to previous messageGo to next message
Mahesh Rajendran
Messages: 10672
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
http://www.orafaq.com/forum/m/345288/69655/?srch=stragg#msg_345288
Re: Procedure needed without creating arrays [message #391852 is a reply to message #391545] Sat, 14 March 2009 00:36 Go to previous message
J1357
Messages: 33
Registered: November 2008
Member
Thanks Mahesh for your valuable inputs.
Previous Topic: Primary Key Creation on a Large Table
Next Topic: flush buffer cache within stored procedure
Goto Forum:
  


Current Time: Tue Dec 06 12:36:27 CST 2016

Total time taken to generate the page: 0.21502 seconds