Multiple Oracle SQL statements in one Add Command

I am creating a report that needs a bunch of processing(SQL DDL statements) before the final select statement is generated for the report.
I am connecting to Oracle database however Crystal Report only allows me to give one SQL statement in one Add Command.
Is there a way to give multiple statements in one "Add Command" for the report ?
Thanks.

you can add more than one "Add Command" in the same report, and you can also treat them as views or table, so you can link them to each others and so on
good luck

Similar Messages

  • Does Java support mutliple sql statements in one call?

    statment.executeUpdate("DROP DATABASE IF EXISTS diy55;CREATE DATABASE IF NOT EXISTS diy55 DEFAULT CHARACTER SET utf8;GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,ALTER,INDEX,USAGE on diy55.* TO 'diy55'@'localhost' identified by 'diy55';FLUSH PRIVILEGES;");Java seemes doesn't support multiple sql statements in one call, just like PHP mysql_query(), is it?

    Then just extend the java.sql.Statement to your own Statement class and write logic which splits the given query at the right places and executes them one by one.
    That the mysql_query() already has it built-in wouldn't say that it isn't possible in Java. Comparing with PHP is a bit pointless, it is a completely different language.

  • How to use a Sybase table in Oracle SQL statement?

    How to use a Sybase table in Oracle SQL statement?
    Sybase version : 11.9.2.4
    Oracle version : 10.2.05
    Thanks.

    user12088323 wrote:
    How to use a Sybase table in Oracle SQL statement?
    Sybase version : 11.9.2.4
    Oracle version : 10.2.05
    Thanks.Any Oracle client connected to the Oracle database can access Sybase data through the <font style="background-color: #FFFFCC">Database Gateway for Sybase</font> (it requires an additional license) or the <font style="background-color: #FFFFCC">Database gateway for ODBC</font> (it's free).
    The Oracle client and the Oracle database can reside on different machines. The gateway accepts connections only from the Oracle database.
    A connection to the gateway is established through a database link when it is first used in an Oracle session. In this context, a connection refers to the connection between the Oracle database and the gateway. The connection remains established until the Oracle session ends. Another session or user can access the same database link and get a distinct connection to the gateway and Sybase database.
    Database links are active for the duration of a gateway session. If you want to close a database link during a session, you can do so with the ALTER SESSION statement.
    To access the Sybase server, you must create a <font style="background-color: #FFFFCC">database link</font>. A public database link is the most common of database links.
    SQL> CREATE PUBLIC DATABASE LINK dblink CONNECT TO
    2  "user" IDENTIFIED BY "password" USING 'tns_name_entry';
    --dblink is the complete database link name.
    --tns_name_entry specifies the Oracle Net connect descriptor specified in the tnsnames.ora file that identifies the gatewayAfter the database link is created you can verify the connection to the Sybase database, as follows:
    SQL> SELECT * FROM DUAL@dblink;
    Configuring Oracle Database Gateway for Sybase
    <font style="background-color: #FFFFCC">{message:id=10649126}</font>

  • Iterating through the result of a multiple row sql statement

    Hi all,
    I would like to access the results of a multiple row sql-statement. However I can't find out how to do this, can you help me here?
    I have tried using the "node-set" functions in xpath, but I can't seem to get it right.
    How should I approach this scenario?
    Sincerely
    Kim

    The jdbc service has the option of returning xml back to you ...if you do it this way then you can interogate the xml

  • Need help on how to code this SQL statement! (one key has leading zeros)

    Good day, everyone!
    First of all, I apologize if this isn't the best forum.  I thought of putting it in the SAP Oracle database forum, but the messages there seemed to be geared outside of ABAP SELECTs and programming.  Here's my question:
    I would like to join the tables FMIFIIT and AUFK.  The INNER JOIN will be done between FMIFIIT's MEASURE (Funded Program) field, which is char(24), and AUFK's AUFNR (Order Number) field, which is char(12).
    The problem I'm having is this:  All of the values in AUFNR are preceeded by two zeros.  For example, if I have a MEASURE value of '5200000017', the corresponding value in AUFNR is '005200000017'.  Because I have my SQL statement coded to just match the two fields, I obviously get no records returned because, I assume, of those leading zeros.
    Unfortunately, I don't have a lot of experience coding SQL, so I'm not sure how to resolve this.
    Please help!  As always, I will award points to ALL helpful responses!
    Thanks!!
    Dave

    >
    Dave Packard wrote:
    > Good day, everyone!
    > I would like to join the tables FMIFIIT and AUFK.  The INNER JOIN will be done between FMIFIIT's MEASURE (Funded Program) field, which is char(24), and AUFK's AUFNR (Order Number) field, which is char(12).
    >
    > The problem I'm having is this:  All of the values in AUFNR are preceeded by two zeros.  For example, if I have a MEASURE value of '5200000017', the corresponding value in AUFNR is '005200000017'.  Because I have my SQL statement coded to just match the two fields, I obviously get no records returned because, I assume, of those leading zeros.
    > Dave
    You can't do a join like this in SAP's open SQL.  You could do it in real SQL ie EXEC.... ENDEXEC by using SUSBTR to strip off the leading zeros from AUFNR but this would not be a good idea because a)  modifying a column in the WHERE clause will stop any index on that column being used and b) using real SQL rather than open SQL is really not something that should be encouraged for database portability reasons etc. 
    Forget about a database join and do it in two stages; get your AUFK data into an itab, strip off the leading zeros, and then use FAE to get the FMIFIIT data (or do it the other way round). 
    I do hope you've got an index on your FMIFIIT MEASURE field (we don't have one here); otherwise your SELECT could be slow if the table holds a lot of data.

  • Can we use different Databases (Oracle & SQL Server) in one report?

    Post Author: venki5star
    CA Forum: .NET
    Hi there.
    Can we use different databases (Oracle & SQL Server) in a same report?
    If possible how?
    Another question,
    Can we change the Provider Name at runtime of the given report. If so the above question is useless...
    Thanks in Advance.

    I tried this using Oracle Provider for OLEDB (the one that supplied by Oracle Client) and Crystal Reports 9. you can drag the column into designer but the image does not appear in preview.
    I guess it's because CR does not recognized it as image, and there are no information that the blob data is an image at all.

  • Multiple Alter Table Statements in one batch

    Hi Team,
    We have in one of our upcoming release two columns being added to a table that has over 20 million records and 14 indexes.
    We needed to add two columns to the table both not null (bit). Because it was taking a while to add the columns, we thought that putting these two alter statements in one batch would speed up the operation significantly but to my surprise it did not.
    Conclusion from my test: individual alter statements or batch alter statements take the same time
    Here are me test and results - table Order1 and Order2 are exactly the same structure and data.
    Test case 1:
    ===================
    ALTER TABLE Order1
    ADD OR_N BIT DEFAULT 0 NOT NULL
    go
    ALTER TABLE AccountTradeConfirmation_Alter1
    ADD OR_S BIT DEFAULT 0 NOT NULL
    Go
    Elapsed Time: 2 hrs
                 Mar 18 2015 5:56PM
    (1 row affected)
    Non-clustered index (index id = 3) is being rebuilt.
    Non-clustered index (index id = 4) is being rebuilt.
    Non-clustered index (index id = 5) is being rebuilt.
    Non-clustered index (index id = 6) is being rebuilt.
    Non-clustered index (index id = 7) is being rebuilt.
    Non-clustered index (index id = 8) is being rebuilt.
    Non-clustered index (index id = 9) is being rebuilt.
    Non-clustered index (index id = 10) is being rebuilt.
    Non-clustered index (index id = 11) is being rebuilt.
    Non-clustered index (index id = 12) is being rebuilt.
    Non-clustered index (index id = 13) is being rebuilt.
    Non-clustered index (index id = 14) is being rebuilt.
    (21777920 rows affected)
    Non-clustered index (index id = 3) is being rebuilt.
    Non-clustered index (index id = 4) is being rebuilt.
    Non-clustered index (index id = 5) is being rebuilt.
    Non-clustered index (index id = 6) is being rebuilt.
    Non-clustered index (index id = 7) is being rebuilt.
    Non-clustered index (index id = 8) is being rebuilt.
    Non-clustered index (index id = 9) is being rebuilt.
    Non-clustered index (index id = 10) is being rebuilt.
    Non-clustered index (index id = 11) is being rebuilt.
    Non-clustered index (index id = 12) is being rebuilt.
    Non-clustered index (index id = 13) is being rebuilt.
    Non-clustered index (index id = 14) is being rebuilt.
    (21777920 rows affected)
                 Mar 18 2015 7:52PM
    Test case 2:
    ===================
    ALTER TABLE Order2
    ADD OR_N BIT DEFAULT 0 NOT NULL, OR_S BIT DEFAULT 0 NOT NULL
    go
    2 hrs elapsed time
                 Mar 20 2015 11:10AM
    (1 row affected)
    Non-clustered index (index id = 3) is being rebuilt.
    Non-clustered index (index id = 4) is being rebuilt.
    Non-clustered index (index id = 5) is being rebuilt.
    Non-clustered index (index id = 6) is being rebuilt.
    Non-clustered index (index id = 7) is being rebuilt.
    Non-clustered index (index id = 8) is being rebuilt.
    Non-clustered index (index id = 9) is being rebuilt.
    Non-clustered index (index id = 10) is being rebuilt.
    Non-clustered index (index id = 11) is being rebuilt.
    Non-clustered index (index id = 12) is being rebuilt.
    Non-clustered index (index id = 13) is being rebuilt.
    Non-clustered index (index id = 14) is being rebuilt.
    (21777920 rows affected)
                 Mar 20 2015 1:12PM

    Hi Kiran,
    I have read your response a few times and I was not able to understand your angle. I assume based on the results of my test that Sybase does the following in processing the alter statements
    ALTER TABLE Order2
    ADD OR_N BIT DEFAULT 0 NOT NULL, OR_S BIT DEFAULT 0 NOT NULL
    go
    process alter ADD OR_N BIT
    -- > make copy of table
    ---> alter original table
    --> put data back in
    process alterOR_S BIT
    -- > make copy of table
    ---> alter original table
    --> put data back in
    rebuild index
    my expectation was that it would make a copy of the table only once and process the two alter statements. Also when doing the alter separately (test1) it rebuilt the index twice, however using the batch the index was rebuilt once (at least only one message displayed).
    Regards.

  • Multiple select, update statements in one script

    Hi All,
    I wrote a script that has multiple select, update statements. When I ran the script in the sqlplus, I got error on second update statement:
    ORA-00936: missing expression
    Have any idea what was the problem?
    Thanks
    OF

    the following are my codes:
    set termout off
    set showmode off
    set timing off
    --set echo off
    set echo on
    set heading off
    set verify off
    set pagesize 0
    -- Parameters
    -- Transaction Date
    -- Show dates this format by default
    ALTER SESSION SET nls_date_format='DD-MON-YYYY';
    -- Define bind variables to hold report parameters
    var v_date varchar2(13)
    var v__run_date varchar2(13)
    begin
    -- Get job sumission variable for Transaction Date
    select gjbprun_value into :v_date
    from general.gjbprun
    where gjbprun_job = '&&1'
    and gjbprun_one_up_no = &&2
    AND gjbprun_number = '01' ;
    End;
    spool fwuodoc_&&2
    select FABINVH_CODE, FABINVH_POHD_CODE,
    FABINVH_INVOICE_DATE, FABINVH_PMT_DUE_DATE, FABINVH_TRANS_DATE,
    fabinvh_complete_ind
    from fabinvh
    where fabinvh_complete_ind='R'
    and trunc(FABINVH_TRANS_DATE) < trunc(to_date('&&dd_mon_yyyy','dd-mon-yyyy'))
    update fabinvh set
    fabinvh_trans_date=to_date('&&dd_mon_yyyy','dd-mon-yyyy')
    where fabinvh_complete_ind='R'
    and trunc(FABINVH_TRANS_DATE) < trunc(to_date('&&dd_mon_yyyy','dd-mon-yyyy'))
    update fpbreqh set
    fpbreqh_trans_date=to_date('&&dd_mon_yyyy','dd-mon-yyyy')
    where fpbreqh_complete_ind='Y'
    and nvl(fpbreqh_appr_ind,'x')<>'Y'
    spool off
    exit

  • Multiple SQL statement in one step of procedure

    Hi,
    is it possible to run more than one sql command in only one step of a procedure.
    I need to run a script which insert about 2-300 records and i don't want to create 2-300 step.. any suggestions ?
    i tried :
    insert into myTable (myCol, myCol2) values('value1','value2');
    insert into myTable (myCol, myCol2) values('value2','value2');
    insert into myTable (myCol, myCol2) values('value3','value2');
    but it doesn't work!

    Hi,
    Why don't you try to write all your data:
    value1;value2 etc... in a file and create an interface that load this data to your table?
    Any way if you are in Oracle database try the begin end block as it said.
    or write a jython script to do the job.

  • 2 sql statements in one trigger?

    Greetings,
    I am working with the Oracle 10g Database. While creating several triggers I am encountering quite some problems. In fact, I want to do 2 steps in one trigger. Is that possible? e.g:
    Before Update on table for each row
    begin
    Update table set column=Max(column)+1 where column = 0 and ID = :old.ID;
    then
    Insert into table values (column1, column2, column3, column)
    values (:new.column1, :new.column2, :new.column3, :new.column)
    end;
    What I want to do is that before an update on the table
    1st: update current row and set one value to the max of the column + 1
    2nd: insert the new values which are given by the original update statement with the value for the column = 0, which indicates later that this row is the newest one.
    Is that somehow possible? I just read that normally you only have one DML statement per trigger. The problem is that both update and insert statement need to be triggered at the same time everytime someone tries to update values of the current table.
    best regards
    Jörn

    > The problem is that I have more than 30 tables with
    history, creating a history table for each would be
    very bad...
    Why is it bad to have 30 history tables? I currently work with an application having 141 history tables. Nothing bad about it over here.
    > And lets say i am not the man who first intended this
    structure, i am just the one who has to build up the
    database as told ;-) So the history should be zero
    for the latest version.
    We are just saying that your current implementation isn't the best one out there for storing history. As said, you would have to circumvent the mutating table problem. And you would have to take special care about the multi-user situation where two sessions are updating/inserting at the same time and you wouldn't want both to use the same max(column)+1.
    Using a history table is an alternative, and so is introducing a "creation_date" column and selecting the rows with the max(creation_date) as your current row.
    Regards,
    Rob.

  • Combine multiple oracle 10g db as one 11g database with different schemas

    We have 3 10g databases on a solaris machine
    We are planning to migrate them and upgrade to 11g rel2 on linux machine
    and finally merge those into one database as different schemas
    has anyone got good ideas of the best strategy to do that
    thanks

    has anyone got good ideas of the best strategy to do thatexpdp/impdp

  • Multiplication in SQL statement

    Could somebody help me with the following problem?
    I am using a query inside a formatted search to multiply 2 UDF's into the field of the formatted search. (UDF1 * UDF2 = target field).
    All fields are defined with 4 decimal positions, but some calculations give strange results: 0,2 * 0,2 = 4 or 2 * 2,2222 = 4,4400. The problems seems to be related to the fact that the target has never more then 2 decimal places.
    The UDF's are of type UNIT&TOTALS with structure QUANTITY, the target field is RDR1_QUANTITY. In general settings the number of decimal places is set to 4.
    The query is:
    SELECT aantal =   CAST (( ( CAST ($[$38.U_Inhoud.0] AS Float(8,4)  ))   *
                                 ( CAST ($[$38.U_Aantal_V.0] AS Float(8,4)  )) ) AS Float (8,4) )
    Has anybody a got idea? I have already tried with and without CAST and FLOAT but the above version is best one sofar. Thanks for your reactions, Egbert

    Try the following:-
    SELECT CAST(ROUND (($[$38.U_Inhoud.NUMBER] * $[$38.U_Aantal.NUMBER]),4) AS VARCHAR(13))
    I think the reason you are only ever getting 2 decimal places back is that business one formats the returned numeric result based on the settings for a field of type 'Amount'.  You possibly have 'Amounts' set to display 2 decimal places.
    The simple workaround I have used for this is to return the field as a character datatype as this will prevent business one from reformatting it.
    Also note that you do not need to cast/convert the values you are reading from the screen.  By using '.NUMBER' instead of '.0' the values will be processed as numerics rather than as strings.
    Hope this helps,
    John.

  • How to execute multiple sql statements

    hi all
    i am wondering if i can execute multiple sql statements in one shot with >> execute immediate command
    for example:
    i define the variable as X := sql statement
    Y := sql statement
    z := sql statement
    can i do execute immediate (X,Y, Z);
    if yes how ?? and if not any possible alternate
    thanks

    Starting with Ganesh's code
    DECLARE
       l_statement                 VARCHAR2 (2000);
       v_passwd                    VARCHAR2 (200);
       v_username                  VARCHAR2 (200) := 'test';
       v_pwd_key                   VARCHAR2 (200) := 'lwty23';
       v_dblink_name               VARCHAR2 (2000);
       v_dblink_drop               VARCHAR2 (2000);
       v_dblink_create             VARCHAR2 (2000);
       v_dblink_check_connection   VARCHAR2 (2000);
       l_number                    NUMBER;
    BEGIN
       --<<c_instance>>
       FOR c_instance IN (SELECT *
                            FROM v_oracle_instances
                           WHERE environment = 'Developement')
       LOOP
          SELECT encpwd_owner.display_db_encpwd (v_username,
                                                 c_instance.host_name,
                                                 c_instance.instance_name,
                                                 v_pwd_key)
            INTO v_passwd
            FROM DUAL;
          v_dblink_name := c_instance.host_name || '_' || c_instance.instance_name;
          v_dblink_create :=
                ' CREATE DATABASE LINK '
             || v_dblink_name
             || ' CONNECT TO '
             || v_username
             || ' '
             || 'IDENTIFIED BY '
             || v_passwd
             || ' USING'
             || ' ''(DESCRIPTION=
    (ADDRESS=(PROTOCOL=TCP)(HOST= '
             || c_instance.host_name
             || ')(PORT='
             || c_instance.LISTENER_PORT
             || '))(CONNECT_DATA=(SID='
             || c_instance.instance_name
             || ')))''';
          v_dblink_check_connection := 'select 1 from global_name@' || v_dblink_name || '.QCM';    --- Notice this change. I am simply selecting 1. That should be enough to test the database link.
          v_dblink_drop := 'drop database link ' || v_dblink_name || '.QCMTLAF';
          -- l_statement := 'BEGIN ' || v_dblink_create ';' || v_dblink_check_connection ';' || v_dblink_drop '; END ;'
          BEGIN
              EXECUTE IMMEDIATE (v_dblink_create);
              DBMS_OUTPUT.PUT_LINE ('DB Link ' || v_dblink_name || ' Created');
         EXCEPTION
            WHEN others THEN
               dbms_output.put_line( 'Failed to create the database link ' || v_dblink_name  );
               dbms_output.put_line( dbms_utility.format_error_backtrace() );
               INSERT INTO error_table( column_list )
                 VALUES( <<list of values>> );
         END;
          EXECUTE IMMEDIATE (v_dblink_check_connection) INTO l_number;    --- Notice this.
          DBMS_OUTPUT.PUT_LINE ('DB Link ' || v_dblink_name || ' Tested');
          BEGIN
             EXECUTE IMMEDIATE (v_dblink_drop); 
             DBMS_OUTPUT.PUT_LINE ('DB Link ' || v_dblink_name || ' Dropped');
          EXCEPTION
             WHEN others THEN
               dbms_output.put_line( 'Failed to drop the database link ' || v_dblink_name  );
               dbms_output.put_line( dbms_utility.format_error_backtrace() );
               INSERT INTO error_table( column_list )
                 VALUES( <<list of values>> );
         END;
       END LOOP;
    END;But I agree with the point that others have brought up that it really doesn't make sense to create and drop a database link like this.
    Justin

  • How to join multiple SQL statements?

    I'm try to combine four of the following SQL statements as one, and I basically want to group by the new combined sql statement by suspension
    Using: Oracle 10g
    Here's my sql statements/what I've tried but doesn't seem to work:
    select *
    from
    --NBA
    select
           decode (t.league_id, 1 , 'NBA') as League,
           t.moniker as First,
           t.Last_name as Last,
           (t.To_Team_Name || ' ' || To_Team_Nickname) as Team,
           count(*) Suspensions
    from   customer_data.cd_bk_trans t,
           customer_data.cd_bk_roster r
    where  t.player_id = r.player_id
    and    t.trans_type_id in (12,13,14)
    and    r.status = 'Y'
    and    r.league_id = 01
    group by t.league_id,t.last_name, t.moniker, t.to_team_name,t.to_team_nickname
    order by Suspensions desc
    union
    --MLB
    select
           decode (t.league_id, 7 , 'MLB') as League,
           t.moniker as First,
           t.Last_name as Last,
           (t.from_Team_Name || ' ' || from_Team_Nickname)as Team,
           count(*) Suspensions
    from   customer_data.cd_baseball_trans t,
           customer_data.cd_baseball_roster r
    where  t.player_id = r.player_id
    and    t.comments like '%Susp%'
    and    r.status = 'Y'
    and    r.league_id = 07
    group by t.league_id,t.last_name, t.moniker, t.from_team_name,t.from_team_nickname
    order by Suspensions desc
    union
    --NHL
    select
           decode (r.team_id,18, 'NHL') as League,
           t.fn as First,
           t.ln as Last,
           (t.from_Team_Name || ' ' || from_Team_Nickname)as Team,
           count(*) Suspensions
    from   customer_data.cd_nhl_trans t,
           customer_data.cd_nhl_roster r
    where  t.player_id = r.player_id
    and    t.trans_type in (10,11,12)
    and    r.status = 'Y'
    and    r.league_id = 18
    group by r.league_id, t.ln, t.fn, t.from_team_name,t.from_team_nickname
    order by Suspensions desc
    union
    --NFL
    select
           decode (t.league_id, 8, 'NFL') as League,
           t.moniker as First,
           t.last_name as Last,
           (t.from_Team_Name || ' ' || from_Team_Nickname)as Team,
           count(*) Suspensions
    from   customer_data.cd_football_trans t,
           customer_data.cd_football_roster r
    where  t.player_id = r.player_id
    and    t.trans_type_id in (24,25)
    and    r.status = 'Y'
    and    r.league_id = 8
    group by  t.league_id, t.last_name, t.moniker,           t.from_team_name,t.from_team_nickname
    order by  Suspensions desc
    Order by Suspensions desc

    Hi,
    Remove the ORDER BY clause in all the queries expcept lastone. Then it will work.
    You can have the ORDER BY clause in the last query of the inline view. Otherwise it will give the error.
    Run the query given below
    SELECT *
    FROM (
    --NBA
    SELECT decode(t.league_id, 1, 'NBA') AS league,
    t.moniker AS FIRST,
    t.last_name AS LAST,
    (t.to_team_name || ' ' || to_team_nickname) AS team,
    COUNT(*) suspensions
    FROM customer_data.cd_bk_trans t, customer_data.cd_bk_roster r
    WHERE t.player_id = r.player_id
    AND t.trans_type_id IN (12, 13, 14)
    AND r.status = 'Y'
    AND r.league_id = 01
    GROUP BY t.league_id,
    t.last_name,
    t.moniker,
    t.to_team_name,
    t.to_team_nickname
    UNION
    --MLB
    SELECT decode(t.league_id, 7, 'MLB') AS league,
    t.moniker AS FIRST,
    t.last_name AS LAST,
    (t.from_team_name || ' ' || from_team_nickname) AS team,
    COUNT(*) suspensions
    FROM customer_data.cd_baseball_trans t,
    customer_data.cd_baseball_roster r
    WHERE t.player_id = r.player_id
    AND t.comments LIKE '%Susp%'
    AND r.status = 'Y'
    AND r.league_id = 07
    GROUP BY t.league_id,
    t.last_name,
    t.moniker,
    t.from_team_name,
    t.from_team_nickname
    UNION
    --NHL
    SELECT decode(r.team_id, 18, 'NHL') AS league,
    t.fn AS FIRST,
    t.ln AS LAST,
    (t.from_team_name || ' ' || from_team_nickname) AS team,
    COUNT(*) suspensions
    FROM customer_data.cd_nhl_trans t, customer_data.cd_nhl_roster r
    WHERE t.player_id = r.player_id
    AND t.trans_type IN (10, 11, 12)
    AND r.status = 'Y'
    AND r.league_id = 18
    GROUP BY r.league_id,
    t.ln,
    t.fn,
    t.from_team_name,
    t.from_team_nickname
    UNION
    --NFL
    SELECT decode(t.league_id, 8, 'NFL') AS league,
    t.moniker AS FIRST,
    t.last_name AS LAST,
    (t.from_team_name || ' ' || from_team_nickname) AS team,
    COUNT(*) suspensions
    FROM customer_data.cd_football_trans t,
    customer_data.cd_football_roster r
    WHERE t.player_id = r.player_id
    AND t.trans_type_id IN (24, 25)
    AND r.status = 'Y'
    AND r.league_id = 8
    GROUP BY t.league_id,
    t.last_name,
    t.moniker,
    t.from_team_name,
    t.from_team_nickname
    ORDER BY suspensions DESC)
    ORDER BY suspensions DESC

  • Spooling Extracts from Multiple SQL statements in 1 File

    Hi all,
    I am trying to spool extract results of 3 separate SQL statements into one single file. I wrote a SQL block similar to the one below. However, the result of the statements overwrite each other: 3 overwrote 2 and overwrote 1. Any suggestion how to combined there extracted results in one file?
    spool c:\test.txt
    <SQL statement 1>
    <SQL statement 2>
    <SQL statement 3>
    /spool OFF
    Thanks in advance
    Jason

    Please paste you SQL file here. These is no way one should overwrite another.
    Eric

Maybe you are looking for