Want to Create View as per Condition Fires After Parameter Form.

Hi ..
I want to create a report from a view,and that view would create after parameter form of that
report.
Example..
I want to select max(sal) of each Dept.where employee hired between 1-jan-2007 and 31-jul-2007'
I want when i Passes dates in Parameter FOrm
a view i.e select empno,deptno,sal, from emp created.
that means that view contains only data about that certain period
SO in Report Query i can write
select deptno,max(sal) from vw_employee
group by deptno.
This is just an example....my real problem is very hard and only can be done by doing create a view as per given dates in Report Parameter Form.
Waiting for Reply
Regards
Danish Hayder

Wrong ideea.
You should have the parameters in the report's query:
select empno,deptno,sal, from emp where hired between :p_start_date and :p_end_date
Why do you want to create a view in the report, seeing that it's best to use parameters.
Moreover, think that the oracle user running the report would have to have the priviledges to create views, which may not be good security policy.
Still, if you insist on creating the view when running the report, then you'd better create the view from a stored procedure, that would receive as parameter the SQL select for creating the view.
So, you'd have the stored procedure:
proc_view(p_select in varchar2, p_view_name in varchar2) is
begin
execute immediate 'create or replace view '||p)view_name||' as '||p_select;
end;
You then would compose the select in the afterpform trigger and call the proc_view procedure.
Note that I did not allow proc_view to execute immediate any SQL one would pass, for that would be really dangerous. What if one would pass to the procedure executing dynamic SQL the following: 'drop table my_table cascade constraints'?

Similar Messages

  • Creating Views

    Hi Frds,
    I wants to create views with the table T001P , T500P  and with my Z table. So kindly tell me wat are fields wants to add in the Z table for creating views with the table T001P and T500P...
    Thanks
    BY
    Pari

    Hi  Raja,
    these is the join Between T001P and T500P.
    here WERKS  is the Personal Area.
    Conditions
    T001P-WERKS = T500P-PERSA.
    SO YOUR ZTABLE MUST HAVE ONWERKS AS PRIMARY KEY.
    Regards.
    Eshwar.

  • Create view With Ref cursor data

    Hi friends,
    I want to create view as follows.
    Example:
    Create or replace v_name
    select job,sal, <funcation>
    from emp;
    Note:- Function not having out parameter.
    Function returning ref cursor values datatype.
    Requirement:-
    I want to create view even function returing ref cursor datatype.
    Please advise how to create view.
    Regards,
    Kishore

    user7284612 wrote:
    Hi friends,
    I want to create view as follows.
    Example:
    Create or replace v_name
    select job,sal, <funcation>
    from emp;
    Note:- Function not having out parameter.
    Function returning ref cursor values datatype.
    Requirement:-
    I want to create view even function returing ref cursor datatype.
    Please advise how to create view.You perhaps are misunderstanding what a ref cursor is. It does not contain data like a table, so cannot be treated as one.
    Take a read of this:
    PL/SQL 101 : Understanding Ref Cursors

  • Create View Object programattically from XML input

    Hi,
    I have requirement to create view object from xml at run time in ADF application. is there any way to create view object dynamically in java program from xml?
    My requirement is to call a webservice and generate view object from the response of the web service call.
    Thanks

    I want to create view objects from different web services and the same will be available to the developer at the time of development. I don't want to create web service proxies for each of the web service. this will simplify the developers task to create proxy and data controls. the one thing developer has to do is select the service and base on the service the view objects will be created to develop pages accordingly.

  • Create View table with multiple table

    I want to create View table with relation with multiple tables.
    for ex
    table 1
    mrnno
    mrnqty
    table 2
    mrnno
    issqty
    table 3
    mrnno
    retqty
    want to create view table where i can see the sum (mrnqty), sum(issqty),sum(retqty) group by mrnno
    sandy

    Hi
    CREATE OR REPLACE FORCE VIEW my_view AS
    WITH t1 AS
    (SELECT mrnno,
                      SUM(mrnqty) sum1
    FROM table_1
    GROUP BY mrnno),
    t2 AS
    (SELECT mrnno,
                      SUM(issqty) sum2
    FROM table_2
    GROUP BY mrnno),
    t3AS
    (SELECT mrnno,
                      SUM(retqty) sum3
    FROM table_3
    GROUP BY mrnno)
    SELECT mrnno,
                    sum1,
                   sum2,
                   sum3
    FROM t1,t2,t3
    WHERE t1.mrnno = t2.mrnno
    AND       t1.mrnno = t3.mrnnoCheers
    Ben
    http://www.munkyben.wordpress.com
    Don't forget to mark replies helpful or correct ;)

  • Create view failing

    Hi ,
    I have created public dblink and want to create view by dblink,but i am getting below error,please help me how to create such view
    ORA-22992 cannot use LOB locators selected from remote tables. i have created db public dblink "emp_db_link" and using below command for creating view
    create view emp_view as select * from emp_table@emp_db_link;
    Thanks
    Hridyesh

    Hello
    pls use this link
    DBLink problem ORA-22992

  • I have a table tab1 with record(1,2,3,4,5,6,7,8,9). i want to create a proc

    i have a table tab1 with record(1,2,3,4,5,6,7,8,9). i want to create a procedure, when we pass the parameter in procedure then that record come on top rest record below of that.
    thanks,

    Is the block based on a table ?
    Francois

  • Can I create an 'attach files' button in a pdf form?

    Hello,
    I'm working on a mac and want to create and 'attach files' option to my briefing form. Clients will access the form in reader, attache word documents then submit the form.
    I have no javascript experience and am not too advanced with Acrobat so will need very basic instructions if it is possible.
    Thanks for any help.
    Cheers,
    Leah =)

    I just responded to this here: http://acrobatusers.com/forum/forms-acrobat/create-attach-files-button-pdf-mac

  • How to create  search help for field in interactive adobe form

    HI
    I want to create search help for PERNR field in adobe form.
    how i can do it.
    Can any one giud me.
    Regards,
    Laxman Sankhla

    Hi Laxman,
    Please search SDN, there are lots of queries posted and solved earlier on this.
    especially there are step by step blogs.
    Cheers,
    Sai

  • List View Filter - I want to create List View based on a specific user

    I want to create a List View Filter based on specified user ID. I dont want to specify the [Me] for filtering the view based in current logged in User.
    I want the view to be based on specific user ID for Ex: "AD\JohnDoe"
    Thanks
    Nate

    The People/Group Picker field has several options for how the name is displayed. For example you can set it to be the friendly name or the account name. When you create your View Filter, make sure that you are using the same format as the field's display
    type.
    Dimitri Ayrapetov (MCSE: SharePoint)

  • I want to Create an Customised Viewer for my company to view a PDF document.

    Hello
         I want to Create a Customised Viewer to view a PDF document.
         I will be creating Setup.exe after Desiging the Viewer with content, only that Setup file will be sent to the end user.
         Please help me which software is best to Design and Create the viewer.
         NOTE : The viewer required User name and Password and other security features.
    Thanks
    Suresh

    when i go to set up his itunes account with my mastrcard it rejects it.  I'm using Visa for my account

  • Added can be viewed in SQL Workshop but can't when want to create form

    Hi Friends
    We are using APEX 3.1 and Oracle 10.2.0 at back end.
    I can assign other schemas to a work space successfully.
    The Problem is that
    Added schemas can be viewed in SQL Workshop (SQL commands)
    But can not view the added schemas in the list when want to create a form based on table
    Regards
    Jazib

    Closed: duplicate post.

  • When I want to create a new project the view screen on the right is blank ? Since creating a new project, when almost done something happens

    When I want to create a new project the view screen on the right is blank ? Since creating a new project, when almost done something happens

    Hi
    Need more info
    • Free space on Start-Up (Mac OS) hard disk - How much ?
    • Did You try to trash iMovie pref. file while iMovie is NOT running ?
    • Can it be something that corrupt Your movie project e.g. use of alien video codecs or audio file formats ?
    (What did You use ? Video-codecs, Audio file formats and Photo file formats ? )
    Yours Bengt W

  • I want to create a play list based on beats per minute. Is this possible?

    I want to create a play list based on beats per minute. Is this possible?
    I have selected show bpm on my itunes screen but there are no numbers there.

    Tracks do not come with BPM information included, either from the iTunes Store nor when you import a CD. You need to enter in the BPM information yourself. There are applications for Mac that can analyze tracks and determine (more or less) the BPM automatically, and there may be something similar for Windows. Otherwise you'll have to determine the BPM yourself and enter that information in the field for each track.
    BTW, this forum is for questions about iTunes U, Apple's service for colleges and universities to post educational material in the iTunes Store. For future questions, you'll be most likely to get help with this issue if you ask in the general iTunes forums.
    Regards.

  • What is the use for CREATING VIEW WITH CHECK OPTION?

    Dear Legends,
    I have a doubt
    What is the use for creating view?
    A: First Data Integrity, Selecting Particular Columns..
    What is the use for creating a view with check option?
    A: As per oracle manual I read that its a referential integrity check through views.
    A: Enforcing constraints at DB level.
    A: using CHECK OPTION we can do INSERTS UPDATES for a view for those columns who have no constraints... is it right??
    A: If we do a INSERT OR UPDATE for columns who have constraints it will show error... is it right???
    Please clear my doubt's Legends
    Lots of Thanks....
    Regards,
    Karthik

    Hi, Karthick,
    karthiksingh_dba wrote:
    ... What is the use for creating view?
    A: First Data Integrity, Selecting Particular Columns..Most views are created and used for convenience. A view is a saved query. If the same operations are often done, then it can be very convenient to code those operations once, in a view, and refer to the view rather than explicitly doing those operations.
    Sometimes, views are created and used for security reasons. For example, you many want to allow some users to see only certain rows or certain columns of a table.
    Views are necessary for INSTEAD OF triggers.
    What is the use for creating a view with check option?
    A: As per oracle manual I read that its a referential integrity check through views.The reason is integrity, not necessarily referential integrity. The CHECK option applies only when DML is done through the view. It prohibits certain changes. For example, if a user can't see certain rows through a view, the CHECK option keeps the user from creating such rows.
    A: Enforcing constraints at DB level.I'm not sure what you mean. Please give an example.
    A: using CHECK OPTION we can do INSERTS UPDATES for a view for those columns who have no constraints... is it right??No. Using CHECK OPTION, you can do some inserts and updates, but not others. The columns involved may or may not have constraints in either case.
    A: If we do a INSERT OR UPDATE for columns who have constraints it will show error... is it right???If you try to violate a constraint, you'll get an error. That happens in views with or without the CHECK OPTION, and also in tables.

Maybe you are looking for