Home » RDBMS Server » Server Administration » Conditional Select from PL/SQL tables.
Conditional Select from PL/SQL tables. [message #369886] Thu, 02 November 2000 04:47 Go to next message
tarun
Messages: 13
Registered: November 2000
Junior Member
I have a PL/SQL table consiting of 2 columns ,
col1 varchar2(20,
col2 number(16,2).

I have manegd to populate the values in the table with table values. I need to retrieve the value of col2 depending on certain value of col1. How do I do this. Is there a standard fetch function fo do this.

Thanks

Tarun
Re: Conditional Select from PL/SQL tables. [message #369912 is a reply to message #369886] Mon, 06 November 2000 14:40 Go to previous message
Suresh
Messages: 189
Registered: December 1998
Senior Member
There is no direct way to fetch and compare values in pl/sql table.. but same thing you can achieve by using for loop and scan through entire pl/sql table

e.g
for i in pl_sql_table.count loop
if pl_sql_table(i).colname1='XXX' THEN
localvar := pl_sql_table(i).colname2;
exit;
end if;
end loop;

Suresh
Previous Topic: Pro*COBOL in PL/SQL
Next Topic: Autoincrement Identity Field
Goto Forum:
  


Current Time: Fri May 03 12:05:57 CDT 2024