Query to spool for all clients

we have table weekly_orders have client id,orderno,order_date and other columns
Currently I have scheduled job which spools each into a file.
Spool /u01/9009.txt
Select * from weekly orders where client_id=9009;
Spool off;
Spool /u01/9010.txt
Select * from weekly orders where client_id=9010;
Spool off;
And so on..................
This is kind of manual effort where one has to add new clients
Is there a way we can get data for each client into its own file?
Any help is much appreciated
Thanks

Hi,
user11984714 wrote:
yes ,like sample data ,the clientid is number.
not sure how to format like you did as i am new user for this forum.Type these 6 characters:
\(small letters only, inside curly brackets) before and after each section of formatted text, to preserve spacing on this site.
>
each script is spearated by ###########
>
--weeklyoneclient.sql
DEFINE     this_cll_id     = &1
SPOOL     c:\&this_cll_id..txt
SELECT     *
FROM     order_hist_cl
WHERE     cll_id     = &cll_id;Use the same variable in the DEFINE statement and in the WHERE clause.  You're missing the the first 5 characters ("this_") in the WHERE clause; it should be:WHERE     cll_id     = &this_cll_id;

Similar Messages

  • How to query opening balance for all customer or Vendor for an speci. date

    Hi,
    How to query opening balance for all customer or Vendor for an specific date?
    Example:
    put any date and query will show all customer/ Vendor  that date opening/current balance.
    Regards,
    Mizan

    Hi mizan700 ,
    Try this
    SELECT T0.[DocNum] As 'Doc No.', T0.[CardCode] As 'Customer Code',
    T0.[CardName] As 'Customer Name',(T0.[DocTotal]-T0.[PaidSys]) As 'O/S Balance'
    FROM OINV T0 INNER JOIN OCRD T1 ON T0.CardCode = T1.CardCode
    INNER JOIN OCRG T2 on T1.GroupCode = T2.GroupCode
    INNER JOIN INV1 T3 ON T0.DocEntry = T3.DocEntry
    WHERE T0.[DocStatus] ='O'
    AND
    (T0.[DocDate] >='[%0]' AND T0.[DocDate] <='[%1]')
    Regards:
    Balaji.S

  • How to reduce configuration cache file Quota size located in ( C:\Windows\ccmcache ) for all client from SCCM 2012 server

    How to reduce configuration cache file Quota size located in ( C:\Windows\ccmcache ) for all client from SCCM 2012 server
    Thanks in Advance
    NTRao

    Hi,
    There are numerous ways to change the cache size.
    You could deploy a vbscript to a collection of the devices.
    On Error Resume Next
    Dim UIResManager
    Dim Cache
    Dim CacheSize
    CacheSize=20000
    Set UIResManager = createobject("UIResource.UIResourceMgr")
    Set Cache=UIResManager.GetCacheInfo()
    Cache.TotalSize=CacheSize
    Or you could use a configuration item.
    http://blog.coretech.dk/heh/configuration-items-and-baselines-using-scripts-powershell-example/
    You can also use the right click tools by Now Micro on a collection, if all the servers are on this would be the easiest / quickest way.
    http://www.nowmicro.com/recast/right-click-tools/
    http://www.david-obrien.net/2013/02/how-to-configure-the-configmgr-client/
    select SMS_R_SYSTEM.ResourceID, SMS_R_SYSTEM.ResourceType, SMS_R_SYSTEM.Name, SMS_R_SYSTEM.SMSUniqueIdentifier, SMS_R_SYSTEM.ResourceDomainORWorkgroup, SMS_R_SYSTEM.Client from SMS_R_System where SMS_R_System.OperatingSystemNameandVersion like '%6.2%'
    https://msdn.microsoft.com/en-us/library/windows/desktop/ms724832%28v=vs.85%29.aspx?f=255&MSPPError=-2147217396

  • How to disable spool for particular client

    Hi experts,
    we have two clients in our development server ( 008 and 009)
    we are using 009 as quality. this is newly imported client from prd .I want to disable spool in 009 client. my requirement is, no user able to take printouts from 009.is there any possibility to disable for particular client? around 150 users have access for 009. i think its not easy to remove the authorization from each user manually. Kindly suggest me to do this.
    Regards,
    Nagendra.

    Hi Venkatesh,
    008 is development client. what ever i do regarding this deactivating the spool in 009, it should not effect 008 client.
    it is possible by removing authorization from each user in 009  client. but it takes long time.
    is there any way to do this ?

  • Password reset for all clients

    Hi
    I need to Reset Password on ALL clients within current system for logged on User.
    Any suggestions please
    Thanks
    Regards

    Got a Program for this. Am just pasting the code..try it
    TABLES: T000, USR02.
    DATA: BEGIN OF I_USR02.
            INCLUDE STRUCTURE USR02.
    DATA: END OF I_USR02.
    SELECTION-SCREEN BEGIN OF BLOCK STANDARD
                     WITH FRAME TITLE TEXT-001
                     NO INTERVALS.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT (23) TEXT-005.
    SELECTION-SCREEN END   OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT (23) TEXT-004.
    PARAMETERS NO RADIOBUTTON GROUP RAD1.
    SELECTION-SCREEN COMMENT (23) TEXT-002.
    SELECTION-SCREEN END   OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT (23) TEXT-005.
    PARAMETERS YES RADIOBUTTON GROUP RAD1.
    SELECTION-SCREEN COMMENT (23) TEXT-003.
    SELECTION-SCREEN END   OF LINE.
    SELECTION-SCREEN END OF BLOCK STANDARD.
    MAIN PROGRAM
      IF NO = 'X'.
        MESSAGE I999 WITH
         'Program Terminated at User Request'.
        LEAVE PROGRAM.
      ELSE.
        PERFORM CHANGE_PASSWORD.
        SELECT * FROM T000.
          SELECT * FROM USR02 CLIENT SPECIFIED
             WHERE MANDT = T000-MANDT AND
                   BNAME = SY-UNAME.
            IF USR02-MANDT = SY-MANDT.
              WRITE : 1 USR02-MANDT COLOR 6 INVERSE.
              WRITE : 5 USR02-BCODE COLOR 6 INVERSE.
            ELSE.
              WRITE : 1 USR02-MANDT COLOR COL_KEY INTENSIFIED.
              WRITE : 5 USR02-BCODE COLOR COL_BACKGROUND INTENSIFIED OFF.
            ENDIF.
            IF USR02-UFLAG = 0.
              WRITE : 24 'Not Locked' COLOR COL_BACKGROUND INTENSIFIED OFF.
            ELSEIF USR02-UFLAG = 64.
              WRITE : 24 'Locked: System Admin.' COLOR 6 INVERSE.
            ELSEIF USR02-UFLAG = 128.
              WRITE : 24 'Locked: incorrect Logons.' COLOR 6 INVERSE.
            ELSE.
            ENDIF.
            WRITE : 50 USR02-TRDAT COLOR COL_BACKGROUND INTENSIFIED OFF.
            WRITE : 61 USR02-CLASS COLOR COL_BACKGROUND INTENSIFIED OFF.
            NEW-LINE.
          ENDSELECT.
        ENDSELECT.
      ENDIF.
    TOP-OF-PAGE.
      NEW-PAGE NO-TITLE NO-HEADING.
      PERFORM LISTTITEL.
    TOP-OF-PAGE DURING LINE-SELECTION.
      PERFORM LISTTITEL.
          FORM CHANGE_PASSWORD                                          *
    FORM CHANGE_PASSWORD.
      SELECT * FROM USR02 INTO I_USR02     "grab userid and store data
        WHERE BNAME = SY-UNAME.
      ENDSELECT.
      IF SY-SUBRC NE 0.
        EXIT.
      ENDIF.
      UPDATE USR02 CLIENT SPECIFIED        "Write current client pwd over
         SET                               "other clients that have id in.
          BCODE = I_USR02-BCODE
          OCOD1 = I_USR02-OCOD1
          CODV1 = I_USR02-CODV1
          OCOD2 = I_USR02-OCOD2
          BCDA2 = I_USR02-BCDA2
          CODV2 = I_USR02-CODV2
          OCOD3 = I_USR02-OCOD3
          BCDA3 = I_USR02-BCDA3
          CODV3 = I_USR02-CODV3
          OCOD4 = I_USR02-OCOD4
          BCDA4 = I_USR02-BCDA4
          CODV4 = I_USR02-CODV4
          OCOD5 = I_USR02-OCOD5
          BCDA5 = I_USR02-BCDA5
          CODV5 = I_USR02-CODV5
          CODVN = I_USR02-CODVN
          TRDAT = I_USR02-TRDAT
          LTIME = I_USR02-LTIME
          BCDA1 = I_USR02-BCDA1
         WHERE BNAME = SY-UNAME AND
               MANDT NE SY-MANDT.          "Every client but current.
    ENDFORM.                               "CHANGE_PASSWORD
          FORM LISTTITEL                                                *
    FORM LISTTITEL.
        WRITE: / 'List of client(s) on which the Password for User',
                SY-UNAME COLOR COL_KEY INTENSIFIED,
               'has been reset.'.
      WRITE: / 'Password originated on Client : ',
                SY-MANDT COLOR COL_KEY INTENSIFIED.
      SKIP.
      WRITE: / 'System: ' COLOR COL_HEADING INVERSE,
               20 SYST-SYSID COLOR COL_KEY INTENSIFIED.
      WRITE: / 'Date:  ' COLOR COL_HEADING INVERSE,
               20 SYST-DATUM COLOR COL_HEADING INVERSE.
      WRITE: / 'Time:   ' COLOR COL_HEADING INVERSE,
               20 SYST-UZEIT COLOR COL_HEADING INVERSE.
      ULINE AT (73).
      WRITE: /(73) SPACE COLOR COL_HEADING INTENSIFIED.
      WRITE: 1 'Cl.' COLOR COL_HEADING INTENSIFIED.
      WRITE: 4  SY-VLINE.
      WRITE: 5 'Encrypted Password' COLOR COL_HEADING INTENSIFIED.
      WRITE: 23 SY-VLINE.
      WRITE: 24 'Lock Status' COLOR COL_HEADING INTENSIFIED.
      WRITE: 49 SY-VLINE.
      WRITE: 50 'Last Used' COLOR COL_HEADING INTENSIFIED.
      WRITE: 60 SY-VLINE.
      WRITE: 61 'User Grp.' COLOR COL_HEADING INTENSIFIED.
      WRITE: 73 SY-VLINE.
      ULINE /(73).
    ENDFORM.                               " LISTTITEL
    Regards

  • Discover DNS setting for all client PC's in my local LAN

    I've done a fairly exhaustive search for an answer, but it seems there should be a way to discover the DNS IP address used in all of my PC's connected to my LAN/Domain.
    We recently upgraded the server the hosts the DA and the DNS which now have a different IP address. We use a hardcoded DNS server address (which will soon change) so I had to go to each PC on our network and change each computers DNS address. I think I changed
    them all, but I can't be 100% sure unless I go thru all of the PC's again.
    I'm hoping there is an easier way other than waiting for a user to complain about not being able to access local resources.
     

    Hi,
    Yes, like arnavsharma said, if you have DHCP server, you could get it once for all. 
    if no, you need alter it one by one.
    Alternative, you could use GPO to push the ipconfig /registerdns command to update.
    If anyone still look for old IP, on an individual workstation you would use the command
    ipconfig /flushdns to empty the cache and force fresh DNS lookups.
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact [email protected]

  • Query not working for all the material, may be space problem, need help.

    Hai all,
      I have a query with  variable material and date range. we have 60,000 materials.
    I am doing the report for the month of feb, year 2007.
        When I am executing up to 30,000 material the report is generated, anything beyond 30,000 materials the query is abending with the following message.
    00010004 AFunction aborted 
    SR 044 TSV_TNEW_PAGE_ALLOC_FAILED     
    00010004 ASystem error in program SAPLRSDRC and form TSV_TNEW_PAGE_ALLOC_FAILED ,
    BRAIN 299SAPLRSDRC TSV_TNEW_PAGE_ALLOC_FAILED
    any help in this regard is very much appreciated.
      I am thinking it is a problem with space.But not sure what space it is called?! The basis team saw the temp db and found they have lot of space.
    Thanks, Vijay.

    This tells there is not enough main memory (not disk space) for the program to run.
    - You can look the dump in ST22, it will have suggestions on increasing the ROLLAREA??, you can forward that to Basis.
    - Most likely you will not have any more memory to assign so the above may not be feasible. Try to rework your query so it works with less data.

  • Sending email is very slow for all clients

    Starting last week sending email takes anywhere from 1 to 5 minutes from the time we click on the "Send" button until it actually sends from the Mail app. It's happening to everyone on our network as far as I can tell.
    This happened in the past and after I ran Software Update on the mail server everything started working fine. Well this time we're still having the problem after all the mail server's software is up to date.
    I noticed that if I send an email and I create another email and send it within a minute or so of the first one finally going out, the second one sends off immediately. If I wait a few minutes and send an email I have to wait a minute again after clicking "send" for it to actually send off. It seems as though the connection to the mail server is being reset after a minute or so. And then for the Mail App to reconnect to the mail server is taking a minute to do. I have no idea how the whole process works, but that's what it seems like is happening.
    Hopefully this is making sense to you.
    If you have any ideas for me to try in order to get the Mail Apps to send out mail faster please let me know.
    One thing I have tried is to use the mail server's IP address instead of FQDN. Unfortunately Mail Apps with the IP address are acting just like ones with the FQDN. /shrug
    Thanks in advance for any help you can give me.

    Did some testing and webmail doesn't seem to have the same problems. I sent an email from my account through webmail and it showed up in the mail queue almost instantly. Sending mail from the Mail App through an IMAP connection is still taking me just about 1 minute. Some users are telling me that it takes up to 5 minutes at times.
    I also noticed that the server's CPU usage spikes about once per minute with clamscan taking up to 99% of the CPU's time. I don't remember this much CPU activity in the past. Also as of the last few weeks I have had users complaining of unusually high amounts of SPAM.
    I use spamtrainer to help with the SPAM problem.
    Oh how I adore those SPAMMERS... >.<

  • Change Smart View default colours for all clients

    I need to change Smart View default colours. But it must be done in a centralized way, so I can not set it up at the client level. I'm not sure if Smart View takes defaults from planning.css styles, or if they're defined somehow at the provider, or maybe specified in client installer.
    Thank you in advance for any guidance on this.
    SD

    SD,
    You may want to work with Oracle SmartView Support, to see if / how it is possible for SmartView, using a Service Request.
    Thanks!

  • Set PO query for all users in POWL screen

    Dear All,
    In Purchase order work list (POWL) need to define a new query and set it for all the users.
    Request to please let us know how we can create and set that query in POWL for all users?
    thanks,
    mahesh.

    Dear All,
    In Purchase order work list (POWL) need to define a new query and set it for all the users.
    Request to please let us know how we can create and set that query in POWL for all users?
    thanks,
    mahesh.

  • TMS configuration  for multi-clients in one system

    Hi All,
    we have got some problem defining transport routes in stms in transport domain...
    We have to add to target group for one system 6 clients:3 clients with the dev/test roles for country X and 3 clients with dev/test roles for country Y.
    Transport requests have to route only between clients for defined country (only for country X or only for country Y, must not mix).
    How i can get status when transport requests will route in one system only between clients of country X (or only for country Y)?
    Should i define two target groups and add to one group 3 clients for X and to the second 3 clinets for Y? I am not sure that it is enough. May be exists a lot of other options/ actions?
    Where is garanthy that requets from country X will not mixed with requests from Y?
    Thanks a lot.

    > The SSO is working fine for only the client which we used to import the certificate (verify.der).
    > 1>Is it that the certificate import should be done from all the clients exclusively ?
    Logon ticket certificate is instance wide, not client dependent. And you need to call STRUSTSSO2 in client 000 to export/import.
    > And the SSO is not working for other clients  in the same system .
    > 2>If yes  can you tell the procedure, why b'coz transaction STRUSTSSO2 is same for all clients and if we try to import the certificate again how about the existing one over there ?
    Could you provide more details about this issue you're facing? What is the Portal UME source? What application is it based on, BI or ESS/MSS?

  • Why should we select all key fields when using for all entries

    Hi,
    Why should we select all key fields in our select query when using for all entries statement?
    I read about for all entries but this point was not clear in any post.
    Please explain me
    Regards,
    Subhashini

    Dear Subhasini,
    It is because FOR ALL ENTRIES deletes the duplicate entries before populating the target internal table.
    Please do an F1 on FOR ALL ENTRIES & read the SAP documentation.
    I mean how duplicate entries will not get deleted when we use this?
    Quite simple, if you select  all key fields then each entry will be unique & there will not be any duplicate entries to delete !!
    BR,
    Suhas
    Edited by: Suhas Saha on Oct 16, 2009 9:41 AM

  • Need new spool for each Start_form

    Hi all
    I have a print program for RFFOAVIS. i have different orders spools shoould be like one spool for each order. but now i am seeing only one spool for all orders.
    First Open_form, then I am calling the same for each order using start_form and end_form. then i am calling Close_form.
    Though in Open_form i pass options tdnewid as 'x' or space i am seeing only one spool for all the orders.
    but i need New spool for each order.
    Regards
    helpful answeres are surely rewarded

    Hi Priyanka,
    you have to 'X' the field TDFINAL in OPTIONS too.
    Try this.
    Cheers,
    Joost

  • Prevent import of transport request for certain client

    Hello.
    I have two clients in TST system.
    I would like to delete one client.
    How can I prevent import of transport request for certain client?
    At hte same time users must transport request into other client in TST system.
    Is it possible?
    I know next features:
    1.
    se37-->
    SCCR_LOCK_CLIENT
    SCCR_UNLOCK_CLIENT
    2.
    tp locksys SID (from OS level)
    but they use for all client (for whole system).
    Best regards,
    Denis

    se37-->
    SCCR_LOCK_CLIENT
    SCCR_UNLOCK_CLIENT
    These are Client Specific not Cross client. So if you want to delete a client just Schedule the Delete Job and lock the client and no body would be able to transport on that client. I hope i understand your question properly.
    Regards,
    Subhash

  • How to write select query for all the user tables in database

    Can any one tell me how to select the columns from all the user tables in a database
    Here I had 3columns as input...
    1.phone no
    2.memberid
    3.sub no.
    I have to select call time,record,agn from all the tables in a database...all database tables have the same column names but some may have additional columns..
    Eg: select call time, record,agn from ah_t_table where phone no= 6186759765,memberid=j34563298
    Query has to execute not only for this table but for all user tables in the database..all tables will start with ah_t
    I am trying for this query since 30days...
    Help me please....any kind of help is appreciated.....

    Hi,
    user13113704 wrote:
    ... i need to include the symbol (') for the numbers(values) to get selected..
    eg: phone no= '6284056879'To include a single-quote in a string literal, use 2 or them in a row, as shown below.
    Starting in Oracle 10, you can also use Q-notation:
    http://download.oracle.com/docs/cd/E11882_01/server.112/e17118/sql_elements003.htm#i42617
    ...and also can you tell me how to execute the output of this script. What front end are you using? If it's SQL*Plus, then you can SPOOL the query to a file, and then execute that file, like this:
    -- Suppress SQL*Plus features that interfere with raw output
    SET     FEEDBACK     OFF
    SET     PAGESIZE     0
    -- Run preliminary query to generate main query
    SPOOL     c:\my_sql_dir\all_ah_t.sql
    SELECT       'select call time, record, agn from '
    ||       owner
    ||       '.'
    ||       table_name
    ||       ' where phone_no = ''6186759765'' and memberid = j34563298'
    ||       CASE
               WHEN ROW_NUMBER () OVER ( ORDER BY  owner          DESC
                              ,        table_name      DESC
                              ) = 1
               THEN  ';'
               ELSE  ' UNION ALL'
           END     AS txt
    FROM       all_tables
    WHERE       SUBSTR (table_name, 1, 4)     = 'AH_T'
    ORDER BY  owner
    ,       table_name
    SPOOL     OFF
    -- Restore SQL*Plus features that interfere with raw output (if desired)
    SET     FEEDBACK     ON
    SET     PAGESIZE     50
    -- Run main query:
    @c:\my_sql_dir\all_ah_t.sql
    so that i form a temporary view for this script as a table(or store the result in a temp table) and my problem will be solved..Sorry, I don't understand. What is a "temporary view"?

Maybe you are looking for