SELECT statement showing null values
HelloThe SQL below works fine except it does not display recordings iif CAMPAIGN_NAME is null
Sorry I mentioned this before but I have a typing error gave the wrong way (I left the 'no' of the above statement)
Any ideas where I go worng is welcome
Thank you
Pete
Select the CAMPAIGN. CAMPAIGN_KEY,
CAMPAIGN_CODE,
CAMPAIGN_NAME,
LANGUAGE_NUMBER
campaign, CAMPAIGN_LANG
where the CAMPAIGN. CAMPAIGN_KEY = CAMPAIGN_LANG. CAMPAIGN_KEY
and LANGUAGE_NUMBER =: P1_LANG
and (instr (superior (CAMPAIGN_NAME), superior (nvl (: P260_REPORT_SEARCH, CAMPAIGN_NAME))) > 0)
Hello Pete
The answer is somewhat the same thing:
Replace
and (instr (superior (CAMPAIGN_NAME), superior (nvl (: P260_REPORT_SEARCH, CAMPAIGN_NAME))) > 0)
with
and)
(instr (superior (CAMPAIGN_NAME), superior (nvl (: P260_REPORT_SEARCH, CAMPAIGN_NAME))) > 0)
or CAMPAIGN_NAME IS NULL
)
Roel
Tags: Database
Similar Questions
-
FTS by select as NOT NULL values
Hello
My version of Oracle is 10.2.0.3.0.
I'm shot under SQL in the database, this SQL is a FTS during the race.
SELECT *.
Table_name FROM
WHERE id_number IS NULL;
Pease see below for the nature of the existing data in the table.
SQL > select count (*) from table_name where id_number is null;
COUNT (*)
----------------
1456
SQL > select count (*) from table_name;
COUNT (*)
----------------
9392730
However, there is an index on the column id_number and the SQL where clause (where id_number is null) picks up only 0.1% of the rows in the table. Although SQL is a FTS on the table table_name. Is there a way I can remove this execute SQL FTS.
Thanks in advance.
Best regards
oratestoratest wrote:
Means there is no another way/workaround to grant this SQL? :(Major responses in this thread.
If you change the SQL statement or set up a bitmap index (not a good choice index if the table is subject to frequent changes), there is another solution. I think I've seen this approach on the blog of Richard Foote:
http://richardfoote.WordPress.com/2008/01/23/indexing-nulls-empty-spaces/Here's a sample:
CREATE TABLE T1( C1 NUMBER NOT NULL, C2 VARCHAR2(50) NOT NULL, C3 NUMBER, C4 VARCHAR2(300)); INSERT INTO T1 SELECT ROWNUM, TO_CHAR(ROWNUM,'0000000')||'A', DECODE(MOD(ROWNUM,1000),0,NULL,ROWNUM), LPAD('A',300,'A') FROM (SELECT ROWNUM RN FROM DUAL CONNECT BY LEVEL <= 1000) V1, (SELECT ROWNUM RN FROM DUAL CONNECT BY LEVEL <= 1000) V2; CREATE INDEX IND_T1_C3 ON T1(C3); EXEC DBMS_STATS.GATHER_TABLE_STATS(OWNNAME=>USER,TABNAME=>'T1',CASCADE=>TRUE)
The foregoing has created a ranking table 1 000 000, where 1 of 1,000 rows contains a NULL value. An index has been created and then on the table, and the statistics have been updated.
Now the first test:
SET AUTOTRACE TRACEONLY EXPLAIN SELECT COUNT(*) FROM T1 WHERE C3 IS NULL; Execution Plan ---------------------------------------------------------- Plan hash value: 3724264953 --------------------------------------------------------------------------- | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | --------------------------------------------------------------------------- | 0 | SELECT STATEMENT | | 1 | 5 | 10994 (2)| 00:00:45 | | 1 | SORT AGGREGATE | | 1 | 5 | | | |* 2 | TABLE ACCESS FULL| T1 | 2000 | 10000 | 10994 (2)| 00:00:45 | --------------------------------------------------------------------------- Predicate Information (identified by operation id): --------------------------------------------------- 2 - filter("C3" IS NULL)
Note that the index is not used. A second test with a slightly modified definition of the index:
CREATE INDEX IND_T1_C3_NULL ON T1(C3,' '); EXEC DBMS_STATS.GATHER_INDEX_STATS(OWNNAME=>USER,INDNAME=>'IND_T1_C3_NULL') SELECT COUNT(*) FROM T1 WHERE C3 IS NULL; Execution Plan ---------------------------------------------------------- Plan hash value: 265035506 ------------------------------------------------------------------------------------ | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | ------------------------------------------------------------------------------------ | 0 | SELECT STATEMENT | | 1 | 5 | 25 (0)| 00:00:01 | | 1 | SORT AGGREGATE | | 1 | 5 | | | |* 2 | INDEX RANGE SCAN| IND_T1_C3_NULL | 2000 | 10000 | 25 (0)| 00:00:01 | ------------------------------------------------------------------------------------ Predicate Information (identified by operation id): --------------------------------------------------- 2 - access("C3" IS NULL)
This time notice that the special index was used without having to change the SQL statement.
Charles Hooper
Co-author of "Expert Oracle practices: Oracle Database Administration of the Oak Table.
http://hoopercharles.WordPress.com/
IT Manager/Oracle DBA
K & M-making Machine, Inc. -
Selection list: display null value
In a select list, I want to display the display value null as default in the selection list, whenever the form is opened.
Please suggest how to achieve this.
SanjayHello
Change the selection list and choose the option 'Display null value' like 'yes '. Do not mention any value in the default value field.
Concerning
Jean Claude -
Remove the NULL values and update the value according to the logic
Hello
The problem data
CREATE TABLE VOLA (SRNO, NUMBER, zero NUMBER, A NUMBER); INSERTION of REM in VOLA
TOGETHER TO DEFINE
Insert in VOLA (SRNO, ONE) values (1,237.94);
Insert in VOLA (SRNO, ONE) values (2, null);
Insert in VOLA (SRNO, ONE) values (3,203.565);
Insert in VOLA (SRNO, ONE) values (4,170.69);
Insert in VOLA (SRNO, ONE) values (5,113.67);
Insert in VOLA (SRNO, ONE) values (6,93.6);
Insert in VOLA (SRNO, ONE) values (7,82.03);
Insert in VOLA (SRNO, ONE) values (8,66.675);
Insert in VOLA (SRNO, ONE) values (9,63.59);
Insert in VOLA (SRNO, ONE) values (10,61.415);
Insert in VOLA (SRNO, ONE) values (11,60.015);
Insert in VOLA (SRNO, ONE) values (12,58.235);
Insert in VOLA (SRNO, ONE) values (13,57.805);
Insert in VOLA (SRNO, ONE) values (14,56.965);
Insert in VOLA (SRNO, ONE) values (15, null);
Insert in VOLA (SRNO, ONE) values (16, null);
I have to remove the NULL values in column 1, the problem is that the position of the NULL values are not fixed, and it can be any position. If all the lines of the columns are null, then throw it away.
If multiple NULL values are here so I have to do the math as follows to update null with the eigenvalues
1. If the first line is null then take the 2nd value in row and update it.
2. If the lines between both is null then take avg of prev and next value not null and refresh it.
3. If the last value in the column is null, then then take prev and update, in this case last two are null, so I have to take value of prev 14 value line update in
15th and 16th ranks.
I want to put this pl/sql logic, somehow, that I thought have loop and counter aapproach and loops through the elements and check and update.
But always looking for something better before looking to write code. No idea or help will be useful for me.
I * think * you are looking for something like:
WITH VOLA (SRNO, ONE)
AS (select 1,237.94 from all the double union)
Select 2, union null value double all the
Select 3,203.565 from all the double union
Select 4,170.69 from all the double union
Select 5,113.67 from all the double union
Select 6,93.6 from all the double union
Select 7,82.03 from all the double union
Select 8,66.675 from all the double union
Select 9,63.59 from all the double union
Select 10,61.415 from all the double union
Select 11,60.015 from all the double union
Select 12,58.235 from all the double union
Select 13,57.805 from all the double union
Select 14,56.965 from all the double union
Choose 15, null of union double all the
SELECT 16, NULL FROM dual)
GET_VALUES (SELECT SRNO, ONE ACE,
, LAST_VALUE (WE IGNORE NULLS) (ORDER BY SRNO CSA ROWS BETWEEN UNBOUNDED PRECEDING AND 1 PRECEDING) AS PREVIOUS_VALUE
, first_VALUE (ONE IGNORE NULLS) over (ORDER OF SRNO CSA ROWS BETWEEN 1 SUITE AND FOLLOWS without TERMINALS) AS NEXT_VALUE
FROM VOLA)
SELECT SRNO, ONE, CASE
WHEN IT IS NOT NULL, THEN WE
OTHER CASES
WHEN PREVIOUS_VALUE IS NOT NULL AND IS NOT NULL THEN (PREVIOUS_VALUE + NEXT_VALUE) NEXT_VALUE / 2
WHEN THE PREVIOUS_VALUE IS NOT NULL, THEN PREVIOUS_VALUE
WHEN THE NEXT_VALUE IS NOT NULL, THEN NEXT_VALUE
END
END AS NEW_VALUE
OF GET_VALUES
/
HTH
-
Hello community, I have a problem when creating a function. The purpose of this function is to check the table of weather gave yesterday or not. We must check this on different tables on different sachems. We are creating a function with input variables.
CREATE OR REPLACE FUNCTION IN_SCHEMA.IS_YDAYDATA_TO_TABLE
(
in_schema IN VARCHAR2,
in_tablename IN VARCHAR2,
in_datefield IN VARCHAR2,
)
RETURNS INTEGER
AS
-Declaring variables
v_is_true INTEGER.
BEGIN
SELECT
CASE
WHEN MAX (in_datefield) = TRUNC(SYSDATE-1)
THEN 1
ON THE OTHER
0
END
IN
v_is_true
Of
in_schema.in_tablename
;
RETURN v_is_true;
END;
/
When creating, I got error: [error] ORA-00942 (44:19): PL/SQL: ORA-00942: table or view does not exist
How to use the values of the input variables on the table select statement names?
Hello
Here's a way you can use dynamic SQL statements for this task:
CREATE OR REPLACE FUNCTION IS_YDAYDATA_TO_TABLE
(
in_schema IN VARCHAR2,
in_tablename IN VARCHAR2,
in_datefield IN VARCHAR2,
in_first_date DATE DEFAULT SYSDATE - 1,.
in_last_date DATE by DEFAULT NULL
)
RETURNS INTEGER
AS
-IS_YDAYDATA_TO_TABLE returns 1 if in_schema.in_tablename.in_datefield
-contains all the dates in the in_first_date of the range through included in_last_date
- and it returns 0 if there is no such lines.
-If in_last_date is omitted, the search only the data on in_first_date.
-If in_first_date is omitted, it defaults to yesterday.
-Time parts of the in_first_date and in_last_date are ignored.
-Declaring variables
sql_txt VARCHAR2 (1000);
v_is_true INTEGER.
BEGIN
sql_txt: = 'SELECT COUNT (*).
|| 'FROM ' | in_schema | '.' || in_tablename
|| 'WHERE ' | in_datefield | ' > =: d1'
|| «AND» | in_datefield | '< > >
|| 'AND ROWNUM = 1';
dbms_output.put_line (sql_txt |) '= sql_txt in IS_YDAYDATA_TO_TABLE"); -For debugging
Sql_txt EXECUTE IMMEDIATE
IN v_is_true
With the HELP of TRUNC (in_first_date) - d1
TRUNC (NVL (in_last_date
in_first_date
)
) + 1 -- d2
;
RETURN v_is_true;
END is_ydaydata_to_table;
/
DISPLAY ERRORS
If you must use dynamic SQL statements, put all the SQL statement in a single string variable, such as sql_txt in the example above. In this way, you can easily see exactly what will be executed. Comment out the call to dbms_output under test is completed.
Try to write functions that will address not only the question that you have now, but similar questions that you may have in the future. For example, now that interest you only to the verification of the data of yesterday, but later, you might want to check another day or range of days. The above function combines the convenience of a function simple (looks like yesterday data if you don't tell him otherwise) with the power of a more complex function (you can use the same function to check any day or range of days).
-
management of NULL values in a statement PIVOT 11 g
Hi all
In the following code, how can I get the cell showing 80001_sum_sales for employee 234567 as a zero instead of a NULL value?
I tried NVL in various parts of the application, but the problem is that the line does not actually exist to apply the NVL to. I also tried to add another level of subquery factoring to wrap each column in an NVL, something like:with t1 as ( select 123456 as emp_id, 80000 as category, 10 as sales from dual union all select 123456 as emp_id, 80001 as category, 20 as sales from dual union all select 234567 as emp_id, 80000 as category, 10 as sales from dual ) select * from t1 pivot ( sum(nvl(sales,0)) as sum_sales for category in (80000, 80001));
but Oracle has a problem with the fact that the column name starts with a number and get ORA-00911. Something like:with t1 as ( select 123456 as emp_id, 80000 as category, 10 as sales from dual union all select 123456 as emp_id, 80001 as category, 20 as sales from dual union all select 234567 as emp_id, 80000 as category, 10 as sales from dual ), t2 as (select * from t1 pivot ( sum(sales) as sum_sales for category in (80000, 80001)) ) select emp_id, nvl(80000_sum_sales, 0) as "80000" nvl(80001_sum_sales, 0) as "80001" from t2;
shows just the values 80000 and 80001 rather than actual sales amounts. Unfortunately, my requirement is that these column headers must be digital, as is an interface in another system. I try to avoid a full outer join a list of categories to all employees, as my employee table has 180 m files in there.with t1 as ( select 123456 as emp_id, 80000 as category, 10 as sales from dual union all select 123456 as emp_id, 80001 as category, 20 as sales from dual union all select 234567 as emp_id, 80000 as category, 10 as sales from dual ), t2 as (select * from t1 pivot ( sum(sales) for category in (80000, 80001)) ) select emp_id, nvl(80000, 0) as "80000", nvl(80001, 0) as "80001" from t2;
Are there SQL gurus out there who can see a way around this problem, before I attempt an outer join complete?
Thank you
MattHello
Try this
with t1 as ( select 123456 as emp_id, 80000 as category, 10 as sales from dual union all select 123456 as emp_id, 80001 as category, 20 as sales from dual union all select 234567 as emp_id, 80000 as category, 10 as sales from dual ), t2 as (select * from t1 pivot ( sum(sales) for category in (80000, 80001)) ) select emp_id, nvl("80000", 0) as "80000", nvl("80001", 0) as "80001" from t2;
see you soon
VT
-
JDBC PreparedStatement gives null after the execution of a valid SELECT statement
Hello
I have the following code:
As you can see, this function executes a select statement. Before I continue, let me first say that executing the exact same statement in PL/SQL Developer (external program) gives correct/expected results. In addition, run this on my Windows gives correct results environment. I seem to have this problem only on my Unix (SunOS) environment.public static String GetJobLogLocation(Connection connection, int jobId) throws SQLException { String sqlstr = "SELECT LOGFILE_NAME FROM apps.fnd_concurrent_requests WHERE REQUEST_ID = ?"; PreparedStatement prest = connection.prepareStatement(sqlstr); prest.setInt(1, jobId); ResultSet rs1 = prest.executeQuery(); String rv = null; if (rs1.next()) { rv = rs1.getString(1); System.out.println(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>" + rv); } rs1.close(); prest.close(); return rv; }
in any case, I get out of this function (running against my Unix environment, of course):
+ > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > + null
The thing is, it doesn't error out, which means that the result set contains a string, but the string is returned to me with the null value, even if there is a real valid result (that is, in this case, a path).
Someone has an idea, what happens? I tried to use ojdbc6.jar AND ojdbc14.jar is, with the same results. I just don't understand...
Thank you.
Published by: 964530 on 4 January 2013 14:31
Published by: EJP on 01/07/2013-17:48: added {noformat}{noformat} tags and removed your bizarre bold formatting. Please do this properly in future.
ASCI says:
I'm glad that this is a not prove to be a stupid question. At least I'm feeling a little justified due to this fact.There is no stupid question...; (o)
So what remains is: your selection is too early. Can join after insertion, update to each line to trigger the table that loggs insert/update timestamp and the contents of the LOGFIILE_NAME field?
Good bye
DPT -
passing multiple values from the query in the select statement of the procedure
I am collecting IDS to select education agreement from the date of rental values and then I would pass the result of the query in the statement select to get the result.
data type for the contract id is of type varchar and date of rental there is more than one id to contract for most of the time. Help, please. Thank you
CREATE OR REPLACE PROCEDURE abstract_menu (p_letting IN VARCHAR2, p_results OUT SYS_REFCURSOR) IS v_contractId VARCHAR2 (40); SELECT lcontid INTO v_contractId FROM letprop WHERE datestat IS NOT NULL AND letting = p_letting AND letstat <> 'R'; BEGIN OPEN p_results FOR SELECT DISTINCT SUBSTR (l.letting, 3, 2) || '-' || SUBSTR (l.letting, 5, 2) || '-' || SUBSTR (l.letting, 1, 2) lettingdate, l.lcontid contractid, SUBSTR (q.cprojnum, 1, 10) projectnumber, DECODE (TRIM (MIN (j.route)), NULL, 'N/A', TRIM (MIN (j.route))) routenumber, L.DATESTAT statusdate, L.LETSTAT lettingstatus, (q.cdescr) jobdescription, INITCAP (q.clocat1 || q.clocat2) LOCATION FROM vendor v, vendaddr r, letprop l, planhold p, proposal q, project j, propproj k, bidlet bd WHERE v.vendor = r.vendor AND k.contid = q.contid AND k.pcn = j.pcn AND l.lcontid = k.contid AND p.vendor = v.vendor AND l.letting = p.letting AND l.lcontid IN v_contactid "**************This is where I would like to pass the contract id from the above select statement***********'" AND l.CALL = p.CALL AND r.addrnum = p.billto AND bd.letting = l.letting GROUP BY q.cdescr, q.clocat1, q.clocat2, bd.letting, l.letting, l.lcontid, q.cprojnum, L.LETSTAT, L.DATESTAT ORDER BY lettingdate; end;
user9196150 wrote:
AND l.lcontid IN v_contactid ' * this is where I would like to pass the id of the select statement above contract * ""»CREATE OR REPLACE PROCEDURE abstract_menu (p_letting IN VARCHAR2, p_results OUT SYS_REFCURSOR) IS BEGIN OPEN p_results FOR SELECT DISTINCT SUBSTR (l.letting, 3, 2) || '-' || SUBSTR (l.letting, 5, 2) || '-' || SUBSTR (l.letting, 1, 2) lettingdate, l.lcontid contractid, SUBSTR (q.cprojnum, 1, 10) projectnumber, DECODE (TRIM (MIN (j.route)), NULL, 'N/A', TRIM (MIN (j.route))) routenumber, L.DATESTAT statusdate, L.LETSTAT lettingstatus, (q.cdescr) jobdescription, INITCAP (q.clocat1 || q.clocat2) LOCATION FROM vendor v, vendaddr r, letprop l, planhold p, proposal q, project j, propproj k, bidlet bd WHERE v.vendor = r.vendor AND k.contid = q.contid AND k.pcn = j.pcn AND l.lcontid = k.contid AND p.vendor = v.vendor AND l.letting = p.letting AND l.lcontid IN ( SELECT ll.lcontid FROM letprop ll WHERE ll.datestat IS NOT NULL AND ll.letting = p_letting AND ll.letstat 'R' ) AND l.CALL = p.CALL AND r.addrnum = p.billto AND bd.letting = l.letting GROUP BY q.cdescr, q.clocat1, q.clocat2, bd.letting, l.letting, l.lcontid, q.cprojnum, L.LETSTAT, L.DATESTAT ORDER BY lettingdate; end; /
SY.
-
NULL values in multiple selection
Hello
I have NULL values in the status column in my results. I have a guest of multiple selection on the State, but how do I select null from multiselect
THX,
ParagHello
Try again with the case statement.
If values is nulll using the case hardcord as NULL statement.Thank you
Ananth -
Return multiple values from a function in a SELECT statement
I hope I've provided enough information here. If not, let me know what I'm missing.
I create a view that will combine the information from several tables. Most are pretty simple, but there are a couple of columns in the view that I need to get by running a function within a package. Even if this is quite simple (I have a function named action_date in a package called rp, for example, that I can use to return the date that I need through SOME rp.action_date (sequence_number).
Here is the question: I really need to return several bits of information of the same record (not only action_date, but also action_office, action_value, etc.)-a join of the tables will work not here, as I will explain below. I can, of course, perform a function separate for each statement, but this is obviously inefficient. Within the select statement of the view, however, I don't know how each of the values that I need to get back.
For example, right now, I have:
Table 1:
sequence_number NUMBER (10),
name varchar (30),
...
Table2:
Table1_seq NUMBER (10),
action_seq NUMBER (10),
action_date DATE,
action_office VARCHAR (3),
action_value VARCHAR (60),
...
I can't just simply join Table1 and Table2 because I have to perform processing in order to determine the rows returned matching, I really need to select. If the package opens a cursor and treats each line until it finds the one I need.
The following works but is ineffective since all calls to the package returns the columns of the same record. I don't know how to put all the values that I need in the SELECT statement.
CREATE VIEW all_this_stuff AS
SELECT sequence_number, name,
RP.action_date (sequence_number) action_date,
RP.action_office (sequence_number) action_office,
RP.action_value (sequence_number) action_value
FROM table1
Is there a way to return multiple values in my SELECT statement or I'm going about this all wrong?
Any suggestions?
Thank you very much!Hello
What you want is a Query of Top - N , what you can do using the ROW_NUMBER analytic function in a subquery, like this:
WITH got_rnum AS ( SELECT action_seq, action_dt, action_office, action_type, action_value , ROW_NUMBER () OVER ( ORDER BY action_date , action_seq , action_serial ) AS rnum FROM table2 WHERE action_code = 'AB' AND action_office LIKE 'E' -- Is this right? ) SELECT action_seq, action_dt, action_office, action_type, action_value FROM got_rnum WHERE rnum = 1 ;
As written, this returns a single line (at most).
I suspect you'll actually get a rank for each group , where a group is defined by a value in a table in which you join.
In this case, add a PARTITION BY clause to the ROW_NUMBER function.
If post you a small example of data (CREATE TABLE and INSERT statements), I could show you exactly how.
As I don't have your tables, I'll show you the use of the tables in the scott schema.
This is a view containing data in the scott.dept table and also to scott.emp, but only for the highest employee in each Department (in other words, the employee whose oldest hire date). If there be a tie for the first hire date, while the candidate with the lowest empno is selected.CREATE OR REPLACE VIEW senior_emp AS WITH got_rnum AS ( SELECT d.deptno , d.dname , e.empno , e.ename , e.hiredate , ROW_NUMBER () OVER ( PARTITION BY d.deptno ORDER BY e.hiredate , e.empno ) AS rnum FROM scott.dept d JOIN scott.emp e ON d.deptno = e.deptno ) SELECT deptno , dname , empno , ename , hiredate FROM got_rnum WHERE rnum = 1 ; SELECT * FROM senior_emp ;
Output:
. DEPTNO DNAME EMPNO ENAME HIREDATE ---------- -------------- ---------- ---------- --------- 10 ACCOUNTING 7782 CLARK 09-JUN-81 20 RESEARCH 7369 SMITH 17-DEC-80 30 SALES 7499 ALLEN 20-FEB-81
Moreover, one of the conditions to the query you posted has been
action_office LIKE 'E'
which equals
action_office = 'E'
(AS is always equivalent to = if the string that follows AS does not contain the winning cards.)
Did you mean say that or did you mean something like this:action_office LIKE 'E%'
Instead?
-
Update statement using unique table with null values
Hi all
I want to update the table example table contain columns of c1.c2, c3 as below data
tab1: -.
------------------------
C1 c2 c3
1 2 null
3 null null
4 5 null
6 null null
-----------------------------------------
now, I want to update each value null to bellows value c3 c3
for example, the data as below
C1 c2 c3
1 2 3
4 5 6
How can using the update statement update it please help me
Thanks in advance
BalaSo you can never be sure of your order by...
SQL> create table tab1 as 2 ( 3 select 1 c1, 2 c2, null c3 from dual union all 4 select null, null, 3 from dual union all 5 select 4 ,5, null from dual union all 6 select null, null ,6 from dual 7 ); Table created. SQL> SQL> select * 2 from tab1 3 / C1 C2 C3 ---------- ---------- ---------- 1 2 3 4 5 6 SQL> SQL> merge into tab1 t 2 using (select rowid rid 3 , c1 4 , c2 5 , c3 6 , lead (c3) over (order by rowid) ld 7 from tab1 8 ) v 9 on (t.rowid = v.rid) 10 when matched 11 then update set c3 = ld 12 delete where c3 is null 13 ; 4 rows merged. SQL> SQL> SQL> select * 2 from tab1 3 ; C1 C2 C3 ---------- ---------- ---------- 1 2 3 4 5 6 SQL>
@Peter: PTR, het is niet koud. Het zonnetje schijnt ;)
for everyone: no, it's not cold. The Sun is shining. -
Alter the State of Session? -Apex form publishes text with null value
Recently I discovered a problem with our Apex facility in which all selected as source for a text field value will eventually be displayed as a null value in the database.
We run APEX version 3.2 in an Oracle 10.2.0.4 database using Oracle HTTP Server from 10 g companion disc.
At first glance, everything seems to work as expected; I created a simple table called "oracle_sr" with 2 columns, as both not null:
SQL > desc capacity.oracle_sr
Name Null? Type
ORACLE_SR_ID NOT NULL NUMBER
TIMESTAMP NOT NULL DATE
In APEX, the form wizard has been used to create a form on this table.
After execution of the pages and you enter a value for the timestamp field, I can create folders without problem.
The question arises when I choose a source for the timestamp field value.
All the source options causes the same error (including a static value) so I'll focus on the SQL query to the source as:
Select sysdate double;
This should replace the date system in the area of text timestamp when the page is executed.
As expected, the value appears in the text box, but when I submit the form to create the folder I get the error:
ORA-01400: cannot insert NULL into ('ABILITY'. "" "" ORACLE_SR '. "" TIMESTAMP")
I have worked with APEX for quite awhile and have successfully used this technique in many applications but just to begin to see this error in recent days. What's particularly odd about this message is by default postings "not null" created by the form wizard sees timestamp class as having a value. Session state information included below reports a value yet the database is to launch the ORA-01400.
Someone has a similar problem? I have spent a good amount of time to try looking for this problem but can't seem to find any similar messages.
I have included the release of my test page, debugging from what I see, it seems to be a value associated with the filed timestamp:
0.00: a C C E P t: request = "CRΘER."
0.00: metadata: go look up the definition and application shortcuts
0.00: NLS: wwv_flow.g_flow_language_derived_from = FLOW_PRIMARY_LANGUAGE: wwv_flow.g_browser_language = en - us
0.00: alter session set nls_language = "AMERICAN."
0.00: alter session set nls_territory = 'AMERICA '.
0.00: NLS: CSV charset = WE8MSWIN1252
0.00:... "NLS: decimal separator Set =". »
0.00:... NLS: Set NLS Group separator = ",".
0.00:... NLS: Date Format Set = "DD-MON-RR.
0.01:... Setting session time_zone in-06: 00
0.01: setting NLS_DATE_FORMAT application date format: DD-MON-RR
0.01:... NLS: Date Format Set = "DD-MON-RR.
0.01: fetch database session state
0.01:... Check the owner of the 2303701116904676 session
0.01: setting NLS_DATE_FORMAT application date format: DD-MON-RR
0.02:... NLS: Date Format Set = "DD-MON-RR.
0.02:... Check for expiration of the session:
0.02:... Metadata: Page Fetch, calculation, process and branch
0.02: session: extract information from session header
0.02:... Metadata: Retrieve the attributes of the page for application 109, page 50
0.02:... Validate page affinity point.
0.02:... Check off the items hidden_protected.
0.03:... Check authorization security systems
0.03: session state: Save elements of form and p_arg_values
0.03: *... Session state: you save newValue of the object "P50_ORACLE_SR_ID" = "" "escape_on_input ="N"* 0.03: *..." " Session state: you save the object "P50_TIMESTAMP" = newValue ' 26 May 09 "" escape_on_input = "N" * ""»
0.03:... Session state: Save "P0_CURRENT_PERSONNEL_ID" - registration of same value: "1."
0.03:... Session state: Save "P0_OFFSET" - registration of same value: "0".
0.03:... Session state: Save "P0_ACTIVE_WEEK" - registration of same value: "24 May 09".
0.03: point of treatment: ON_SUBMIT_BEFORE_COMPUTATION
0.03: branch point: BEFORE_COMPUTATION
0.03: point of calculation: AFTER_SUBMIT
0.03: tabs: make the connection for the tab queries
0.03: branch point: BEFORE_VALIDATION
0.03: perform validations:
0.03:... Point Not Null Validation: P50_TIMESTAMP
0.04: branch point: BEFORE_PROCESSING
0.04: point of treatment: AFTER_SUBMIT
0.04:... Process 'PK get': PLSQL (AFTER_SUBMIT) declare function get_pk return varchar2 is begin C1 in (select ORACLE_SR_SEQ.nextval double next_val) loop return c1.next_val; end loop; end; Start: P50_ORACLE_SR_ID: = get_pk; end;
0.04:... * session state: saved point new value "P50_ORACLE_SR_ID" = "6."
0.04:... Treat "Line of ORACLE_SR process": DML_PROCESS_ROW (AFTER_SUBMIT) #OWNER #:ORACLE_SR:P50_ORACLE_SR_ID:ORACLE_SR_ID | IUD
0.04: see the error page...
0.04: execute rollback...
ORA-01400: cannot insert NULL into ('ABILITY'. "" "" ORACLE_SR '. "" TIMESTAMP")
Cannot process the row in the ORACLE_SR table.
Back by demand.
Any thoughts would be appreciated.
Thank you
Justin.If you have changed the Source Type of an element of database column to something else, so he cannot participate in the automated line choreography Fetch/automatic line processing (DML). You must leave the Type of Source, as it was and change the default value of the element fill when the ARF process retrieves a null value for the column.
Scott
-
Some columns of the values of the selected line returns NULL in the table of the adf.
Hello..
My version of jdev 11.1.1.5.0
I have a vision with some columns. This view is mapped to a table of adf with some of the displayed columns. My task is to get the column values selected line (including the values of the column not displayed).
But I'm certain values such as null, although there are values present when I run the query from the view.
My code:
DCIteratorBinding tableVO = ADFUtils.findIterator ("myVO");
ViewObject voTableData = tableVO.getViewObject ();
Line rowSelected = voTableData.getCurrentRow ();
+ / / codeto display column and the values +.
int x = 0;
* for (the names of the objects: rowSelected.getAttributeNames ()) {*}
* for (int i = x; i < rowSelected.getAttributeValues () .length; i ++) {*}
* System.out.println (x + "." + name + "=" + rowSelected.getAttribute (i)); *
break;
*}*
x ++ ;
continue;
*}*
MY table:
* < af:table value = "#{bindings.myVO.collectionModel}" *.
* var = "row" rows = "#{bindings.myVO.rangeSize}" *.
* EmptyText = "#{Bindings.myVO.Viewable?" "{'No data to display.': 'Access Denied.'}". *
* fetchSize = "#{Bindings.myVO.rangeSize}" *.
* rowBandingInterval = "0."
* filterModel = "#{Bindings.myVO.queryDescriptor}" *.
* queryListener = "#{Bindings.myVO.processQuery}" *.
* filterVisible = "true" varStatus = "vs."
* selectionListener = "#{myBean.method_onRowSelect}" *.
* rowSelection = "single" id = "t1" styleClass = "AFStretchWidth."
"* partialTriggers =": sbcClose: sbcOpen: socWarehouse. "
* inlineStyle = "height: 217px;" / > *.
Thank youQuestion: the attributes are not null in the DB?
The attributes are part of the past of the query select?
And they are part of the binding of the tree?Timo
-
Report shows a string "null" for null values.
Hello
I am new to BI Publisher and creating a report in the BI Publisher. In the game of null values, report prints as "null". I checked the query, it gives data blank (empty value) for null values. But in the report, it comes as value 'null' (string "null"). I need to show the report in the form of empty data for null values. Can you please help me to find the solution for this?
Thank you much in advance.
Concerning
Garza.I responded to your cheque send only once.
-
Assign the values of the two variables in a select statement
I'm trying to set two variables in a select statement in my definition of the procedure. I get the error identifier not valid "ATTRIBUTE" running the following code.
Can I not connect two different values to two different variables in the same select?create or replace procedure tbl_auth ( Email in varchar2, UserLevel out number) as v_Email varchar2(100) := lower(Email); v_login_chk number := 0; begin select UserLevel into p_UserLevel, v_login_chk into v_login_chk from tbl_User where eMail=v_Email exception when no_data_found then UserLevel := 0; end tbl_auth;
Thank you
Published by: jerry8989 on August 22, 2011 07:06
Published by: jerry8989 on August 22, 2011 07:06change as follows:
select UserLevel, v_login_chk into p_UserLevel, v_login_chk
IN ONE ALONE is enough.
BTW, don't you have "login Check" column in the "tbl_user"? If you do, your selection should be like this:
... select UserLevel, loginChk into /* check the column name in your table */ p_UserLevel, v_login_chk from tbl_User ...
Maybe you are looking for
-
Y at - it a bug known on some websites showing without CSS?
Some sites display with the effect of the CSS is disabled.
-
Impossible to download Window Media Player
Hi, I can't download Window Media player from Windows Internet Explorer. It seems ' an add-on for this Web site has failed. Check the security settings in the Internet Options of Patential conflicts.'. I called customer service. He gave me a linke. T
-
Office ' 03: Should I install SP3 ' 07 Office for ' 07 "Reader" App
Current XP SP3 / 2003 Student Office - as a user of Office 2003 is worth potential gum-ups to install ("high priority" by WU) 2007 Office SP3 just because I have the 2007 Reader App for one or more modules of office? Long as I had update problems, bu
-
Hello. I recently found my case of Age of Empires 3, but some CDs are absent of the it. I know that I can contact Microsoft to get new CD, but I was told that if I download the trial version of Age of Empires 3, I could switch to the real version, us
-
says: "this copy of windows is not genuine". System was fine until recently.
Windows Vista: my copy was very good. I installed a few months ago, and then out of the blue, he said. I was wondering if it was the system clock. I got "Fix It Center", but the problem remains. Should I create a disk backup system and reinstall my w