TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Sai Ram
NA
237
115.8k
How to write dynamic select stored Procedure
Aug 22 2012 7:52 AM
How to write dynamic select stored Procedure
I wrote some code like this ...Please correct it and revert back..
create or replace
PROCEDURE SAMPLE
( p_filter_column IN out Varchar2,
p_filter_operator_name IN out varchar2,
p_filter_value IN out varchar2,
p_page_size IN out varchar2,
p_current_page IN out INT,
p_sort_column IN out varchar2,
p_sort_direction IN out varchar2,
p_table_name IN out varchar2
)
IS
condition_string varchar(300);
row_start int;
excute_string varchar(300);
Begin
condition_string:= p_filter_column || p_filter_operator_name || p_filter_value;
If (p_current_page > 1) then
row_start:= to_number(p_current_page) * to_number(p_page_size);
else
row_start:=1;
end If;
excute_string:='SELECT * FROM ' || p_table_name || 'WHERE' || condition_string || 'AND ROWNUM >' || row_start || 'order by' || p_sort_column || p_sort_direction;
EXECUTE IMMEDIATE excute_string;
End;
Reply
Answers (
2
)
how to create a new database in sqlplus
how to insert the data in 2 tables in pl/sql stored procedure?