Automatic Query

Hi Experts,
I created a query that links OINV, INV1, and OSLP tables to show invoices by sales employee.  Is there a way to make this type of query automatic so that at the end of each business day, a new query will be created showing that days' sales by employee?  If yes, how would that work?
Thank you,
Hayden

Thank you both,
I am new to queries, so I probably should have given a little more detail on what I have so far.  This is my query.
SELECT T0.[CardCode] as 'BP Code', T0.[DocNum] as 'Doc No.', T0.[DocDate], T1.[ItemCode], T1.[Dscription], T1.[Quantity], T1.[Price] as 'Price', T1.[LineTotal], T2.[SlpName], T2.[Commission] FROM dbo.OINV T0  INNER JOIN dbo.INV1 T1 ON T0.DocEntry = T1.DocEntry INNER JOIN OSLP T2 ON T0.SlpCode = T2.SlpCode WHERE T0.[DocDate] >=[%0] ORDER BY T2.[SlpName], T0.[DocDate]
When I run the query, it asks for the posting date and will show all invoices by sales employee since that day (I use today, so it shows all for today)
Is this enough that setting an alert will complete this automatically at the end of each day?
Thanks again,
Hayden

Similar Messages

  • Master Detail Query automatic query ..Urgent help

    In my last question, I asked about how to automatically query a form based on table or master detail and gota good answer. What I actually need to do is also query on the detail, for example
    select a.user_id, b.week_ending,b.mon_hrs,b.tues_hrs
    from emp_profile a, time_reporting_week b
    where user_id = portal30.wwctx_api.get_user
    and week_ending = '02-JAN-02'
    and a.user_id = b.user_id
    So I know that I can query on master table which is emp profile, but I also need to query on week ending which is in detail. Do I change the clause in my form pacjage?Or should I change something in Additional Pl/sql ??

    There are two ways to achieve this. Both methods have some drawbacks, so please go through them and choose the one that suits you.
    Method 1:
    =========
    This method does not require altering the form package.
    Assumptions : The detail table has a column named WEEK_ENDING.
    Steps :-
    1> Edit the form and select the query button in the left frame of the master section.
    2> For the pl/sql button event handler, choose the action as Query and replace the default code with the following :-
    declare
    l_where varchar2(4000);
    l_where_pre varchar2(4000);
    l_where_post varchar2(4000);
    l_where_pos integer;
    l_week_ending varchar2(4000);
    l_lang varchar2(4000);
    begin
    p_session.get_shadow_value(
    p_block_name => 'DETAIL_BLOCK',
    p_attribute_name => 'A_WEEK_ENDING',
    p_index => 1,
    p_value => l_week_ending,
    p_language => l_lang);
    doQuery;
    if l_week_ending is not null then
    l_where := p_session.get_value_as_varchar2(
    p_block_name => 'DEFAULT',
    p_attribute_name => '_DETAIL_WHERE_CLAUSE',
    p_index => 1
    l_where_pos := instr(l_where,' WHERE ');
    l_where_pre := substr(l_where,1,l_where_pos+6);
    l_where_post := substr(l_where,l_where_pos+7);
    l_where_post := 'week_ending = '||l_week_ending||' and '||l_where_post;
    l_where := l_where_pre || l_where_post;
    p_session.set_value(
    p_block_name => 'DEFAULT',
    p_attribute_name => '_DETAIL_WHERE_CLAUSE',
    p_value => l_where,
    p_index => 1);
    QueryDetail(
    p_mode => 'QUERY' ,
    p_session => p_session);
    end if;
    end;
    3> Click on OK to finish editing the form.
    4> Run the form - enter query criteria for the master fields and enter the week-ending criterion in the 1st detail
    field under Week Ending. Click the Query button.
    Advantage:
    You will not lose your changes even if you edit the form later on.
    Drawback:
    In this method, the querying process will be bit slow as we are querying for the detail records twice.
    Once through onQuery and the second time after constructing the new where clause with the additional conditon
    for the detail rows.
    Method 2
    ========
    This method requires altering the form generated package.
    Steps :-
    1> In the form package, you will find a onQuery procedure. Towards the end of the procedure, you will find a statement like
    "_detail_where_cond" := "_detail_where_cond" || ' WHERE ' || ...
    2> As the name of the variable suggests, this where condition will be used while querying the detail block. You need to
    add a new clause to this for the week_ending column. Prior to that you need to fetch the shadow value for A_WEEK_ENDING.
    3> Your altered code should look something like :-
    p_session.get_shadow_value(
    p_block_name => 'DETAIL_BLOCK',
    p_attribute_name => 'A_WEEK_ENDING',
    p_index => 1,
    p_value => l_week_ending,
    p_language => l_lang);
    if l_week_ending is not null then
    "_detail_where_cond" := "_detail_where_cond" || ' WHERE WEEK_ENDING = ' || l_week_ending || ' AND ' || --existing code
    else
    --- use the original code here
    "_detail_where_cond" := "_detail_where_cond" || ' WHERE ' || ...
    end if;
    4> Compile the package body and run the form.
    Advantage:
    In this method we will be querying the detail rows just once. Unlike in method 1.
    Disadvantage:
    You will lose your alterations once you create a new version of the form by editing it. You need to recompile the package
    after re-introducing your changes.

  • Automatic query in a form

    I have a report and a form. I want a button or a hyperlink in the footer-part of my report, which opens the form , which receives the id of the record displayed in my report, and the opened form has to display the record automatically when opened.
    Is there a solution for this ?

    kathy,
    there r 2 ways to do it.
    1. try creating a QBE report. but, this gives u the report in tabular format. the report by default gives u the functionality of updating and deleteing the record.
    at runtime you will see 2 links update and delete. when u click the update it opens the form in the update mode with the record in there, now u can update the record and save it.
    2. if you want a free form report. then create 2 same forms.
    in the first form make all the columns non-updateable except for the ones which user will use for querying purposes.
    create the button in the form and onClick javascript event of the first form open the second form in update mode. and then user can do whatever changes he/she likes.
    i had all these different situations and i've tried all of the above and it works.
    hope that helps.
    null

  • Automate Query selection

    Hi,
    I have a report which i need to schedule for flat file extraction daily. The report design is quite complex and hence changing the deign is no possibility..I have a variable which is User entry/required/single value..I run that report using rscrm_bapi..and i want this to be populated automatically since it is scheduled for daily..
    can anyone help me with this..?
    Thanks
    SM

    Guys,
    Its not that simple but i think its ok for the start...My requirement is :
    1. As I said clearly taht chaingn the query definition is not possible.
    2. I am using a query variant, but, the query selection pops up and tells me to select the variant. The issue is , somehow from backend side, I want to suppress the popping up of selection variable and use the variant directly rathre than asking for the variant.
    I hope am clear with my requirements.
    Regards,
    SM

  • To automate query such that it works even during cross year.

    Hi all, please help....
    Firstly, certain parameters need to be understood.
    Our financial year ended this september and new
    financial year begins October.
    Month_ID
    Aug'03 = 71
    Sep'03 = 72
    Oct'03 = 73
    Nov'03 = 74
    etc...
    Month_Id increases continously regardless of new financial year.
    Period_ID
    11 (Aug
    12 (Sep)
    1 (Oct)Period changes to 1 again coz our coy's
    financial year period starts in October.
    Now, the main part of the SQL statement causing cross year problem is this:-
    WHERE MONTH_ID BETWEEN MONTH_ID-(PERIOD_ID-1) AND MONTH_ID-1
    Firstly, for last month September:-
    Between Month_ID - (Period_ID-1) and Month_ID - 1
    72 - (12-1) 72 - 1
    =Between 61 and 71
    The calculation is correct for September.
    Now for October, this is the new financial year and the
    Period_id has now changed from 12 to 1.Month_ID has now increased to 73.
    Between Month_ID - (Period_ID-1) and Month_ID - 1
    73 - (1-1) 73 - 1
    = Between 73 and 72
    This statement is obviously wrong.
    Folks, is there anyway I could fine tune the SQL to automate this so that it works during all cross year periods?
    Here is the actual full SQL statement just for your reference:-
    SELECT
    B.YEAR, B.PERIOD_ID-1,
    ROUND(SUM(A.DEL_HC_TO_AMT),2) YTD_DEL_HC_TO_AMT, C.CUST_ID,
    C.COUNTRY_ID, C.CUST_GROUP, C.FIN_GRP_ID
    FROM
    DWMART.DWHD10_SLS_DELIVERY A,
    DWMART.DWHMAS_TME_MONTH B,
    DWMART.DWHMAS_CUS_MASTER C
    WHERE A.MONTH_ID BETWEEN B.MONTH_ID-(B.PERIOD_ID-1) AND B.MONTH_ID-1
    AND A.ITEM_ID NOT LIKE 'FR%'
    AND A.ITEM_ID NOT LIKE 'NON%'
    AND TRUNC(SYSDATE) BETWEEN B.START_DATE AND B.END_DATE
    AND A.CUST_ID = C.CUST_ID
    GROUP BY B.YEAR, B.PERIOD_ID-1, C.CUST_ID, C.COUNTRY_ID, C.CUST_GROUP, C.FIN_GRP_ID
    Thanx guys.

    Its not clear what you are wanting to get back from your query.
    If for october you want the full previous financial year, and the other months are currently correct, you could implement a case...
    WHERE a.MONTH_ID BETWEEN
      case b.period_id
        when 1 then b.MONTH_ID - 12
        else b.MONTH_ID-(b.PERIOD_ID-1)
      end
      AND b.MONTH_ID-1

  • Unusable cause very slow automatic query

    SQLdeveloper frequently freeze up for minutes in our development instances (EE 11.2.0.3), which have an huge amount of schema, objects and synonyms.
    Freezing is due to following query, I suppose automatically issued in order to discover accessible objects:
    /*+ NO_SQL_TRANSLATION */
    SELECT 'SCHEMA' type, username owner, username object_name, null column_name, null column_id, null data_type
    FROM all_users
    WHERE rownum <=50 and username like :1 union all /*+ NO_SQL_TRANSLATION */
    SELECT object_type type, owner, object_name, null column_name, null column_id, null data_type
    FROM all_objects
    WHERE object_type ='TABLE' and object_name not like 'BIN$%' and rownum <=50 and object_name like :2 union all /*+ NO_SQL_TRANSLATION */
    SELECT object_type type, owner, object_name, null column_name, null column_id, null data_type
    FROM all_objects
    WHERE object_type ='VIEW' and object_name not like 'BIN$%' and rownum <=50 and object_name like :3 union all /*+ NO_SQL_TRANSLATION */
    select 'TABLE' type, SYS_CONTEXT('USERENV','CURRENT_SCHEMA') owner, synonym_name object_name, null column_name, null column_id, null data_type
    from all_synonyms
    where synonym_name like :4 and rownum <=50 and owner in (SYS_CONTEXT('USERENV','CURRENT_SCHEMA') ,'PUBLIC')
    The query is from a SQLDeveloper v. 3.2.09, but we had similar problems with older versions.
    I tried ad-hoc profile with EM's sql tuning advisor, but the gain in minimal. Looking at execution plain seems like the major problem is the union with the all_synonyms views, actually slow by itself (a known issue with our architecture since Oracle DB 10.2.0.4, as far as I remember).
    Are there any workarounds to avoid the query or any parameter to force it using instead "user_synonyms"? Synonyms of other users are rarely intresting in object tree panel, we gladly gladly renounce to them...

    This forum is actually for SQL*Developer questions. Your qustion is about SQL and performance and should probably be posted in the SQL and PL/SQL forum.
    You can verify if it is SQL*Developer issue (possible but unlikely) by running it in another evironment like SQL*PLUS.
    However, since we are here anyway ...
    I performed searches in Google, My Oracle Support, and the 11gR2 documentation for NO_SQL_TRANSLATION and found nothing of any use. Did you mean NO_QUERY_TRANSFORMATION? If the hint you are using does not exist it will be ignored and by itself cause no problems. If it does exist (unlikely because there are lists of undocumented hints to be found on the internet) it shoud probably not be used since nothing is known about it. Does anything happen if you remove it and run the query?
    Post an execution plan of your SQL.
    A visual scan of your query (hard because it was unformatted)0
    1. lever SQL joined by unions. hard to read since the UNION operators were randomly placed in the SQL
    2. Multiple queries against data dictionary. If not queried by keys reading data dictionary tables can be slow

  • Avoid POWL automatic query when clicking on it

    Dear all,
    We are trying to avoid a POWL query to refresh automatically when it is clicked for the first time.
    Is there any way to do it?
    (I mean, it's mandatory to press the 'apply' button for retrieving the results)
    Thanks and kind regards,
    Sergio

    Thanks for your answer, it partially solved the problem, but I still have an issue.
    The first time I open the POWL, the first query that is selected by default (In my case: Shopping Carts) is refreshed automatically without taking in account the /SAPSRM/POWL_NO_REFR parameter.
    Then when I select other queries, they are not refreshed automatically (As expected)
    Is there any way to avoid this behaviour? Or maybe we should create an OSS note?
    Thanks and kind regards,
    Sergio

  • How to force an automatic query when first accessing a form?

    I have several forms on different tabs. When the first is queried, I save the key field. When the other forms start, they get the key with wwsto_api_session.load_session and store it in the form A_key.
    I want to have already performed a query when the user goes to the tab with the form on it. Can this be done? Is there a way to call doQuery from PL/SQL code?
    Gary

    Hello flöle,
    >>How can we prevent that and force the application to crash immediately when the unmanaged component fails?
    In my experience, this mechanism for wrapping the unmanaged expcetion should be by desiged since the .NET does not know these exception type. For handling unmanaged exception, the .NET provides a specific class:
    SEHException Class which is used to to handle unmanaged code exception in our managed code:
    https://msdn.microsoft.com/en-us/library/system.runtime.interopservices.sehexception.aspx
    You could use this class to catch the unmanaged exception.
    Regards.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Automatic query depending on selection of another item

    Hi all,
    I have the following situation :
    I have two items in a form called P42_ASUNTO and p_42_COD_OFERTA.
    P42_ASUNTO is a select list and P42_COD_OFERTA also.
    I would like that when it selects across the list of P42_ASUNTO, automatically only there appear the available values of P42_COD_OFERTA associated with the item P42_ASUNTO.
    How can I do it?
    Thank you very much

    Hi,
    See the below link
    [Link1 | http://www.inside-oracle-apex.com/generic-solution-for-cascading-select-listslovs/]
    [Thread | http://forums.oracle.com/forums/thread.jspa?messageID=3253737&#3253737]
    Regards,
    Shijesh

  • Automate Query and Export in HTML to Sharepoint

    Hello,
    Currently I'm using Disco Plus and I'm finding out that I don't have the ability to automate a report and export the result. In this case, I'm wanting to export in HTML format to a Sharepoint drive.
    I found a recent post saying that there you can script it with Disco Desktop but I don't have that installed and I'm not certain where I can get it... is it possible to download and install yourself or would my IT group need to install it (i have admin privileges to my machine). Is there a licensing fee separate for Desktop? Here are my Disco and system particulars if that helps:
    OracleBI Discoverer 10g (10.1.2.2)
    Oracle Business Intelligence Discoverer Plus 10g (10.1.2.54.25)
    Discoverer Model - 10.1.2.54.25
    Discoverer Server - 10.1.2.54.25
    End User Layer - 5.1.1.0.0.0
    End User Layer Library - 10.1.2.54.25
    PivotMan

    Hi PivotMan
    It is possible to download and install Discoverer Desktop yourself as the install is very, very easy. There is, as you suspect, a license issue though in that Discoverer Desktop is not licensed along with your Plus and Viewer licenses and is priced, I believe, at $1,200 per seat.
    If your company has a Discoverer Adminstrator using the Administrator tool then you may not be aware that the license for Admin also includes a license for Desktop and it is probably already installed.
    Independently, you can download the Desktop software, as part of the Tools CD, from OTN at this address: http://www.oracle.com/technology/software/products/ids/htdocs/101202winsoft.html
    The download you want is the second one, the Oracle Business Intelligence Tools 1og (10.1.2.0.2) for Microsoft Windows.
    Be wary though because your company has probably upgraded Discoverer to either 10.1.2.2 or 10.1.2.3. You will need to do the same thing for Desktop by downloading the relevant patch from MetaLink. Also, please read the licensing agreement on OTN before downloading and using any Oracle software as you will be required to confirm that you have read and understood Oracle's terms and conditions.
    I hope this helps
    Best wishes
    Michael

  • Master-detail automatic query

    How to query the detail block in a
    master-detail form when I change
    any master key field?
    null

    This is not implemented, after you update a record you must click on "Save" button and query again.

  • Automate query that export to excel

    Hi,
    I'm not sure if this is the right place to post this question... but....
    I run some queries every day and export to an excel file and send by email every day, there is any way to make it automatic?
    Do anyone have any suggestion?
    Thanks,
    Leandro Takeda

    You can use Dump_Csv developed by tom kyte. Below is the code that i modified for my requirement.
    create or replace function  dump_csv( p_query     in varchar2,
                                          p_separator in varchar2
                                                        default ',',
                                          p_dir       in varchar2 ,
                                          p_filename  in varchar2 )
    return number
    AUTHID CURRENT_USER
    is
        l_output        utl_file.file_type;
        l_theCursor     integer default dbms_sql.open_cursor;
        l_columnValue   varchar2(2000);
        l_status        integer;
        l_colCnt        number default 0;
        l_separator     varchar2(10) default '';
        l_cnt           number default 0;
         l_colDesc          dbms_sql.DESC_TAB;
    begin
        l_output := utl_file.fopen( p_dir, p_filename, 'w' );
        dbms_sql.parse(  l_theCursor,  p_query, dbms_sql.native );
        for i in 1 .. 255 loop
            begin
                dbms_sql.define_column( l_theCursor, i,
                                        l_columnValue, 2000 );
                l_colCnt := i;
            exception
                when others then
                    if ( sqlcode = -1007 ) then exit;
                    else
                        raise;
                    end if;
            end;
        end loop;
        dbms_sql.define_column( l_theCursor, 1, l_columnValue, 2000 );
        l_status := dbms_sql.execute(l_theCursor);
         dbms_sql.describe_columns(l_theCursor,l_colCnt, l_colDesc);
         l_separator := '';
         for lColCnt in 1..l_colCnt
         loop          
                utl_file.put( l_output, l_separator ||  '"' || Upper(l_colDesc(lColCnt).col_name) || '"');
                   l_separator := p_separator;
         end loop;
         utl_file.new_line( l_output );
        loop
            exit when ( dbms_sql.fetch_rows(l_theCursor) <= 0 );
            l_separator := '';
            for i in 1 .. l_colCnt loop
                dbms_sql.column_value( l_theCursor, i,
                                       l_columnValue );
                utl_file.put( l_output, l_separator ||  '"' ||
                                        l_columnValue || '"');
                l_separator := p_separator;
            end loop;
            utl_file.new_line( l_output );
            l_cnt := l_cnt+1;
        end loop;
        dbms_sql.close_cursor(l_theCursor);
        utl_file.fclose( l_output );
        return l_cnt;
    end dump_csv;Thanks,
    Karthick.

  • Detail blocks in tab pages not queried automatically

    Hi
    I have some generated forms with the following layout:
    - in the content canvas top, the master block
    - below the master block (in the same content canvas), a tab canvas with 2 (or more) pages with detail blocks
    When I query the master block, the detail blocks are not automatically queried, the user must navigate to them to make the automatic query work.
    I found out that it is something related to the blocks not being in the same canvas. But visually, they are in the same canvas, I would like that the detail blocks were queried automatically.
    Is this possible? I think this layout is very common and useful, I am sure Designer has some way to do this.
    Thanks
    Luis Cabral

    Hi
    I found it - I just set BSCSCP preference correctly, and now it works fine!

  • Why doesn't iTunes use track names on burned cd's instead of querying Gracenote?

    I run a recording studio and burn cd's of original music for clients. Sometimes when those clients open their cd in itunes, titles and artist names with no connection whatsoever to their music are displayed. Why does itunes not just use the titles burned with the cd instead of automatically querying Gracenote and arbitrarily assigning incorrect titles and artists to the disc? I have even imported such a disc into itunes, changed the titles and artist name, created a new playlist with those songs, and burned a disc from that corrected playlist, only to have it come up wrong again when the new disc is opened in itunes. This needs to be fixed. Some of those clients use the burned discs as booking demos, and having another artist's name and song titles come up causes confusion and embarassment.

    ed2345,
    No need for you to be an a-hole.
    Fair enough, although you are better off getting that feedback from me than from one of your clients who puts 2 and 2 together. 
    I clearly stated that quite often these were unfinished projects, often with working titles that may or may not be the final title.
    What you "clearly stated" is that your clients are having "confusion and embarassment."  Is that not sufficient for you to get those discs into the database?
    ....if the names haven't changed will Gracenote accept a submission of the same titles but different running times from the same artist and delete the old one?
    If the running times are different, it will look like a different CD to Gracenote.  If the CD is not the final version, you should append its title with "Demo" or "Work in Progress" or a similar indication that will distinguish it from the final "real" version.
    You may have a misimpression about Gracenote.  Yes, they are authoritative about commercial CDs, but they have also opened their DB for submissions to any hobbyist with iTunes and a burner.  They have tons of such things in their database.  There is absolutely no need for you to avoid putting your stuff in there.  In fact, since iTunes cannot read CD Text, there is currently no way other than Gracenote to solve the iTunes problem which brought you to this Forum.

  • Query about Calling One Form from Another using Personalization

    Hi All,
    I have created a Custom form using TEMPLATE.fmb and created functions in Apps and assigned to Responsibility etc and it all works OK.
    Now, I need to call this Custom form from another seeded(PO form) Via Tools -> Menu.
    using Forms personalization I can get the Menu Entry and Actions to execute the Form successfully from the PO Form.
    BUT, I need it to automatically query records in my CUSTOM form based on my current PO_HEADER_ID value on my PO Form.
    How can I do it ?
    Do I need to modify my Block and add some parameters and then pass a value via Personalization ?
    Please help !
    Thanks
    Shankar

    Hi Shankar,
    Please refer my article on metalink
    Zoom to AR Transactions and AR Receipts Form from Collections Form using Forms Personalization - Doc ID: 430643.1
    This article explains how to open the AR transactions form from another form. When it opens the form it automatically queries for the Invoice number of the calling form. You should be able to use this logic for your requirement.
    Hope this helps.
    Thanks,
    Anil

Maybe you are looking for

  • ScriptUI and Flex SDK version

    Hello, what is the last Flex SDK version supported by ScriptUI? It seems I'm having troubles loading a swf made with Flex 4.5 (Flash project, not AIR). I've been told that 3.6 is the latest, usable SDK - yet I'm afraid it could be a permission issue

  • Photoshop Elements 12 Editor will not open from Organizer

    My Photoshop Elements 12 Editor will not open from the Organizer - after I enter my password to login, I just get a small spinning circle on the screen but the editor never loads

  • Is 1080i ok with 1080i 30p?

    I shot a project where the wild life was shot with a Sony Z7U in 1080i 30p (a menu setting) and the interviews were shot in 1080i 29.97.  I capture my footage with a Kona AJA Lhi card in DVCPRO HD so the clips come in as 1280 x 1080 (1.5)   It appear

  • Data Template construction AND data template validation questions:

    Hello World. I am new to Oracle BI and I have sucessfully used the BI Java APIs to create from start to finish a pdf report process. I use the DataProcessor, RTFProcessor, and FOProcessor classes to do this. My question is other than the most simple

  • CD DVD Drive not working

    A friend of mines Toshiba Satellite L655 crashed the other day so I wiped the HD and installed win 7 and now his dvd drive doesn't recognize any type of discs.  The drive is in device manager and is recognized.  I've tried microsofts fix I've tried l