AF:query re - run SQL programmatically
On a page, I use the af: query that is contrary to a VO in the comic book. The DB is updated outside the ADF BC, then the cache gets stale. So, I want to rerun the query programmatically with the search parameters the user used on the latest research.I tried to set the refresh of the attributes on the ImplicitViewCriteriaQuery or the iterator. This does not help, since the documentation says that a discount don't lead necessary to the execution of SQL. An explicit call to run on the ViewIterator did not help either. Well, the iterator is the search criteria?
In fact I want to simulate a click on the button Search, until the page is rendered. Any ideas?
Just clear the cache of VO and refresh the user interface of the PPR Panel. The re VO - runs the last query automatically. Use this method:
vo.clearCache();
Tags: Java
Similar Questions
-
Problem with Apex 5.0 report with a query that runs in SQL Developer
Hello
I have a query that runs in SQL Developer without problem, but when I use it in a classic report, it displays following:
error report:
ORA-06502: PL/SQL: digital or value error: character of number conversion error
The query is:
select T1.ID_ATTACHMENT, T1.BLOB_CONTENT, T2.ATTACH_CATEGORY, T1.FILENAME, T1.ATTACHMENT_DESCRIPTION from ATTACHMENTS T1 LEFT JOIN REF_ATTACH_CATEGORIES T2 ON T1.ATTACHMENT_CATEGORY = T2.ID_ATTACH_CATEGORY WHERE T1.ID_ATTACHMENT IN (SELECT ID_ATTACHMENT FROM REL_ATTACHMENTS WHERE REL_PART_ID = 1 AND REL_ID = 64146);
And the output of SQL Developer is:
I have following Setup for the BLOB_CONTENT column in the classic report:
Any ideas what is causing this problem?
Thanks in advance,
Sergio
I don't have notes with me, but I think that the content of the blob must be selected as:
DBMS_LOB. GetLength (blob_content) as blob_content
and check that you have included the primary key in the results.
-
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 run SQL "Issued" BI answers using a query tool?
How take the 'SQL Issued' in the tab 'Advanced' in demand in BI answers and run its equivalent on the tables of the database, by using a tool like in SQL Developer?
For example, BI answers shows "SQL to show" of:
SELECT Team2. Team2 PIF"saw_0, an2. "' Year ' saw_1, Cube2.Hr saw_2
OF 'AW_BALL2 Cube2.
WHERE Year2.Decade = '2000's
ORDER BY saw_0, saw_1, saw_2
How translate this into something that will run in SQL Developer and show me the same data that takes demand? Thank you.the SQL code that you quoted is the SQL logic.
It was sent to presentation services through ODBC to the BI server, which translates using the RPD in 'real' SQL, which is fire to the database.
As said, you need for the level of logging to see the 'real' SQL that runs the BI server... This in the administration in respect of security tool. See the Administration Guide for more information.FWIW, if you really want to run SQL that you mentioned and then launch an ODBC client (Microsoft query, TOra, etc.) and direct him to a system DSN you set type Oracle BI pointing to your Oracle BI server.
-
Hi all
Database Version: 11g
I'm running a custom application request which is to invoke a few packages, and it takes a long time because of the huge amount of data processing.
I am able to see my session from v$ session table and corresponding procedure call package based on sql_id v$ sql table.
But my requirement is to see the sql that it is running in the procedure in question. This procedure has written many sql queries. V $ sql, I see only a procedure like anonymous block call. Is it possible to see the running sql code?
Thanks in advance.
Kind regardsYou might want to try to equip your code.
You can use dbms_application_info for this.
that is dbms_application_info.set_action ('start merge');
Then, you just do a simple query on v$ session to find out what your code is doing.
-
Running SQL scripts on different databases
Hello!
At my work we have many databases on a server. I have to make a request so that users can run the application on a selected database SQL scripts.
So my question may be separated into 2 sections:
1 - is possible to let users SQL scripts run directly from the application?
I think a database to create a page that displays the list of all the SQL scripts, that we want to use, and when you click on a specific script name in the list, it asks something like "Where the database you want to run the script?", and then, as confirmed by the user, it would show results running the script on a different page.
is 2 - possible to let users choose what database to run these scripts?
Any information would be helpful, I'm at the beginning of the project and am not sure at all about how to proceed, or if it is at all possible.
Thank you!
Fallen_Kaede wrote:
Thanks for the quick response. I confirm that we are talking about databases on a server.
The request is to "debug" to other databases. For example, be run scripts to the locks on the list, to show the different indexes on a table, etc. to help diagnose problems.
It looks like the 'users' are DBA who should use OEM/Grid Control to do so.
1 - is possible to let users SQL scripts run directly from the application?
Lol the only way to run scripts in the APEX is the use of the SQL Scripts for SQL workshop component.
The key word in your question is 'application '. SQL * more and Developer SQL are applications that allow users to run SQL scripts on the desktop. Scripts SQL is an APEX integrated application that allows developers to run SQL scripts on the web. However, there is no documented way supported for end users to run SQL scripts in a custom of APEX application that you created. Therefore, rethink your approach. Rather than create an application APEX runs scripts, you must convert the scripts in PL/SQL, APEX packages, pages, components and applications leverage features of the APEX and reports, graphics and interactivity (e.g. exploration links; timed refreshes etc.). This will give you a user experience improved, beyond what is possible using static SQL scripts.
is 2 - possible to let users choose what database to run these scripts?
The APEX applications would exist on an instance of the APEX in a database and access other databases using the database links (which can have a performance impact). It would be possible to create a LOV based on the view of the USER_DB_LINKS dictionary and use in a selection set to a global page list to provide a control to set the current context of the database. Region data sources will have to be generated dynamically in the packages of PL/SQL use the links from relevant database based on this value LOV.
-
SQL query (or pl / sql) show this week activities
I need your friends to help to create the sql query (or pl / sql) show of this week's activities, my table is called activity and it has a date field (contains the date of the creation of the application)
depends on what you describe as 'this week '...
you could do something like
WHERE your_date_field > = trunc(sysdate,'IW') AND your_date_field< trunc(sysdate="" +="">
which would give you anything from Monday to Sunday from the current week
HTH
-
Try to run a SQL statement through the window of OEM 12 c run SQL. Statement fails
All,
I have a 11g database. When it is initially installed, I installed it in $ORACLE_BASE = / orabin/app/oracle/product and $ORACLE_HOME = $ORACLE_BASE/11gDB_R2. This is the version 11.2.0.1 to give birth to 11.2.0.3.
Recently, I installed 11.2.0.4 in $ORACLE_BASE/11.2.0.4. Then, I upgraded my database at 11.2.0.4. Everything works fine.
All my scripts on the linux host logon changed to point my environment at $ORACLE_BASE/11.2.0.4 House and my $PATH when I connect to the linux host is: /orabin/app/oracle/product/11.2.0.4/bin:/orabin/app/oracle/product/11.2.0.4/OPatch:/sbin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/home/oracle/bin
On my OEM Console, the database appears as 11.2.0.4 and me can manage very well.
However, when I try to use the window of the OEM Console to execute SQL to execute any type of SQL statement, it fails.
The failure error is:
Could not launch/orabin/app/oracle/product/11gDB_R2/bin/sqlplus-s/nolog: no such file or directory
It would be a mistake since the 11gDB_R2 directory tree (the 11.2.0.3 software) has been removed from the host, now that the database is set to level and working as 11.2.0.4.
I wonder if somewhere in the OEM software, there is always a pointer to the old ORACLE_HOME? I can't find anything in the .bashrc or other shell scripts that are executed when a Shell session on the host computer which were still the reference to the old directory of 11gDB_R2 so I'm a bit puzzled.
I have 8 guests, and all have been improved in the same way at 11.2.0.4. For some databases, the OEM window run SQL is executing the SQL code.
Someone has some ideas on this?
Go to the Configuration of the analysis of the database (when you set the password) and update of the Oracle home. Also do this for all targets listener on this host as well.
-
Run SQL through batch file, with parameters
Hi all
I run SQL through Batch files before, but I am a little confused with the execution of the sql with parameters. For example, if I have a named sql file:
I can run this problem normally, but including the substitution variables, as in the batch (.bat) file called Execute_insert.cmd is a bit annoying... I played a little with it and cannot operate.insert.sql Insert into TableA select * from TableB where service_dt >= '&&x_start_dt' and service_dt <= '&&x_end_dt';
Any help would be appreciated.
Thank you
EdChange your insert.sql to something more like:
Insert into TableA select * from TableB where service_dt >= TO_DATE('&1', 'format mask') and service_dt <= TO_DATE('&2', 'format mask');
Then, would you call it:
sqlplus user/password @insert.sql 01-oct-2012 31-oct-2012
John
-
Hello all;
I know this question has been asked several times but I'm still a little confused. I installed oracle database 10g express edition on my computer for the practice of the school. It works fine if I go to the homepage of database icon... However, there is another icon which evokes SQL * who I am trying to use to run sql on my computer but nothing happens when I type in a simple sql statement. I was just wondering how to make sql * more correctly installed on my pc so that I can use PL/SQL instructions for the code, packages, and triggers as well.You must copy the entry in the tnsnames.ora file for the installation of xe, which is located in
C:\oraclexe\app\oracle\product\11.2.0\server\network\ADMIN
on WindowsXE = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST =host.xx.xxx.net)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = XE) ) )
and edit the tnsnames.ora file from where you are running more than SQL.
For example, I have a client installed 10g, which has its own file tnsnames.ora but I also 11g XE installed.
This entry must exist in the customer 10g tnsnames.ora file if I want to connect with the version of windows
SQL Plus to Database 11g XE.Moreover, why don't you upgrade to 11g xe?
http://www.Oracle.com/technetwork/database/Express-Edition/downloads/index.htmlThe final version was released earlier this month.
-
FN: BEA run sql error return
Hello
I am trying to use run function sql in OSB.
Here's the statement I used.
FN - bea: run sql('jdbc/MW_DB_DS', 'select value from GLOBALVARIABLES where Variable=?','ISDown')
name of database - jdbc/MW_DB_DS
Name of the column - ISDown
I get the error when I try to use the function below
Transformation runtime error: line 1, column 1: {bea - err} RDBW0001: [jdbc/MW_DB_DS]: [IsDown]: error getting connection to database ' jdbc/MW_DB_DS': could not resolve "jdbc. MW_DB_DS'. 'Jdbc' solved
I tested the data source of the weblogic Server console and its fine.
I checked the syntax of the SQL execute and I could see as
FN - bea: run sql($datasource-string, $rowElemName, $sql-string, $params...)
So I tried this
FN - bea: run sql('jdbc/MW_DB_DS', 'rec','select * from GLOBALVARIABLES where Variable=?','ISDown')
I still get the same error. Is this something to do with the data source? I checked the conenctivity and tried increasing the max connections, but still I'm getting the same erorr.
Any suggestions on this?Yes, it worked after will project the data source to the admin time and the managed server. Thanks for your reply.
-
Hi all
I would like to run sql to remove the contents of a table, whenever you leave a specific page. Possible?
Thank you very muchIt's easy.
Go to your list of point (shared-> list-> list entry components) and write INIT (or whatever you want, it's freetext) in the field titled 'request '.
This generates a URL like this: http://tryapexnow.com/apex/f?p=12345:52:3997328169542393:INIT
brgds,
Peter-----
Blog: http://www.oracle-and-apex.com
ApexLib: http://apexlib.oracleapex.info
Work: http://www.click-click.at -
Rewrite the static query in dynamic SQL
Can someone please help me write a dynamic query in pl/sql to SQL next?
It's the game ('25', ' 04 "). the number of list might be n.
The column_type varies from(1..6) and
the from(1..6) of column_amt1 lines
Thanks in advanceSELECT t.claim_no, t.cert_no, t.rec_code, (NVL(decode(t.column_type1,'25',NVL (t.column_amt1, 0)),0)+ NVL(decode(t.column_type1,'04',NVL(t.column_amt1, 0)),0 ) ) + (NVL(decode(t.column_type2,'25',NVL (t.column_amt2, 0)),0)+ NVL(decode(t.column_type2,'04',NVL(t.column_amt2, 0)),0 ) ) + (NVL(decode(t.column_type3,'25',NVL (t.column_amt3, 0)),0)+ NVL(decode(t.column_type3,'04',NVL(t.column_amt3, 0)),0 ) ) + (NVL(decode(t.column_type4,'25',NVL (t.column_amt4, 0)),0)+ NVL(decode(t.column_type4,'04',NVL(t.column_amt4, 0)),0 ) ) + (NVL(decode(t.column_type5,'25',NVL (t.column_amt5, 0)),0)+ NVL(decode(t.column_type5,'04',NVL(t.column_amt5, 0)),0 ) ) + (NVL(decode(t.column_type6,'25',NVL (t.column_amt6, 0)),0)+ NVL(decode(t.column_type6,'04',NVL(t.column_amt6, 0)),0 )) amt from test_detail t;
HenaBut in fact, you should not dynamic SQL at all. What you could do is create a SQL type and use MEMBER OF:
SQL> CREATE OR REPLACE 2 TYPE test_detail_type_tbl 3 AS 4 TABLE OF varchar2(2) 5 / Type created. SQL> select case_id, 2 item, 3 code, 4 case 5 when type1 member of test_detail_type_tbl('25','04') then nvl(amt1,0) 6 else 0 7 end + 8 case 9 when type2 member of test_detail_type_tbl('25','04') then nvl(amt2,0) 10 else 0 11 end + 12 case 13 when type3 member of test_detail_type_tbl('25','04') then nvl(amt3,0) 14 else 0 15 end + 16 case 17 when type4 member of test_detail_type_tbl('25','04') then nvl(amt4,0) 18 else 0 19 end + 20 case 21 when type5 member of test_detail_type_tbl('25','04') then nvl(amt5,0) 22 else 0 23 end + 24 case 25 when type6 member of test_detail_type_tbl('25','04') then nvl(amt6,0) 26 else 0 27 end copay 28 from test_detail 29 / CASE_ID ITEM CO COPAY ---------- --------- -- ---------- EML3371015 133761570 10 355 EML3371015 133761570 10 20 EML3371015 133761570 10 5 EMC6369600 140328551 10 54 EMH6353995 140328551 11 26.04 SQL> select case_id, 2 item, 3 code, 4 case 5 when type1 member of test_detail_type_tbl('25') then nvl(amt1,0) 6 else 0 7 end + 8 case 9 when type2 member of test_detail_type_tbl('25') then nvl(amt2,0) 10 else 0 11 end + 12 case 13 when type3 member of test_detail_type_tbl('25') then nvl(amt3,0) 14 else 0 15 end + 16 case 17 when type4 member of test_detail_type_tbl('25') then nvl(amt4,0) 18 else 0 19 end + 20 case 21 when type5 member of test_detail_type_tbl('25') then nvl(amt5,0) 22 else 0 23 end + 24 case 25 when type6 member of test_detail_type_tbl('25') then nvl(amt6,0) 26 else 0 27 end copay 28 from test_detail 29 / CASE_ID ITEM CO COPAY ---------- --------- -- ---------- EML3371015 133761570 10 300 EML3371015 133761570 10 20 EML3371015 133761570 10 5 EMC6369600 140328551 10 0 EMH6353995 140328551 11 5.52 SQL>
SY.
-
Run SQL failed with the authentication failure
Hi all, I have access to a large grid control to manage my small group of data, I'm not super user, I am only a dba user access to databases in mi cluster. Then, when I try to run SQL using "execute SQL" link I get a message that says "LOG: Local Authentication failed...". PAM attempt authentication... "WFP has failed with the error: authentication failure.
But, when I use the 'SQL Worksheet' link to run the same SQL that works very well, is not possible to run SQL using the other link? What's wrong? Thanks in advance.You have not set up the setting with agent PAM, please follow the notes 422073.1 and check.
-
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 + _ *.
où_ *
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;
Maybe you are looking for
-
using firefox 24, yahoo toolbar disappears and the keyboard does not work on some websites
We have installed firefox 24, yahoo toolbar sometimes disappears. On some web site when trying to enter a password, the keyboard does not work until you double click of the mouse on the registration form. This on two different systems of windows 7. E
-
Replacement of Pavilion g7 - 2233cl HDD with SSD?
I have a Pavilion g7 - 2233cl that the HARD drive has failed recently, was planning to move to an SSD. I'm trying to figure if the SSD I look is compatible with my machine. This is a link to the product on Amazon. http://www.Amazon.com/SanDisk-solid-
-
HP Pavilion dv6 - none of the drivers work
I have a HP Pavilion dv6 notebook PC. About 6 months ago, I broke the screen. About 2 months after that, however, the drivers stopped working. Starting now, I can't) 1 use the internet 2) connect to any USB 3) heard no sound and 4) can not connect in
-
We have XP Professional preinstalled on our laptop. It was introduced with the opening of automatic session and never need to password or user name. The other day when we turned on the laptop it asks username and password... I don't know what we have
-
Win7 home premium update pro can it be done on a Pavilion P6210F running win7 home premium?
Hi I'm new as of today and would like to know if I could go win 7 home premium to Pro on my Privilion Computer Office P6210f. It would be win7 pro because I really like win 7 and not Win 8 so far. Thanks for any help. Frank