Get the columns returned by the query without running

I have a table that stores SELECT queries in a column. I developed a .net application where the interesting thing for the user is what columns of the following SELECT statement returns. Currently, I load the sql as an OracleCommand object CommandText and fill a DataTable using an OracleDataAdapter object. I then read the names of the columns of the table filled. The data is not fully used. Requests can take up to 15 seconds to run. Because I do not used the data, I was hoping to eliminate the actual recovery of data and reduce the time needed to retrieve the records. Is it possible to analyze the statement for the colunm names with it makes the request for enforcement? Thank you.

I imagine that there is a way you can search in the data dictionary, but you can also try to add 'WHERE 1 = 0' If you want the metadata.

It will be useful,
Greg

Tags: Database

Similar Questions

  • How export (unload) result of the query without running query on sql developer

    Hello

    I want to know how export (unload) result of the query without running query on sql developer.

    I know this way.
    1. execution of query
    2. click on "Download" on the results tab
    http://i.stack.imgur.com/CQ4Qb.jpg


    Is he available unload a query result before the race?

    No, but you can do this ask the developer SQL change however, for other users can vote and add weight to the possible future implementation.

    Kind regards
    K.

  • How to get the query of the region "PL/SQL function body returns the query string"?

    Hello

    is it possible to get the query string from the region of type "PL/SQL function body returns the query string"?

    I can get the definition of the region as a PL/SQL procedure, but I am interested in the returned query. I tried to write something like

    < pre > v_return_query: = «...» » ;
    : P49_QUERY: = v_return_query;
    Return v_return_query; < / pre >

    to save the return on hidden item P49_QUERY string, but it does not work. I get the error message: ERR-1002 cannot find the item for the "P49_QUERY" element ID in the application '4000 '.

    Kind regards
    Przemek

    If you need to make reference to a page element in the block then you can use this type of control to avoid having to use generic column names:

    if apex_application.get_current_flow_sgid(:APP_ID) = apex_application.get_sgid then-- runtime  :P9_SQL := vSQL;else-- design time  null;end if;
    

    But if all you want to do is capture the SQL debugging you can take all the references element in the block and use the insert statement (in a debug table) as I showed earlier.

    Scott

  • How to get the query execution time without running...?

    Hello

    I had one condition... as follows...
    I had 3 sql statements. I need to run only sql what runtime is very less.

    Can someone help me, how to get the time query and run this query without using explain plan... ?

    Thank you
    Rajesh

    I can't think in any way at all to get the query execution time without running the query.

    You might get an estimate ( approximation ) If you are using explain plan.

    But you have governed to explain plan for a reason, so I can't help you.
    Why you do not want to use don't explain plan?

  • get the result without Union all the

    < pre >
    WITH GET_BALANCE AS
    (SELECT "CREDIT2' AS TYPE, - 6336.37 AS A AMOUNT OF DOUBLE
    Union of all the
    SELECT 'CREDIT', 8340.52 OF THE DOUBLE
    Union of all the
    SELECT 'CREDIT', THE DOUBLE 609.48
    Union of all the
    SELECT 'CREDIT', 50 OF THE DOUBLE
    Union of all the
    SELECT 'CREDIT', 6336.37 OF THE DOUBLE
    Union of all the
    Select "DEBIT", 628.68 DUAL FROM
    Union of all the
    Select "DEBITORG", 9000 DUAL FROM
    Union of all the
    SELECT 'DEBIT1', DOUBLE 50,81
    Union of all the
    SELECT 'DEBIT2',-679.49 OF THE DOUBLE
    UNION ALL
    SELECT 'DEBIT1', THE DOUBLE 679.49
    UNION ALL
    SELECT 'DEBIT2',-679.49 OF THE DOUBLE
    )

    SELECT sum (debit) debit, sum (credit) in the form of credit, (sum (debit) - sum (credit)) such as (FROM) balance
    SELECT FLAT CREDIT, DEBIT GET_BALANCE 0
    WHERE TO TYPE LIKE 'CREDIT %'
    UNION ALL
    SELECT 0 CREDIT, DEBIT GET_BALANCE PLATE
    WHERE TO TYPE LIKE' FLOW %')

    I got the result;
    credit debit balance
    9000 9000 0
    < / pre >
    But,
    I want to get the result without union all.
    I try sum on the partition by, or group by type...
    can not get the result. you would tell me the other way to get above result

    Thank you

    Published by: Jimmie_M on October 4, 2010 14:59

    Published by: Jimmie_M on October 4, 2010 15:01

    Hello

    Here's one way:

    WITH   got_credit_and_debit     AS
    (
         SELECT     SUM ( CASE
                     WHEN  SUBSTR (type, 1, 6) = 'CREDIT'
                         THEN  amount
                    END
                  )     AS credit
         ,     SUM ( CASE
                        WHEN  SUBSTR (type, 1, 5) = 'DEBIT'
                         THEN  amount
                    END
                  )     AS debit
         FROM    get_balance
    )
    SELECT     credit
    ,     debit
    ,     debit - credit     AS balance
    FROM     got_credit_and_debit
    ;
    

    What type of application is as follows, where the balance is defined as the debit - credit? Usually, it's the opposite: balance = credit - debit.

    You don't absolutely need a subquery:

    SELECT     SUM ( CASE
                WHEN  SUBSTR (type, 1, 6) = 'CREDIT'
                    THEN  amount
               END
             )     AS credit
    ,     SUM ( CASE
                   WHEN  SUBSTR (type, 1, 5) = 'DEBIT'
                    THEN  amount
               END
             )     AS debit
    ,     SUM ( CASE
                WHEN  SUBSTR (type, 1, 6) = 'CREDIT'
                THEN  amount
                   WHEN  SUBSTR (type, 1, 5) = 'DEBIT'
                    THEN  -amount
               END
             )     AS balance
    FROM    get_balance
    

    Published by: Frank Kulash, October 4, 2010 18:15
    Added query replacing without subquery

  • To get the updates without sp3

    When I do a system restore, I used to be able to get updates without installed SP3.  Is there a way to get the updates without SP3? Is it possible to get the smaller version from 1 computer to SP3 updates? I can only find the network version. I tried to turn on updates, but he didn't send me a.

    Hi Larry132,

    Ignore the warning of network installation and download and install it. It works very well.

  • Is it possible to get the query Details of the old run from oracle?

    Is it possible to get the query Details of the old run from oracle? I mean, I wanted to know the details of a request executed work, I know the time taken by the query to run? Is it possible to know?

    Yes, it is possible to obtain, provided you use enterprise edition version + additional license *. A few tables to get information of are:

    dba_hist_sqltext

    dba_hist_sqlstat

    dba_hist_snapshot

    dba_hist_sql_plan

    dba_hist_active_sess_history

  • I am new to Adobe Stock.  An Adobe stock image is usable like a Facebook profile picture?  My concern is that the image profile can saved by other users of Facebook... so they can get the image without having to pay Adobe for it.

    I am new to Adobe Stock.  An Adobe stock image is usable like a Facebook profile picture?  My concern is that the image profile can saved by other users of Facebook... so they can get the image without having to pay Adobe for it.

    Hi martyc98498222,

    I suggest you to use the Image of Adobe Stock for social media, also you can refer to the following document: https://helpx.adobe.com/stock/faq.html#Adobe%20Stock%20usage%20and%20licensing

    Kind regards

    Tanuj

  • Rewrite the query without a clause EXISTS

    I would like to know another way to write the query without the EXISTS clause below. The main problem is with the inner query not allowing Java Hibernate to cache the results of the query.

    Select max (wt.wtime) wttme
    x wt.
    PIA,
    z g
    where wt.vid = v.vid and
    v.GID = g.gid and
    g.gname = "XXX" and
    not exists (select *)
    x wt1.
    y v1,.
    z g1
    where wt1.vid = v1.vid and
    v1. GID = g1.gid and
    G1.gname = "XXX" and
    (wt1.last_updated < (sysdate-. 0013) or)
    Upper (WT1. Error) '= t'
    )
    )

    z / / DESC;
    Name of Type Null
    GID NOT NULL NUMBER
    GNAME NOT NULL VARCHAR2 (100)
    ACTIVE NON-NULL CHAR (1)
    DATE OF UPDATE_DATE
    UPDATED_BY VARCHAR2 (50)

    GID GNAME UPDATE_DATE ACTIVE UPDATED_BY
    1 XXX Y 6 July 09 14:50:24 Test

    y / / DESC;
    Name of Type Null
    VID NOT NULL NUMBER
    VNAME NOT NULL VARCHAR2 (100)
    GID NOT NULL NUMBER
    ACTIVE NON-NULL CHAR (1)
    DATE OF UPDATE_DATE
    UPDATED_BY VARCHAR2 (50)

    VID VNAME GID UPDATE_DATE ACTIVE UPDATED_BY
    1 ICT 1 Y 6 July 09 14:50:24 Test
    arvato 2 1 O 6 July 09 14:50:24 Test

    / / DESC x;
    Name of Type Null
    VID NOT NULL NUMBER
    NUMBER OF WTIME
    ERROR VARCHAR2 (4000)
    NOT CLOSED NULL CHAR (1)
    LAST_UPDATED DATE

    VID WTIME LAST_UPDATED CLOSED ERROR
    1 65 N N 10 JUNE 09 00:00:00
    2 23 N N AUGUST 10 09 00:00:00

    Ken R says:
    What I would like to have is a query WITHOUT a clause EXISTS and to implement INSIDE logical query * (wt1.last_updated< (sysdate="" -="" .0013)="" or="" upper(wt1.error)='T' )*="" in="" the="" outer="">

    Well have a look at the two queries above then.

  • Installer won't work, indicating that a file may be missing. How to get the installer to run?

    I am running Windows & and downloaded CS6 Master Collection and when I try to run the config file, I get an error indicating that a file is maybe missing and to download and run a couple of potential fixes.  I did, but I have the same error of ge.  I tried only download Photoshop 6 and run this configuration file, but get the same result.  I run other non Adobe without any problem of product configuration files.  What can I do to get the installer to run?

    Move the files to your destop configuration and click "Run as Administrator".

    If this fails, you probably have a corrupt download and should re-download the Installer file.

    For more specific help, attach a screenshot of the error message.

  • I have a plan with adobe photoshop and lightroom.  The lightroom works fine, but I can't get the photoshop to run.  I have to go back to an old copy of photoshop to do the work.  All thoughts

    I have a plan with adobe photoshop and lightroom.  The lightroom works fine, but I can't get the photoshop to run.  I have to go back to an old copy of photoshop to do the work.  All thoughts

    Thank you for your help.  I just downloaded the Photoshop CC2015 for the 7th time and it now seems to work fine.  Sorry to have bothered you... It is good to know that there are people like you who will help if necessary.

    Thanks again.

  • I use CS5.1 and cannot open it all at once. I get the prompt to get the SC6 JAVA run-time inheritance.  I installed, but still cannot open Photoshop. Any ideas?

    I use CS5.1 and cannot open it all at once. I get the prompt to get the SC6 JAVA run-time inheritance.  I installed, but still cannot open Photoshop. Any ideas?

    Would you please install Adobe Application Manager from the link below, then try again to install the application again:

    Adobe - Adobe Application Manager: for Macintosh: Adobe Application Manager

    ~ Sarika

  • I installed CS5 on macbook pro 10.9.4. I can't get the update to run to update the applications to the latest version. He said that there was an error trying to download the update and try again later.

    I installed CS5 on macbook pro 10.9.4. I can't get the update to run to update the applications to the latest version. He said that there was an error trying to download the update and try again later.

    update directly: http://www.adobe.com/downloads/updates/

  • Void query causes the query to run forever

    Here are the two original requests that I started with. They refer to the correct when executed separately results but when combined it causes the query to run and run and run and run forever. I try to delete the query results of query 2 1 with a statement of "not in". 3 is the query that runs always with this 'not in' statement that runs forever. Please help me! *!

    -Request 1
    SELECT DISTINCT
    S.NAME,
    S.RRN,
    RTRIM (LTRIM (S.STREET_NBR) |) ' ' ||
    RTRIM (SUBSTR (S.STREET, 33, 2)) | ' ' ||
    RTRIM (SUBSTR (S.STREET, 1, 28)) | ' ' ||
    RTRIM (SUBSTR (S.STREET, 29, 4)) | ' ' ||
    RTRIM (SUBSTR (S.STREET, 35, 2))) | ' ' ||
    NVL2 (S.UNIT_NBR, ' #',' ') | ' ' ||
    ADDRESS LTRIM (S.UNIT_NBR),
    CITY OF S.CITY_NAME,
    S.STPV_CODE STATE,
    RTRIM (S.ZIP_CODE) |
    '-'||
    S.ZIP_PLUS4 ZIP,
    S.HOME_PHONE,
    S.ACCT_NBR,
    TO_CHAR (S.EXPR_DATE, 'MMDDYY') START_DATE,
    TO_CHAR ((P.EFF_DATE-1), 'MMDDYY') END_DATE.
    TO_CHAR(SYSDATE,'MMDDYY') FILE_DATE,
    ROUND ((-1 * (S.BALANCE_AMT + (S.BALANCE_AMT*.06) + S.DLVF_AMT)) * 100) TO BALANCE.
    S.STAT_FLAG,
    MIN (P.SEQ_CTR)
    Of
    THE DISCUS THROW. SUB_SUN S,.
    THE DISCUS THROW. TRN_STP_SUN P,.
    THE DISCUS THROW. TRN_MEM_SUN M.
    (SELECT
    SUB_RRN,
    TRAN_CODE,
    EFF_DATE,
    MIN (SEQ_CTR)
    Of
    THE DISCUS THROW. TRN_DLR_SUN
    WHERE
    TRAN_CODE = 'BILL' AND
    EFF_DATE > = TRUNC (SYSDATE)-65
    GROUP BY
    SUB_RRN,
    TRAN_CODE,
    EFF_DATE,
    D SEQ_CTR)
    WHERE
    S.RRN = P.SUB_RRN AND
    S.RRN = M.SUB_RRN AND
    S.RRN = D.SUB_RRN (+) AND
    TRIM (P.PAPR_CODE) = "SS" AND
    S.BILL_CODE NOT IN ("PRTY", "EZCC', 'EMPB', 'CTCE', 'NSPC", "NYET", "NIEF", "SAMP", "ALTP", "COMP", "CMHC", "MAIL") AND
    TRIM (S.STAT_FLAG) = 'F' AND
    P.TYPE = 'P' AND
    P.SPRS_CODE IN ('NOPY","CHMD","SCOUT","TIME") AND
    TRUNC (P.EFF_DATE) BETWEEN TRUNC (SYSDATE)-43 AND TRUNC (SYSDATE)-29 AND
    S.NAME_FLAG! = 'B' AND
    (S.BALANCE_AMT + (S.BALANCE_AMT*.06) + (S.DLVF_AMT)) <-6.99 AND
    M.CODE! = 'DISP' AND
    NOT EXIST
    (SELECT
    Q.HOME_PHONE
    Of
    THE DISCUS THROW. SUB_SUN Q
    WHERE
    S.HOME_PHONE = Q.HOME_PHONE AND
    Q.SUBT_CODE IN ('HARD DRIVES', 'HDLV') AND
    Q.STAT_FLAG = 'C')
    GROUP BY
    S.NAME,
    S.RRN,
    RTRIM (LTRIM (S.STREET_NBR) |) ' ' ||
    RTRIM (SUBSTR (S.STREET, 33, 2)) | ' ' ||
    RTRIM (SUBSTR (S.STREET, 1, 28)) | ' ' ||
    RTRIM (SUBSTR (S.STREET, 29, 4)) | ' ' ||
    RTRIM (SUBSTR (S.STREET, 35, 2))) | ' ' ||
    NVL2 (S.UNIT_NBR, ' #',' ') | ' ' ||
    LTRIM (S.UNIT_NBR),
    S.CITY_NAME,
    S.STPV_CODE,
    RTRIM (S.ZIP_CODE) |
    '-'||
    S.ZIP_PLUS4,
    S.HOME_PHONE,
    S.ACCT_NBR,
    TO_CHAR (S.EXPR_DATE, 'MMDDYY'),
    TO_CHAR ((P.EFF_DATE-1), 'MMDDYY').
    TO_CHAR (SYSDATE, 'MMDDYY'),
    (-1 * (S.BALANCE_AMT + (S.BALANCE_AMT*.06) + S.DLVF_AMT) * 100),
    S.STAT_FLAG
    ORDER BY 10;

    -The application 2
    Select
    THE DISCUS THROW. TRN_STP_SUN. SUB_RRN
    Of
    THE DISCUS THROW. TRN_STP_SUN,
    (select SUB_RRN, min (seq_ctr) MINSEQ, SRCE_CODE1 of DISCUS. SUB_RRN TRN_STP_SUN, SRCE_CODE1 group) MIN_ROWS
    where
    THE DISCUS THROW. TRN_STP_SUN. MIN_ROWS = SUB_RRN. SUB_RRN
    And DISCUS. TRN_STP_SUN. MIN_ROWS = SRCE_CODE1. SRCE_CODE1
    And DISCUS. TRN_STP_SUN. MIN_ROWS = SEQ_CTR. MINSEQ
    And DISCUS. TRN_STP_SUN. SRCE_CODE1 IN ('FREE', 'ALTP","CANADA","E","DENY","DOOR")
    And TRUNC (DISCUS. TRN_STP_SUN. EFF_DATE) BETWEEN TRUNC (SYSDATE)-460 AND TRUNC (SYSDATE)-0
    And DISCUS. TRN_STP_SUN. TYPE = S"

    Request 3 (Broken query)
    SELECT DISTINCT
    S.NAME,
    S.RRN,
    RTRIM (LTRIM (S.STREET_NBR) |) ' ' ||
    RTRIM (SUBSTR (S.STREET, 33, 2)) | ' ' ||
    RTRIM (SUBSTR (S.STREET, 1, 28)) | ' ' ||
    RTRIM (SUBSTR (S.STREET, 29, 4)) | ' ' ||
    RTRIM (SUBSTR (S.STREET, 35, 2))) | ' ' ||
    NVL2 (S.UNIT_NBR, ' #',' ') | ' ' ||
    ADDRESS LTRIM (S.UNIT_NBR),
    CITY OF S.CITY_NAME,
    S.STPV_CODE STATE,
    RTRIM (S.ZIP_CODE) |
    '-'||
    S.ZIP_PLUS4 ZIP,
    S.HOME_PHONE,
    S.ACCT_NBR,
    TO_CHAR (S.EXPR_DATE, 'MMDDYY') START_DATE,
    TO_CHAR ((P.EFF_DATE-1), 'MMDDYY') END_DATE.
    TO_CHAR(SYSDATE,'MMDDYY') FILE_DATE,
    ROUND ((-1 * (S.BALANCE_AMT + (S.BALANCE_AMT*.06) + S.DLVF_AMT)) * 100) TO BALANCE.
    S.STAT_FLAG,
    MIN (P.SEQ_CTR) SEQ_CTR
    Of
    THE DISCUS THROW. SUB_SUN S,.
    THE DISCUS THROW. TRN_STP_SUN P,.
    THE DISCUS THROW. TRN_MEM_SUN M.
    (SELECT
    SUB_RRN,
    TRAN_CODE,
    EFF_DATE,
    MIN (SEQ_CTR)
    Of
    THE DISCUS THROW. TRN_DLR_SUN
    WHERE
    TRAN_CODE = 'BILL' AND
    EFF_DATE > = TRUNC (SYSDATE)-65
    GROUP BY
    SUB_RRN,
    TRAN_CODE,
    EFF_DATE,
    D SEQ_CTR)
    WHERE
    S.RRN = P.SUB_RRN AND
    S.RRN = M.SUB_RRN AND
    S.RRN = D.SUB_RRN (+) AND
    TRIM (P.PAPR_CODE) = "SS" AND
    S.BILL_CODE NOT IN ("PRTY", "EZCC', 'EMPB', 'CTCE', 'NSPC", "NYET", "NIEF", "SAMP", "ALTP", "COMP", "CMHC", "MAIL") AND
    TRIM (S.STAT_FLAG) = 'F' AND
    P.TYPE = 'P' AND
    * S.RRN NOT IN (select + _ *)
    DISCUS. TRN_STP_SUN. SUB_RRN_ *.
    de_ *
    DISCUS. TRN_STP_SUN,_ *.
    + (select SUBNRNS, min (seq_ctr) MINSEQ, SRCE_CODE1 de DISCUS.) SUB_RRN TRN_STP_SUN, SRCE_CODE1 group) MIN_ROWS + _ *.
    _ *
    DISCUS. TRN_STP_SUN. MIN_ROWS = SUB_RRN. SUB_RRN_ *.
    And DISCUS. TRN_STP_SUN. MIN_ROWS = SRCE_CODE1. SRCE_CODE1_ *.
    And DISCUS. TRN_STP_SUN. MIN_ROWS = SEQ_CTR. MINSEQ_ *.
    And DISCUS. TRN_STP_SUN. SRCE_CODE1 IN ('FREE', 'ALTP","CANADA","E","DENY","DOOR")_ *.
    And DISCUS. TRN_STP_SUN. TYPE = the of '_ *.
    and discus.trn_stp_sun.sub_rrn is not null) *AND _
    P.SPRS_CODE IN ('NOPY","CHMD","SCOUT","TIME") AND
    TRUNC (P.EFF_DATE) BETWEEN TRUNC (SYSDATE)-35 AND TRUNC (SYSDATE)-29 AND
    S.NAME_FLAG! = 'B' AND
    (S.BALANCE_AMT + (S.BALANCE_AMT*.06) + (S.DLVF_AMT)) <-6.99 AND
    M.CODE! = 'DISP' AND
    NOT EXIST
    (SELECT
    Q.HOME_PHONE
    Of
    THE DISCUS THROW. SUB_SUN Q
    WHERE
    S.HOME_PHONE = Q.HOME_PHONE AND
    Q.SUBT_CODE IN ('HARD DRIVES', 'HDLV') AND
    Q.STAT_FLAG = 'C')
    GROUP BY
    S.NAME,
    S.RRN,
    RTRIM (LTRIM (S.STREET_NBR) |) ' ' ||
    RTRIM (SUBSTR (S.STREET, 33, 2)) | ' ' ||
    RTRIM (SUBSTR (S.STREET, 1, 28)) | ' ' ||
    RTRIM (SUBSTR (S.STREET, 29, 4)) | ' ' ||
    RTRIM (SUBSTR (S.STREET, 35, 2))) | ' ' ||
    NVL2 (S.UNIT_NBR, ' #',' ') | ' ' ||
    LTRIM (S.UNIT_NBR),
    S.CITY_NAME,
    S.STPV_CODE,
    RTRIM (S.ZIP_CODE) |
    '-'||
    S.ZIP_PLUS4,
    S.HOME_PHONE,
    S.ACCT_NBR,
    TO_CHAR (S.EXPR_DATE, 'MMDDYY'),
    TO_CHAR ((P.EFF_DATE-1), 'MMDDYY').
    TO_CHAR (SYSDATE, 'MMDDYY'),
    (-1 * (S.BALANCE_AMT + (S.BALANCE_AMT*.06) + S.DLVF_AMT) * 100),
    S.STAT_FLAG,
    P.SEQ_CTR
    ORDER BY 10;

    Yes, your problem is that the not exists clause. Try:

    SELECT DISTINCT
    S.NAME,
    S.RRN,
    RTRIM(LTRIM(S.STREET_NBR) || ' ' ||
    RTRIM(SUBSTR(S.STREET,33,2)) || ' ' ||
    RTRIM(SUBSTR(S.STREET,1,28)) || ' ' ||
    RTRIM(SUBSTR(S.STREET,29,4)) || ' ' ||
    RTRIM(SUBSTR(S.STREET,35,2))) || ' ' ||
    NVL2(S.UNIT_NBR, '#', ' ') || ' ' ||
    LTRIM(S.UNIT_NBR) ADDRESS,
    S.CITY_NAME CITY,
    S.STPV_CODE STATE,
    RTRIM(S.ZIP_CODE) ||
    '-'||
    S.ZIP_PLUS4 ZIP,
    S.HOME_PHONE,
    S.ACCT_NBR,
    TO_CHAR(S.EXPR_DATE,'MMDDYY') START_DATE,
    TO_CHAR((P.EFF_DATE-1),'MMDDYY') END_DATE,
    TO_CHAR(SYSDATE,'MMDDYY') FILE_DATE,
    ROUND((-1*(S.BALANCE_AMT + (S.BALANCE_AMT*.06) + S.DLVF_AMT))*100) BALANCE,
    S.STAT_FLAG,
    MIN(P.SEQ_CTR) SEQ_CTR
    FROM
    DISCUS.SUB_SUN S,
    DISCUS.TRN_STP_SUN P,
    DISCUS.TRN_MEM_SUN M,
    (SELECT
    SUB_RRN,
    TRAN_CODE,
    EFF_DATE,
    MIN(SEQ_CTR)
    FROM
    DISCUS.TRN_DLR_SUN
    WHERE
    TRAN_CODE = 'BILL' AND
    EFF_DATE >= TRUNC(SYSDATE)-65
    GROUP BY
    SUB_RRN,
    TRAN_CODE,
    EFF_DATE,
    SEQ_CTR)D,
    (select distinct
    DISCUS.TRN_STP_SUN.SUB_RRN
    from
    DISCUS.TRN_STP_SUN,
    (select SUB_RRN, min(seq_ctr) MINSEQ, SRCE_CODE1 from DISCUS.TRN_STP_SUN group by SUB_RRN, SRCE_CODE1) MIN_ROWS
    where
    DISCUS.TRN_STP_SUN.SUB_RRN = MIN_ROWS.SUB_RRN
    And DISCUS.TRN_STP_SUN.SRCE_CODE1 = MIN_ROWS.SRCE_CODE1
    And DISCUS.TRN_STP_SUN.SEQ_CTR = MIN_ROWS.MINSEQ
    And DISCUS.TRN_STP_SUN.SRCE_CODE1 IN ('FREE','ALTP','ELSN','EMPL','NIE','DOOR')
    And DISCUS.TRN_STP_SUN.TYPE = 'S'
    And DISCUS.TRN_STP_SUN.SUB_RRN is not null) Z
    WHERE
    S.RRN = P.SUB_RRN AND
    S.RRN = M.SUB_RRN AND
    S.RRN = D.SUB_RRN(+) AND
    TRIM(P.PAPR_CODE) = 'SS' AND
    S.BILL_CODE NOT IN ('PRTY','EZCC','EMPB','EMPP','NSPC','NIET','NIEF','SAMP','ALTP','COMP','SCHL','MAIL') AND
    TRIM(S.STAT_FLAG) = 'F' AND
    P.TYPE = 'P' AND
    P.SPRS_CODE IN ('NOPY','CHMD','OTHR','TIME') AND
    TRUNC(P.EFF_DATE) BETWEEN TRUNC(SYSDATE)-35 AND TRUNC(SYSDATE)-29 AND
    S.NAME_FLAG != 'B' AND
    (S.BALANCE_AMT + (S.BALANCE_AMT*.06) + (S.DLVF_AMT)) < -6.99 AND
    M.CODE != 'DISP'  and
    NOT EXISTS
    (SELECT
    Q.HOME_PHONE
    FROM
    DISCUS.SUB_SUN Q
    WHERE
    S.HOME_PHONE = Q.HOME_PHONE AND
    Q.SUBT_CODE IN ('HDDS','HDLV') AND
    Q.STAT_FLAG = 'C')
    AND Z.SUB_RRN (+) = S.RRN
    AND Z.SUB_RRN is null
    GROUP BY
    S.NAME,
    S.RRN,
    RTRIM(LTRIM(S.STREET_NBR) || ' ' ||
    RTRIM(SUBSTR(S.STREET,33,2)) || ' ' ||
    RTRIM(SUBSTR(S.STREET,1,28)) || ' ' ||
    RTRIM(SUBSTR(S.STREET,29,4)) || ' ' ||
    RTRIM(SUBSTR(S.STREET,35,2))) || ' ' ||
    NVL2(S.UNIT_NBR, '#', ' ') || ' ' ||
    LTRIM(S.UNIT_NBR),
    S.CITY_NAME,
    S.STPV_CODE,
    RTRIM(S.ZIP_CODE) ||
    '-'||
    S.ZIP_PLUS4,
    S.HOME_PHONE,
    S.ACCT_NBR,
    TO_CHAR(S.EXPR_DATE,'MMDDYY'),
    TO_CHAR((P.EFF_DATE-1),'MMDDYY'),
    TO_CHAR(SYSDATE,'MMDDYY'),
    (-1*(S.BALANCE_AMT + (S.BALANCE_AMT*.06) + S.DLVF_AMT)*100),
    S.STAT_FLAG,
    P.SEQ_CTR
    ORDER BY 10;
    
  • Almost a month can't get the query to work...

    Help, I can't seem to get this application to work as I need to. I don't know what I'm missing but it all seems fine for me.

    Here's what my control panel looks like (Simplified)
    ------------------------------------------------------------------------------------------ --------------------
    ID | trait_a | trait_b
    ------------------------------------------------------------------------------------------ --------------------
    1 5 6
    2 2 1


    Here's my table of contents (Simplified)
    ------------------------------------------------------------------------------------------ ---------------------
    ID | label
    ------------------------------------------------------------------------------------------ ---------------------
    1 black
    2 cherry
    5 Orange
    6 pink

    So for 1 order id, it has two traits I need to back Orange and pink. Order 2 a cherry and black for line and b. All the ways to do this, it seems to me, I always just get the point 'b' label. I can't go back to each of them. Here is my code. Thank you!

    Are any other fields that you join to null in your bag_orders table? Namely:
    bag_orders.order_party
    bag_orders.order_consultant
    bag_orders.order_hostess
    bag_orders. Order_Customer
    bag_orders.bag_style
    bag_orders.bag_trait_a
    bag_orders.bag_trait_b
    ?
    If one of these fields, that you do a join internal are null, or do not have matching records in the tables you are joining in, the query will return no rows.

    In addition, to simplify, it looks like arguments.thisParty is always going to be a simple integer. You can remove the check IN and just do an equality check:
    WHERE bag_orders.order_party =

Maybe you are looking for

  • How to remove 'Save as PDF' from the popup menu

    The item 'Save as PDF' leads to a shopping site called NITRO. I'm trying to eliminate it from the context menu. I installed the add-on Menu Edit and changed the item save as PDF from the visible to hidden on my PC Windows with Firefox 30 8.1. However

  • 488.2 SendList. equivalent NET

    Hello Is there a 488.2 equivalent NET lib for the former function of gpib - 32.obj SendList? I need to send the same command to selected multiple devices at the same time. Not all devices on the bus. I found the function Board.SendCommands, but there

  • I need to take a picture of a code bar on a package insert in a letter. How?

    I need to take a picture of a code bar on a package insert in a letter.  How?

  • BlackBerry Smartphones battery damaged by viruses - True or False

    I recently received a message from the screen "warning system, Blackberry Priv is infected by the virus and has been damaged" when I close this message that it takes me to the game of Google to download an app called battery saver battery saver of TH

  • EditField when it is full the text does not scroll

    Hello Below custom editfield extends EditField. My problem is that the user Pat and field gets complete with text, when the user reaches the end of visible display of the field the text scrolls does'nt user types continuously. Should I use a differen