ex: take one schema in that t1,t2,.....tn tables and you
don't no the table name also.
write a procedure if enter columns name then display the
maching columns .otherwise display the unmatch columns.
Answer / rajesh venati
create or replace procedure pro(cname in varchar2)
is
n number:=0;
cursor ecur is select column_name from user_tab_columns;
begin
for i in ecur loop
if i.column_name=cname then
n:=n+1;
end if;
end loop;
if n>=1 then
dbms_output.put_line('column matched');
else
dbms_output.put_line('column unmatched');
end if;
end;
-----------------------------------------------------
SQL> exec pro('EMPNO');
column matched
PL/SQL procedure successfully completed.
SQL> EXEC PRO('RAJESH');
column unmatched
PL/SQL procedure successfully completed.
SQL> EXEC PRO('DEPTNO');
column matched
PL/SQL procedure successfully completed.
SQL> EXEC PRO('HISAL');
column matched
PL/SQL procedure successfully completed.
Is This Answer Correct ? | 6 Yes | 1 No |
How many sql commands are there?
i have a table eno dno sal 1 10 200 2 10 150 3 10 100 4 20 75 5 20 100 i want to get sal which is less than the avg sal of thri dept. eno dno sal 2 10 150 3 10 100 4 20 75
who introduced sql?
What is the primary key?
What is a common use of group by in sql?
What is pivot table in sql?
How do you optimize a stored procedure in sql?
What are all different types of collation sensitivity?
Where are my tempfiles, I don't see them in v$datafile or dba_data_file?
I have following column in the table. col1 1 a b c 2 3 d and I want to display it as num chars 1 a 2 b 3 c 4 d numbers in one column and letters in another column.
what are the limitations of mysql in comparison of oracle? Mysql vs. Oracle. : Sql dba
Write a query to get 2nd maximum salary in an employee table ?
69 Answers Accenture, BirlaSoft, Letse, Logica CMG, Qwest, Rheal Software, Saagam, Semantic Space, Tailor Solution, TCS, TinyERP,