Multiples query before REPFOOTER

hi,
how can i do multiple queries before i print my footer.currently it will repeat printing title and footer for each of the query.Please help.
CLEAR COLUMNS
CLEAR BREAKS
CLEAR COMPUTE
COLUMN X_CONTACT_TYPE HEADING 'CONTACT_TYPE' FORMAT A5
SET TERMOUT OFF
SET FEEDBACK OFF
SET TRIMSPOOL ON
SET PAGESIZE 100
SET UNDERLINE =
COLUMN TODAY NOPRINT NEW_VALUE DATEVAR
COLUMN REC_COUNT NOPRINT NEW_VALUE REC_CTR
TTITLE 'TITLE NAME ' SKIP 1 -
LEFT 'Date/Time: ' DATEVAR SKIP 1 -
LEFT 'Page: ' FORMAT 999 SQL.PNO SKIP 1 -
LEFT '================================================================================================================' SKIP 1
REPFOOTER SKIP 1 '**************************************' SKIP 1 -
LEFT 'Total No. of Records before patched      : ' REC_CTR SKIP 1 -
LEFT '****************************************End of Report**********************************************************' SKIP 1
SET LINESIZE 1000
WHENEVER SQLERROR EXIT SQL.SQLCODE
SELECT
COUNT(*) AS REC_COUNT
FROM S_OPTY_CON A,S_OPTY B
WHERE A.OPTY_ID = B.ROW_ID
AND B.CONSUMER_OPTY_FLG = 'Y'
AND A.X_CONTACT_TYPE IS NULL;
WHENEVER OSERROR EXIT SQL.OSCODE
SPOOL /DESKTOP/Report.txt
BREAK ON REPORT
WHENEVER SQLERROR EXIT SQL.SQLCODE
SELECT DISTINCT(X_CONTACT_TYPE) AS CONTACT TYPE DISTINCT
FROM S_OPTY_CON
WHERE OPTY_ID IN (SELECT ROW_ID from S_OPTY WHERE CONSUMER_OPTY_FLG = 'Y')
SELECT
COUNT(*) AS TOTAL,X_CONTACT_TYPE AS CONTACT_TYPE,
TO_CHAR(SYSDATE, 'DD/MM/YYYY HH24:MI:SS') AS TODAY
FROM S_OPTY_CON A,S_OPTY B
WHERE A.OPTY_ID = B.ROW_ID
AND B.CONSUMER_OPTY_FLG = 'Y'
GROUP BY X_CONTACT_TYPE;
CLEAR COLUMNS
CLEAR BREAKS
CLEAR COMPUTE
SET TERMOUT ON
SET FEEDBACK ON
SET TRIMSPOOL OFF
SPOOL OFF
EXIT
Expected Output:
TITLE NAME
Date/Time: 21/10/2004 11:07:16
Page: 1
=========================================
CONTACT TYPE DISTINCT
=========================================
C
P
NULL
=========================================
TOTAL CONTACT TYPE
=========================================
1248 C
820 P
34611 NULL
'Total No. of Records before patched : 36679
****************************************End of Report**********************************************************
Thanks

hi,
how can i do multiple queries before i print my footer.currently it will repeat printing title and footer for each of the query.Please help.
CLEAR COLUMNS
CLEAR BREAKS
CLEAR COMPUTE
COLUMN X_CONTACT_TYPE HEADING 'CONTACT_TYPE' FORMAT A5
SET TERMOUT OFF
SET FEEDBACK OFF
SET TRIMSPOOL ON
SET PAGESIZE 100
SET UNDERLINE =
COLUMN TODAY NOPRINT NEW_VALUE DATEVAR
COLUMN REC_COUNT NOPRINT NEW_VALUE REC_CTR
TTITLE 'TITLE NAME ' SKIP 1 -
LEFT 'Date/Time: ' DATEVAR SKIP 1 -
LEFT 'Page: ' FORMAT 999 SQL.PNO SKIP 1 -
LEFT '================================================================================================================' SKIP 1
REPFOOTER SKIP 1 '**************************************' SKIP 1 -
LEFT 'Total No. of Records before patched      : ' REC_CTR SKIP 1 -
LEFT '****************************************End of Report**********************************************************' SKIP 1
SET LINESIZE 1000
WHENEVER SQLERROR EXIT SQL.SQLCODE
SELECT
COUNT(*) AS REC_COUNT
FROM S_OPTY_CON A,S_OPTY B
WHERE A.OPTY_ID = B.ROW_ID
AND B.CONSUMER_OPTY_FLG = 'Y'
AND A.X_CONTACT_TYPE IS NULL;
WHENEVER OSERROR EXIT SQL.OSCODE
SPOOL /DESKTOP/Report.txt
BREAK ON REPORT
WHENEVER SQLERROR EXIT SQL.SQLCODE
SELECT DISTINCT(X_CONTACT_TYPE) AS CONTACT TYPE DISTINCT
FROM S_OPTY_CON
WHERE OPTY_ID IN (SELECT ROW_ID from S_OPTY WHERE CONSUMER_OPTY_FLG = 'Y')
SELECT
COUNT(*) AS TOTAL,X_CONTACT_TYPE AS CONTACT_TYPE,
TO_CHAR(SYSDATE, 'DD/MM/YYYY HH24:MI:SS') AS TODAY
FROM S_OPTY_CON A,S_OPTY B
WHERE A.OPTY_ID = B.ROW_ID
AND B.CONSUMER_OPTY_FLG = 'Y'
GROUP BY X_CONTACT_TYPE;
CLEAR COLUMNS
CLEAR BREAKS
CLEAR COMPUTE
SET TERMOUT ON
SET FEEDBACK ON
SET TRIMSPOOL OFF
SPOOL OFF
EXIT
Expected Output:
TITLE NAME
Date/Time: 21/10/2004 11:07:16
Page: 1
=========================================
CONTACT TYPE DISTINCT
=========================================
C
P
NULL
=========================================
TOTAL CONTACT TYPE
=========================================
1248 C
820 P
34611 NULL
'Total No. of Records before patched : 36679
****************************************End of Report**********************************************************
Thanks

Similar Messages

  • Having multiple query windows open at once.

    I wasn't sure how to phrase it so after some digging I'm resorting to asking on here.
    I've been working out of the 'Joes2Pros' series and I work within SMMS with SQL standard installed locally for playing.
    Most of the time I like to have multiple query windows open to save queries to reference later just for examples.
    My question is that is there a way to ensure a query window is not using any databases so that when I run the lab setup scripts for Joes2Pros I don't encounter any errors without having to close my other query windows?
    Any help is greatly appreciated! Thanks in advance.

    You can accomplish this multiple ways:
    1. Have your windows open with the database context set to master (select master DB in the dropdown on the toolbar) 
    2. "USE master; go" statement as the first line in all your query windows
    3. Before you run your setup scripts, issue a kill command to terminate all other query window sessions (this will still keep the query windows open but they won't be connected to any database)
    Satish Kartan http://www.sqlfood.com/

  • How To Delete Multiple Query Elements in a Transport

    Guys,
    How do you delete Multiple Query Elements in a transport in DEV? Or it's not posible.  I tried to select multiple but only one is being deleted.
    Thanks,
    Recca

    Hi Recca,
    As Nanda said, just go to tcode SE03..Click Unlock Objects (Expert Tool)..Paste your TR number (one at a time) then click Unlock..
    Go back to SE10 and delete your TR numbers..
    Regards,
    Loed

  • How to pass multiple query string values using the same parameter in Query String (URL) Filter Web Part

    Hi,
    I want to pass multiple query string values using the same parameter in Query String (URL) Filter Web Part like mentioned below:
    http://server/pages/Default.aspx?Title=Arup&Title=Ratan
    But it always return those items whose "Title" value is "Arup". It is not returned any items whose "Title" is "Ratan".
    I have followed the
    http://office.microsoft.com/en-us/sharepointserver/HA102509991033.aspx#1
    Please suggest me.
    Thanks | Arup
    THanks! Arup R(MCTS)
    SucCeSS DoEs NOT MatTer.

    Hi DH, sorry for not being clear.
    It works when I create the connection from that web part that you want to be connected with the Query String Filter Web part. So let's say you created a web part page. Then you could connect a parameterized Excel Workbook to an Excel Web Access Web Part
    (or a Performance Point Dashboard etc.) and you insert it into your page and add
    a Query String Filter Web Part . Then you can connect them by editing the Query String Filter Web Part but also by editing the Excel Web Access Web Part. And only when I created from the latter it worked
    with multiple values for one parameter. If you have any more questions let me know. See you, Ingo

  • Unable to display results of multiple query in grid in Oracle SQL Developer

    Hi, I am a newbie to this forum and couldn't find the Oracle SQL Developer forum so posting it here.
    My question: How to display multiple query results in grid in Oracle SQL Developer.
    Example:
    select * from Employee;
    select * from Department;
    - when I select both the queries and hit F5 in Oracle sql developer. By default it displays in output window.
    - How to display result of both the queries in Grid.
    Any thoughts on this would be really helpful.
    Thanks in advance.
    Harsh

    Hi Harsh,
    I'd say that the Results grid is designed to only show the results of 1 query at a time. I don't know/can't see how it would display multiple queries at a time.
    I would suggest either joining your tables to create a single query or opening another SQL Worksheet for one of the queries so that you can display the results side-by-side.
    Maybe you could explain what you're trying to do. Why are you trying to display multiple results in the same query grid?

  • Case statement in a multiple query

    Hi everyone,
    This is my first time to use case statement in a multiple query. I have tried to implement it but i got no luck.. Please see below
    set define off
    SELECT g.GROUP_NAME as Market
    ,t.NAME as "Template Name"
    ,t.TEMPLATE_ID as "Template ID"
    ,(SELECT created
    FROM material
    where template_id = t.template_id) as "Date Created"
    *,(SELECT DESTINATION_FOLDER_ID,*
    CASE DESTINATION_FOLDER_ID
    WHEN NULL THEN 'Upload'
    ELSE 'HQ'
    END
    from log_material_copy
    where destination_material_id in (select material_id
    from material
    where template_id = t.template_id ))as "Origin"
    ,(select material_id
    from log_material_copy
    where destination_material_id in (select material_id
    from material
    where template_id = t.template_id)) as "HQ/Upload ID"
    ,(SELECT COUNT (mse.ID)
    FROM MATERIAL_SEND_EVENT mse, material m, creative c
    WHERE mse.MATERIAL_ID = m.MATERIAL_ID
    AND mse.MATERIAL_TYPE_ID = m.MATERIAL_TYPE_ID
    AND m.ASSET_ID = c.id
    AND c.TEMPLATE_ID = t.TEMPLATE_ID) as Sent
    ,(SELECT COUNT (de.ID)
    FROM download_event de, material m, creative c
    WHERE de.MATERIAL_ID = m.MATERIAL_ID
    AND de.MATERIAL_TYPE_ID = m.MATERIAL_TYPE_ID
    AND m.ASSET_ID = c.id
    AND c.TEMPLATE_ID = t.TEMPLATE_ID) as Download
    ,(SELECT 'https://main.test.com/bm/servlet/' || 'UArchiveServlet?action=materialInfo&materialId=' || DESTINATION_MATERIAL_ID || '&materialFolderId=' || DESTINATION_FOLDER_ID
    from log_material_copy
    where destination_material_id in (select material_id
    from material
    where template_id = t.template_id)) as "URL to template on MPC layer"
    --, t.AVAILABLE_FOR_TRANSFER as "Available for transfer"
    FROM template t, layout l, groups g
    WHERE t.LAYOUT_ID = l.LAYOUT_ID
    AND l.ORGANIZATION_ID = g.IP_GROUPID
    AND g.IP_GROUPID in ( 1089, 903, 323, 30, 96, 80, 544, 1169, 584, 785, 827, 31, 10, 503, 1025 )
    ORDER BY g.GROUP_NAME ASC;
    The one in bold is my case statement.. Please let me know what is wrong with this.
    Regards,
    Jas

    I think you're getting the idea, but:
    You're still selecting 2 columns in the (scalar) subquery. Did you read the link I posted for you?
    "a) scalar subqueries - *a single row, single column query that you use in place of a "column"*, it looks like a column or function."
    You must move that query outside, join to template.
    Something like:
    NOT TESTED FOR OBVIOUS REASONS SO YOU'LL PROBABLY NEED TO TWEAK IT A BIT
    select g.group_name as market,
           t.name as "Template Name",
           t.template_id as "Template ID",
           m.created  as "Date Created",
           lmc.destination_folder_id,
           case lmc.destination_folder_id
             when null then 'Upload'
             else 'HQ'
           end as "Origin"
           (select material_id
              from log_material_copy
             where destination_material_id in
                   (select material_id
                      from material
                     where template_id = t.template_id)) as "HQ/Upload ID"
           (select count(mse.id)
              from material_send_event mse, material m, creative c
             where mse.material_id = m.material_id
               and mse.material_type_id = m.material_type_id
               and m.asset_id = c.id
               and c.template_id = t.template_id) as sent
           (select count(de.id)
              from download_event de, material m, creative c
             where de.material_id = m.material_id
               and de.material_type_id = m.material_type_id
               and m.asset_id = c.id
               and c.template_id = t.template_id) as download
           (select 'https://main.test.com/bm/servlet/' ||
                   'UArchiveServlet?action=materialInfo&materialId=' ||
                   destination_material_id || '&materialFolderId=' ||
                   destination_folder_id
              from log_material_copy
             where destination_material_id in
                   (select material_id
                      from material
                     where template_id = t.template_id)) as "URL to template on MPC layer"
    --, t.AVAILABLE_FOR_TRANSFER as "Available for transfer"
      from template t
      ,    layout l
      ,    groups group by
      ,    MATERIAL M
      ,    LOG_MATERIAL_COPY LMC
    where t.layout_id = l.layout_id
       and l.organization_id = g.ip_groupid
       and M.TEMPLATE_ID = t.template_id
       and LMC.destination_material_id in ( select material_id
                                            from   material
                                            where  template_id = t.template_id
       and g.ip_groupid in (1089,
                            903,
                            323,
                            30,
                            96,
                            80,
                            544,
                            1169,
                            584,
                            785,
                            827,
                            31,
                            10,
                            503,
                            1025)
    order by g.group_name asc;

  • In Photo Stream, how add comments to multiple pictures before sending to iCloud?

    When you have multiple photos in your Camera Roll that you want to send to subscribers via an iCloud Photo Stream, it seems that you can only add a comment to the first one of those photos before you post them all to iCloud.  Am I missing something?  I know you can add comments to multiple pictures once they're on iCloud as part of a Photo Stream, but I'd like to have the option of adding multiple comments before I post them.

    Open Photo Stream.
    Tap Select
    Tap the pictures you want to save and a check mark will appear on each.
    Tap Save
    Choose either camera roll, or you can even create a new folder at this point

  • Multiple Query/View usage

    "Avoid multiple query execution by assigning a query or view to just one data provider, which is used by all web items."
    could you please explain me the importance of this?

    the data provider is like a variable that you can use in multiple objects (charts, tables, navigational objects, filters, etc...).  If you assign a data provider to query XYZ, then you can assign that data provider to table, chart, and filter objects.  When you filter the data provider, then you also filter the charts and tables.
    If you assign the same query to different data providers and dp1 is used in the filter, dp2 is in the table, etc..., you cannot use your filter to filter your table. 
    It's just a method to link the objects together in an easier manner.
    Brian

  • Viewing multiple thumbs before importing?

    Hi,
    I am going through photo discs trying to accumulate relevent photos to make a Photo Book. I don't want to import every single photo on each disc in order to look at and them in iPhoto - and would prefer not to have to click on each photo to see what it is before importing. Does anyone know if there is a way to view multiple thumbs before selecting which to import?

    Ah yes...thank you very much! I never venture up there because I am terrified I will mess with stuff that should be just left alone and I have developed a blind spot to then search up there for things.... Unfortunately there is nothing in the Contextual Menu Folder so I can't manually remove anything there.
    Unless you have another suggestion, I suppose I will browse around his site and see if there is a reference to solving this particular problem in downloading the program.
    Thanks for your help Terence.

  • Select the Key Figures to be presented in a query before execute the it

    Hi,
    I want to select(through checkbox) the Key Figures to be presented in a query before executing the query. I'm creating BEX queries and web templates (I'm working on BEX 7.0).
    I haven't found clear post about this so if you have implemented something like this please help me and share your solution.
    Kind regards,
    Ana

    Hi,
    If you set a property of your KF as "Hide and can be shown", you will get a filter option for these KFs after executing the report in the navigational block of web report.
    When you click on that filter, you will get the list of KFs, then you can select the desired KFs using check box.
    Regards,
    Yogesh.

  • How to make & edit multiple query report

    hi,
    how to make multiple query report & i have an existing multiple query report when i edit it all the structure gets disturbed whenever i want to add or delete any column from an query.
    how to do this ?
    txs

    Perhaps you have "Flex Mode" selected in the Layout Editor? It's the button next to the padlock button.
    Message was edited by:
    Dave Hemming
    Also PS: Vaguest. Question. Ever.

  • Precalculate a workbook containing multiple query varients in broadcasting

    Hello gurus
    I'm using BW 3.5 version. I have a Sales MIS workbook. That workbook is having four tab pages for regions north, east, west south. I have one single user entry variable for region characteristics. And while saving the workbook I say "Save & reuse the variables". Now user wants to broadcast the workbook in the same fashion. But Broadcast settings only accommodate for 1 variant for precalculation. He is not interested in having 4 mails for 4 regions. Has anyone figured out a way to precalculate a workbook containing multiple query varients?

    I have the same issue as well.  We have upgraded to 7.0, but still running 3.5 queries and 3.5 bex tools except broadcaster.  We are using Broadcaster 7.0 and Analyzer 3.5.  How do you get all the queries to refresh using the variant? 
    When the query properties are set to just 'Refresh query when opening workbook' it will not execute in the Broadcaster (7.0) - Error: u201CSpecify a value for variable Period/Fiscal Year (Interval Entry, Required)"
    When I select the box for 'Save and reuse variable values' and execute through the Broadcaster (with a variant) it run the first, active sheet with the variant but the other sheets reuse the values that were used when saving the favorite.
    How can I get the Broadcaster to refresh all queries in the workbook using the variant ??  Again, we are on Broadcaster/Precalc 7.0 and Analyzer/queries are 3.5
    Thanks!

  • WIS 00015 error- Multiple Query Filters contain a prompt with same name

    Hi
            I am working BOXIR2 environment. I created two prompts at Universe level- one of Date field and one on agency name field.
    syntax for the prompts is
    customerInfo.RSRCE_NAME =  @Prompt('Enter value(s) for AgencyName ','A' , , ,)
    datetable.STARDATE =datetable.STARDATE.STARTDATE =  @Prompt(' 'Enter value(s) for StartDate:','D' , , ,)
    When I include even one of  the prompts in the report I am getting an error WIS 00015 Multiple Query Filters contain a prompt with the same text, but the prompts use a different operand type.
    If I try to change text of one of the prompts in Universe selection statement, then I see the prompt two times in the report.
    Please let me know how to overcome this issue.

    Ok, I've simplified the case.
    Here is the real case :
    Object filter =
    Based on object =
    .[LEVEL01]
    Object filter =
    Based on object =
    .[LEVEL01]
    In WBI query result I take these objects :
    .[LEVEL01]
    .[LEVEL01]
    .[4IUX93YJGXQEHGLX0T0GPNA9Y]
    In query filters, my 2 filters with same text :
    1.
    I run the query.
    Answer to question 'Single Year Period ?' = Period 06 2010
    ==> MDX error
    A database error occured. The database error text is: Echec de l'exécution de la requête MDX SELECT  { .[4IUX93YJGXQEHGLX0T0GPNA9Y] }  ON COLUMNS , NON EMPTY CROSSJOIN( .[LEVEL01].MEMBERS, .[LEVEL01].MEMBERS ) DIMENSION PROPERTIES MEMBER_CAPTION ON ROWS FROM SAP VARIABLES INCLUDING .[Z12010006] INCLUDING .[Z12010006] avec l'erreur Invalid MDX command with . (WIS 10901)
    And you can see that the value sent to both filters is the same and come from the first filter .[Z12010006] instead of applying the value to each filter .[Z12010006] for the first one and .[Z12010006] for the second one.
    Please, notice that if I change the order of this 2 filters in the WBI query, the MDX generated become :
    SELECT  { .[4IUX93YJGXQEHGLX0T0GPNA9Y] }  ON COLUMNS , NON EMPTY CROSSJOIN( .[LEVEL01].MEMBERS, .[LEVEL01].MEMBERS ) DIMENSION PROPERTIES MEMBER_CAPTION ON ROWS FROM SAP VARIABLES INCLUDING .[Z12010006] INCLUDING .[Z12010006]
    Thanks for your help.
    G.OM.

  • HT1212 My iPhone is displaying a "iPhone is disabled" notification. It asked me to enter my password multiple times before locking me out.

    My iPhone is displaying a "iPhone is disabled" notification. It asked me to enter my password multiple times before locking me out. Can you help with this?

    Hey there!
    Unfortunetly, in situations like this, the ONLY other way to bypass that four-digit passcode and/or a disabled device is to connect to a computer with the most recent version of iTunes (11.1.3), connect the device in Recovery Mode and restore it to factory settings. Restoring to factory will completely wipe the device, including the four-digit passcode.
    The steps to do so are outlined in http://support.apple.com/kb/ht1212
    (If there is any other way to bypass the passcode, it would have to be third-party, which I am not familiar with any program that can, sorry!).

  • Multiple Query Generation from Discoverer?

    Is there anyway we can generate multiple query reports in discoverer plus? I have a daily dashboard which we send out on daily basis which has multiple queries to generate certain numbers. And I have a stored procedure for this. Is it possible to have multiple queries in 1 workbook to generate the report? If yes, then how? If not then, can we have this stored procedure in disco admin tool in a specific business area which basically kicks the SQL and stores the data in a table within that business area and in disco plus tool we can then simply select all the data from that table to generate the report? I would really appreciate if anyone could answer this.
    Thanks,
    K

    Another interesting way you can prepare a table is a method I've just seen using Disco 4.x.
    We've made such a big deal on using triggers recently, that this was so simple, I must admit I never thought of it.
    What the user did was have a function that called a pl/sql routine that did all the work and created the table.
    Then in the Disco workbook, they specified workbook 1 - the first workbook that took in parameters from the users, and passed the parameters into the function (ie: a from date and to date).
    The workbook didn't return any column from any folders, etc. but just presented the calculation that called the function.
    So, in a nutshell, the user runs the first worksheet where 2 parameters are asked for. Then when finished, it means the table is now ready for the real action so they go to the 2nd. worksheet and it just runs without any parameters but refers to the table set up by the first worksheet.
    No parameter passing to the EUL, nothing fancy, but all done in the function that called the pl/sql routine. Very easy.
    So, for you, you should be able to use the same concept, but in batch, run the first worksheet (ie: putting in the 2 parameters), and then just run the 2nd. worksheet once the first is finished and the table setup.
    Hope it helps.
    Russ

Maybe you are looking for

  • Using AAMEE to Package CS6 for Enterprise Deployment | Creative Suite In The Enterprise | Adobe TV

    CS6 software requires activation and Adobe ID login. By packaging CS6 with AAMEE 3.0 before deployment, only the IT Admins needs to complete a one-time package activation and Adobe ID login, individual users of thesoftware do not. Learn about these n

  • I tried to invoke WS from BPEL process

    I tried to invoke WS from BPEL process. And error occurred when I deployed the process. Error: [ERROR ORABPEL-10902]: COMPILING FAILED. [NOTE]: IN "bpel.xml", XML syntax analysis failed. The reason is "Part Element not defined". In "http://192.168.0.

  • How do I restore files from External Harddrive - Disk warrior cannot rebuild

    Hi Guys I have a External Hard drive that I can see via Disk Ulitity and shows in finder - but I cannot see the actual files and directories, hence not being able to copy them to a new external hard drive When I connect the External Harddrive to my M

  • How to send A file using Webservice?

    I heard about webservice when I read through XML... It a bit like XML cannot show off it strength without webservice...lol What is webservice? What library should I use to send a file from server to client using webservice? Webservice is Quite new fo

  • AS3.0 Slider to slide timeline is duplicating first frame. Why?

    I have made a slider that I am having issues with. This slider is to control the timeline of a movie clip when dragged. My problem with this is that It seems to be duplicating the first frame. When I slide the slider to the right it will hit first ti