Error in a view query
Hi,
I'm triyng to create a view but I couldn't due to I have the following error:
ora-00904: esml.sml_obsol_movimientos.cosicltr. Invalid identifier.
The view is:
select obm.cosicltr,
case obm.cosicltr
when 'AL' then count(obm.cosicltr)
when 'LI' then count(obm.cosicltr)
end
from esml.sml_obsol_movimientos obm
group by esml.sml_obsol_movimientos.cosicltr;
Any ideas? The error is in the last line.
Thanks.
It seems to be the day for it. See the first response to Accesing a table of another schema via trigger doesn't work.
You also need to alias the case statement with a column name to create the view.
Warren:
That is a searched case statement and is syntactically valid in 9i and up.
SQL> SELECT id, CASE id WHEN 1 THEN 'One'
2 WHEN 2 THEN 'Two'
3 ELSE 'Many' END descr
4 FROM t;
ID DESC
1 One
2 Two
3 Many
4 Many
5 ManyJohn
Similar Messages
-
Hi
Ours is VPD database in 11GR2. We're using "LOG ERRORS INTO " feature to track list of records violating constraints.
For Inserts it is working as expected but for Updates/Deletes it is throwing mis. ORA- errors. "ORA-01762: vopdrv: view query block not in FROM"
We dint find any clue when searched in net.
Could someone help us here? Is there any limitation with "LOG ERRORS INTO" ?
Below are the steps we're executing
EXEC DBMS_ERRLOG.CREATE_ERROR_LOG(
dml_table_name => 'EMP',
err_log_table_name => 'ERR_EMP'
> DESC EMP
Name Null? Type
EMPNO NOT NULL NUMBER(4)
ENAME VARCHAR2(10)
SAL NUMBER(7,2)
COMM NUMBER(7,2)
DEPTNO NUMBER(2)
INSERT INTO EMP VALUES('1','Test','@' /* generates Ora */,2,'2); -- ERR_EMP populated
UPDATE EMP set SAL='@'
where EMPNO='1' -- Throwing ORA-01762: vopdrv: view query block not in FROM
Could someone help us?Hi
Ours is VPD database in 11GR2. We're using "LOG ERRORS INTO " feature to track list of records violating constraints.
For Inserts it is working as expected but for Updates/Deletes it is throwing mis. ORA- errors. "ORA-01762: vopdrv: view query block not in FROM"
We dint find any clue when searched in net.
Could someone help us here? Is there any limitation with "LOG ERRORS INTO" ?
Below are the steps we're executing
EXEC DBMS_ERRLOG.CREATE_ERROR_LOG(
dml_table_name => 'EMP',
err_log_table_name => 'ERR_EMP'
> DESC EMP
Name Null? Type
EMPNO NOT NULL NUMBER(4)
ENAME VARCHAR2(10)
SAL NUMBER(7,2)
COMM NUMBER(7,2)
DEPTNO NUMBER(2)
INSERT INTO EMP VALUES('1','Test','@' /* generates Ora */,2,'2); -- ERR_EMP populated
UPDATE EMP set SAL='@'
where EMPNO='1' -- Throwing ORA-01762: vopdrv: view query block not in FROM
Could someone help us? -
Frm-40505:ORACLE error: unable to perform query in oracle forms 10g
Hi,
I get error frm-40505:ORACLE error: unable to perform query on oracle form in 10g environment, but the same form works properly in 6i.
Please let me know what do i need to do to correct this problem.
Regards,
PriyaHi everyone,
I have block created on view V_LE_USID_1L (which gives the error frm-40505) . We don't need any updation on this block, so the property 'updateallowed' is set to 'NO'.
To fix this error I modified 'Keymode' property, set it to 'updatable' from 'automatic'. This change solved the problem with frm-40505 but it leads one more problem.
The datablock v_le_usid_1l allows user to enter the text (i.e. updated the field), when the data is saved, no message is shown. When the data is refreshed on the screen, the change done previously on the block will not be seen (this is because the block updateallowed is set to NO), how do we stop the fields of the block being editable?
We don't want to go ahead with this solution as, we might find several similar screens nad its diff to modify each one of them individually. When they work properly in 6i, what it doesn't in 10g? does it require any registry setting?
Regards,
Priya -
Windows is Scanning and repairing drive... (- Errors in Event Viewer)
Long post, please be patient... :)
I have a fairly new (purchased 8/2013) Lenovo ThinkPad T431s with Windows 8.1 Pro 64-bit (updated from 8.0 -> 8.1). It has a very tricky error coming basically 8 / 10 boots:
Windows is Scanning and repairing drive...
Error details from Windows Event Viewer (a new similar error appears on every boot to event viewer):
A corruption was discovered in the file system structure on volume \?\Volume{f62db2cf-efe4-4b55-a3f7-0e7db991a984}.
A file on the volume is no longer reachable from its parent directory. The parent file reference number is 0x2000000000002. The name of the parent directory is "". The parent index attribute is ":$I30:$INDEX_ALLOCATION". The file reference
number of the file that needs to be reconnected is 0x400000003db80. There may be additional files on the volume that also need to be reconnected to this parent directory.
What has been done 1st trying to fix that:
SSD disk has been changed (image from previous SSD copied back) ->
no solution, error remains
chkdsk /F /R -> no solution, error remains
SFC /scannow -> no solution, error remains
dism /online /cleanup-image /restorehealth -> no solution, error remains after a few boots
TRIED using Windows 8.1 "Update & Recovery -> Refresh Your PC without affecting your files" -> Inserted the Lenovo "Operating System Recovery Disk Windows 8 Pro (OEM Activation 3.0 Required)" BUT Windows did not accept
that DVD claiming "The media inserted is not valid"... ???
Ended up calling Lenovo Support and they instructed me to order the Recovery DVD from
Lenovorecovery.com -> Unfortunatelly Windows does not recognice the DVD(s)...
mountvol returns:
\\?\Volume{4d337687-0033-42f7-8a8e-b6968b533cb3}\
(This is my C:\ drive where Windows installation resides)
\\?\Volume{e010cf9d-c04d-4c82-b517-3cda1b647fe7}\
*** NO MOUNT POINTS ***
\\?\Volume{f62db2cf-efe4-4b55-a3f7-0e7db991a984}\
*** NO MOUNT POINTS ***
\\?\Volume{33f0062f-0aff-4fd2-8402-1c7911d86897}\
*** NO MOUNT POINTS ***
Then running fsutil dirty query on each returns:
Volume - \\?\Volume{4d337687-0033-42f7-8a8e-b6968b533cb3} is NOT Dirty
Volume - \\?\Volume{e010cf9d-c04d-4c82-b517-3cda1b647fe7} is NOT Dirty
Volume - \\?\Volume{f62db2cf-efe4-4b55-a3f7-0e7db991a984} is Dirty
Volume - \\?\Volume{33f0062f-0aff-4fd2-8402-1c7911d86897} is NOT Dirty
The chkdsk on the dirty volume
\\?\Volume{f62db2cf-efe4-4b55-a3f7-0e7db991a984}\ returned:
The type of the file system is NTFS.
Insufficient storage available to create either the shadow copy storage file or
other shadow copy data.
A snapshot error occured while scanning this drive. Run an offline scan and fix.
Diskpart output on the same volume:
DISKPART> lis par
Partition ### Type Size Offset
Partition 1 Reserved 128 MB 17 KB
Partition 2 Recovery 1000 MB 129 MB
Partition 3 System 260 MB 1129 MB
Partition 4 Primary 146 GB 1389 MB
Partition 5 Recovery 350 MB 147 GB
Partition 6 Recovery 19 GB 148 GB
Questions:
1) Are my Partitions OK, haven't "touched" anything?
2) Excluded the dirty volume from boot checking with chkntfs /x
-> still the Error appears in Event viewer log (but Scanning is skipped/not shown anymore during the boot).
What is causing the error?
3) Why do I have three (3) recovery partitions?What has happened in the past days:
A) Lenovo on-site-Support changed the motherboard -> had no impact on the error (which I expected).
B) I found
instructions how to manually create USB Flash stick with a booting Custom (OEM) Recovery Image.
C) Booted with USB and performed "Refresh your PC without affecting your files."
D) Windows was refreshed but...
-->>
Still the error remains (Windows scanning and repairing drive \?\Volume{f62db2cf-efe4-4b55-a3f7-0e7db991a984} on each and every boot.
1) Related Error in Event viewer (NTFS):
A corruption was discovered in the file system structure on volume \?\Volume{f62db2cf-efe4-4b55-a3f7-0e7db991a984}.
A file on the volume is no longer reachable from its parent directory. The parent file reference number is 0x2000000000002. The name of the parent directory is "". The parent index attribute is ":$I30:$INDEX_ALLOCATION". The file reference number of the
file that needs to be reconnected is 0x400000003db80. There may be additional files on the volume that also need to be reconnected to this parent directory.
2) Related Error in Event viewer (NTFS - Microsoft Windows NTFS):
Volume \\?\Volume{f62db2cf-efe4-4b55-a3f7-0e7db991a984} (\Device\HarddiskVolume5) needs to be taken offline to perform a Full Chkdsk. Please run "CHKDSK /F" locally via the command line, or run "REPAIR-VOLUME <drive:>" locally or remotely via
PowerShell.
-->>
Now Lenovo support is proposing a full re-install (to be performed by myself) of Windows as this is SW issue.
Summary:
- Refreshing my T431s with OEM Image does not help
- The error remains on \?\Volume{f62db2cf-efe4-4b55-a3f7-0e7db991a984} (\Device\HarddiskVolume5; Lenovo Recovery partition) OR at least Windows thinks so... -
Materialized View, ORA-12008: error in materialized view refresh path
I want to refresh a materialized view, but I get an ORA-12008 error.
Does anybody have an idea? I do not find any errors in my refresh statement.
CREATE MATERIALIZED VIEW scott.dummy_mv
TABLESPACE test
BUILD IMMEDIATE
USING INDEX TABLESPACE idx_test
REFRESH
START WITH sysdate
NEXT ROUND(SYSDATE)+5/24
WITH PRIMARY KEY
ENABLE QUERY REWRITE
AS
SELECT KM.ID ID
,KM.USERNAME USERNAME
,KM.ABTID ABTID
FROM my_table KM
scott@orcl>desc dummy_mv
Name Null? Typ
ID NOT NULL NUMBER(4)
USERNAME NOT NULL VARCHAR2(30)
ABTID NOT NULL NUMBER(4)
scott@orcl>
BEGIN
SYS.DBMS_JOB.REMOVE(6579);
COMMIT;
END;
DECLARE
X NUMBER;
BEGIN
SYS.DBMS_JOB.SUBMIT
( job => X
,what => 'dbms_refresh.refresh(''"scott"."dummy_mv"'');'
,next_date => to_date('07.01.2009 05:00:00','dd/mm/yyyy hh24:mi:ss')
,interval => 'ROUND(SYSDATE)+5/24 '
,no_parse => FALSE
SYS.DBMS_OUTPUT.PUT_LINE('Job Number is: ' || to_char(x));
COMMIT;
END;
scott@orcl>exec dbms_refresh.refresh('dummy_mv');
BEGIN dbms_refresh.refresh('dummy_mv'); END;
FEHLER in Zeile 1:
ORA-12008: error in materialized view refresh path
ORA-00947: not enough values
ORA-06512: in "SYS.DBMS_SNAPSHOT", Zeile 820
ORA-06512: in "SYS.DBMS_SNAPSHOT", Zeile 877
ORA-06512: in "SYS.DBMS_IREFRESH", Zeile 683
ORA-06512: in "SYS.DBMS_REFRESH", Zeile 195
ORA-06512: in Zeile 1
scott@orcl>crupper wrote:
I get the same error:
scott@orcl>exec dbms_mview.refresh('dummy_mv','c');
BEGIN dbms_mview.refresh('dummy_mv','c'); END;
FEHLER in Zeile 1:
ORA-12008: error in materialized view refresh path
ORA-00947: not enough values
ORA-06512: in "SYS.DBMS_SNAPSHOT", Zeile 820
ORA-06512: in "SYS.DBMS_SNAPSHOT", Zeile 877
ORA-06512: in "SYS.DBMS_SNAPSHOT", Zeile 858
ORA-06512: in Zeile 1
I would first check the "query" information of the DBA_SNAPSHOTS/DBA_MVIEWS dictionary views if it reveals anything obvious.
But it looks more like an internal error while processing the refresh. You can get more information about the error by tracing the session. A "alter session set sql_trace = true;" before running the refresh should be sufficient. Disconnect afterwards and check the generated trace file for errors either using "tkprof" and checking the output or by manually searching for "err=" in the trace file.
Which 4-digit version of Oracle are you using?
Regards,
Randolf
Oracle related stuff blog:
http://oracle-randolf.blogspot.com/
SQLTools++ for Oracle (Open source Oracle GUI for Windows):
http://www.sqltools-plusplus.org:7676/
http://sourceforge.net/projects/sqlt-pp/ -
Error occurred while sending query result: 'java.lang.NullPointerException'
I am doing end to end scenario from SQL server to File
JDBC --XI -- File
I am getting the following Error while monitoring the sender CC in RWB
"Error occurred while sending query result: 'java.lang.NullPointerException'
Please Help !!Hi,
To see the Adapter Error log, try:
http://<XiServerHostName>:<J2EE-Port>/MessagingSystem
Try viewing the Audit Log for each message (Newspaper Icon)
Regards,
Amitabha -
ORA-12008: error in materialized view refresh path... Bug?
SQL> select * from v$version;
BANNER
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
PL/SQL Release 11.2.0.3.0 - Production
CORE 11.2.0.3.0 Production
TNS for Linux: Version 11.2.0.3.0 - Production
NLSRTL Version 11.2.0.3.0 - Production
SQL> drop materialized view log on test_tbl;
Materialized view log dropped.
SQL> drop materialized view mv_test_tbl;
Materialized view dropped.
SQL> drop table test_tbl;
Table dropped.
SQL> create table test_tbl(
2 test_id number(10) primary key,
3 test_name varchar2(10) not null)
4 ;
Table created.
SQL> insert into test_tbl values (1,'bob');
1 row created.
SQL> insert into test_tbl values (2,'joe');
1 row created.
SQL> insert into test_tbl values (3,'john');
1 row created.
SQL> commit;
Commit complete.
SQL> create materialized view log on test_tbl
2 with primary key , rowid, sequence
3 (
4 test_name
5 )
6 including new values;
Materialized view log created.
SQL> create materialized view mv_test_tbl
2 refresh fast on commit
3 as
4 select test_id,
5 test_name
6 from test_tbl;
Materialized view created.
SQL> update test_tbl set test_name = 'hello' where test_id = 1000;
0 rows updated.
SQL> commit;
Commit complete.Ok, so that's all good. Now if I create the materialized view log with the COMMIT SCN option:
SQL> drop materialized view log on test_tbl;
Materialized view log dropped.
SQL> drop materialized view mv_test_tbl;
Materialized view dropped.
SQL> create materialized view log on test_tbl
2 with primary key , rowid, sequence
3 (
4 test_name
5 ),
6 commit scn
7 including new values;
Materialized view log created.
SQL> create materialized view mv_test_tbl
2 refresh fast on commit
3 as
4 select test_id,
5 test_name
6 from test_tbl;
Materialized view created.
SQL> update test_tbl set test_name = 'hello' where test_id = 1000;
0 rows updated.
SQL> commit;
commit
ERROR at line 1:
ORA-12008: error in materialized view refresh path
ORA-01006: bind variable does not exist
SQL>Committing an update that updates no rows against a master table for a single table fast refreshable materialized view results in the error above when the materialized view log on the master table is created with the COMMIT SCN option. I'm guessing that this isn't how things are supposed to work. Or am I missing something here? Anyone else encountered this before?
Cheers.
Edited by: Stain on Jan 25, 2013 1:27 PMQuery Rewrite is an option for a Materialized View, not a Materialized View Log. Also, query rewrite is used as an optimization technique which "transforms a SQL statement expressed in terms of tables or views into a statement accessing one or more materialized views that are defined on the detail tables". I don't think it plays any role in the refresh path.
Regardless, it made no difference.
SQL> create materialized view mv_test_tbl
2 refresh fast on commit
3 ENABLE QUERY REWRITE
4 as
5 select test_id,
6 test_name
7 from test_tbl
8 ;
Materialized view created.
SQL> update test_tbl set test_name = 'hello' where test_id = 1000;
0 rows updated.
SQL> commit;
commit
ERROR at line 1:
ORA-12008: error in materialized view refresh path
ORA-01006: bind variable does not exist
SQL>Edited by: Stain on Jan 25, 2013 2:06 PM -
ORA-12008: error in materialized view refresh path ;;; PLZ HELP ME
Hi all,
I 'm using Oracle Database 10g Enterprise Edition Release 10.2.0.1.0; I got these errors when I tried to refresh my materialized view ;
ORA-12008: error in materialized view refresh path
ORA-01555: snapshot too old: rollback segment number 5 with name "_SYSSMU5$"
too small
ORA-06512: at "SYS.DBMS_SNAPSHOT", line 2255
ORA-06512: at "SYS.DBMS_SNAPSHOT", line 2461
ORA-06512: at "SYS.DBMS_SNAPSHOT", line 2430
I don't understand what mean these errors and why i got them?
Someone can help me please ?
Thanks
regards,thank you Justin,
I found in my alertDB.log this line ;
Mon Aug 20 03:00:54 2007
ORA-01555 caused by SQL statement below (SQL ID: 64a7sdbbvknta, Query Duration=1021 sec, SCN: 0x0004.4a145344):
Mon Aug 20 03:00:54 2007
INSERT /*+ BYPASS_RECURSIVE_CHECK */ INTO "MANAGEMENT"."MVIEW_COMPUTERS"("ID","WINVERSION","ANTIVIRUS","GUID","INSTALLDT","CONNECTION_TYPE","GROUPID
","QUOVACOUNTRY") SELECT "C"."ID","C"."WINVERSION","C"."ANTIVIRUS","C"."GUID","C"."INSTALLDT","C"."CONNECTIONTYPE","C"."GROUPID","C"."QUOVACOUNTRY"
FROM "MANAGEMENT"."COMPUTERS" "C"
So i execute this query to found the TUNED_UNDORETENTION value ;
SELECT *
FROM V$UNDOSTAT v
WHERE v.MAXQUERYID = '64a7sdbbvknta'
and i have this result :
BEGIN_TIME 20070820 02:53:42
END_TIME 20070820 03:03:42
UNDOTSN 1
UNDOBLKS 51242
TXNCOUNT 5012
MAXQUERYLEN 1060
MAXQUERYID 64a7sdbbvknta
MAXCONCURRENCY 21
UNXPSTEALCNT 0
UNXPBLKRELCNT 0
UNXPBLKREUCNT 0
EXPSTEALCNT 14
EXPBLKRELCNT 51392
EXPBLKREUCNT 0
SSOLDERRCNT 1
NOSPACEERRCNT 0
ACTIVEBLKS 606920
UNEXPIREDBLKS 19896
EXPIREDBLKS 612728
TUNED_UNDORETENTION 1841
I don't know exactly which value i should set my parameter?
Message was edited by:
HAGGAR -
An error prevented the view from loading
I'm using SQL Server 2012 Express and I'm building a report with one table. I dragged and dropped two data set elements into the table that has two columns (Product Name and Product Description). Both the dataset elements have
a data type of varchar (50) in SQL Server 2012 Express. The table with those two elements is the only data I have in Design view. When I click on Preview, the Preview screen states 'An error prevented the view from loading.'. This is difficult
to diagnose, because in the Error List there are '0 Errors', '0 Warnings', and '0 Messages'. I would like help understanding if there is another error log I can observe to understand the issue, or if there are basic SQL Server 2012 Express Reporting
Services debugging techniques. Please help. Thank you,
Additionally, when I run the query in SQL Server 2012 Express and Reporting Services Query Designer the query results are correct.
Also, when I click the start debugging button, the report displays and I can export it to pdf, however the Previous still displays the error.Well, funny stuff. I shut the solution down yesterday, then I booted my computer today and started the solution AND JUST LIKE MAGIC....it works. I can't explain it. Persistence pays, that's the answer sometimes.
-
Error: ORA-12008: error in materialized view refresh path
Hello Dba' s
We are on 12.0.6 EBS with 10.2.0.5 DB on Sun solaris SPARC 64 bit.
We are getting below error while Refreshing Materialized View.
Start of log messages from FND_FILE
Error: ORA-12008: error in materialized view refresh path
ORA-00600: internal error code, arguments: [kcblasm_1], [103], [], [], [], [], [], [] Occured while Refreshing Materialized View
End of log messages from FND_FILE
Not sure how to proceed.We have just upgraded our database from 10.2.0.3 to 10.2.0.5.
Also we still have our test instance with 10.2.0.3 database ,there refreshing MV completed successfully.
Also refreshing through TOAD gives below error:-
BEGIN
DBMS_SNAPSHOT.REFRESH(
LIST => 'XXPPL.XXPPL_OPM_TRANSACTIONS_MV'
,PUSH_DEFERRED_RPC => TRUE
,REFRESH_AFTER_ERRORS => FALSE
,PURGE_OPTION => 1
,PARALLELISM => 0
,ATOMIC_REFRESH => TRUE
,NESTED => FALSE);
END;
Error at line 2
ORA-12008: error in materialized view refresh path
ORA-00600: internal error code, arguments: [kcblasm_1], [103], [], [], [], [], [], []
ORA-06512: at "SYS.DBMS_SNAPSHOT", line 2256
ORA-06512: at "SYS.DBMS_SNAPSHOT", line 2462
ORA-06512: at "SYS.DBMS_SNAPSHOT", line 2431
ORA-06512: at line 2
Please advice.
Thanks,
Edited by: user12209274 on Nov 23, 2010 2:10 AMthank you Justin,
I found in my alertDB.log this line ;
Mon Aug 20 03:00:54 2007
ORA-01555 caused by SQL statement below (SQL ID: 64a7sdbbvknta, Query Duration=1021 sec, SCN: 0x0004.4a145344):
Mon Aug 20 03:00:54 2007
INSERT /*+ BYPASS_RECURSIVE_CHECK */ INTO "MANAGEMENT"."MVIEW_COMPUTERS"("ID","WINVERSION","ANTIVIRUS","GUID","INSTALLDT","CONNECTION_TYPE","GROUPID
","QUOVACOUNTRY") SELECT "C"."ID","C"."WINVERSION","C"."ANTIVIRUS","C"."GUID","C"."INSTALLDT","C"."CONNECTIONTYPE","C"."GROUPID","C"."QUOVACOUNTRY"
FROM "MANAGEMENT"."COMPUTERS" "C"
So i execute this query to found the TUNED_UNDORETENTION value ;
SELECT *
FROM V$UNDOSTAT v
WHERE v.MAXQUERYID = '64a7sdbbvknta'
and i have this result :
BEGIN_TIME 20070820 02:53:42
END_TIME 20070820 03:03:42
UNDOTSN 1
UNDOBLKS 51242
TXNCOUNT 5012
MAXQUERYLEN 1060
MAXQUERYID 64a7sdbbvknta
MAXCONCURRENCY 21
UNXPSTEALCNT 0
UNXPBLKRELCNT 0
UNXPBLKREUCNT 0
EXPSTEALCNT 14
EXPBLKRELCNT 51392
EXPBLKREUCNT 0
SSOLDERRCNT 1
NOSPACEERRCNT 0
ACTIVEBLKS 606920
UNEXPIREDBLKS 19896
EXPIREDBLKS 612728
TUNED_UNDORETENTION 1841
I don't know exactly which value i should set my parameter?
Message was edited by:
HAGGAR -
Error signaled in parallel query server p005 DATE format comparison
Hello All,
I have a data like this.
{code}
j_id s_id b_id lc t_date my_val1 my_val2
100 200 300 prs 2013-07-17 16:01:47 myval1 myval2
100 200 300 prs 2013-07-17 16:01:47 myCval1 myCval2
{code}
When i am running a query like this
{code}
update my_tab b
set my_col = 'X'
where rowid <> ( select max(t.rowid) from my_tab t
where
t.J_ID = b.J_ID and
t.S_ID = b.S_ID and
t.B_ID = b.B_ID and
t.LC = b.LC
and TO_TIMESTAMP(trim(t.t_DATE), 'YYYY-MM-DD HH24:MI:SS.FF')
= TO_TIMESTAMP(trim(b.t_DATE), 'YYYY-MM-DD HH24:MI:SS.FF')
{code}
I know i have a DATE format but converting it into TIMESTAMP because my data is random and could contain the time stamp as well.
My concern here is when i run above update statement i get error
{code}
ORA-12801: error signaled in parallel query server P005
ORA-01862: the numeric value does not match the length of the format item
{code}
but when i do like below.. It runs fine. Not sure what i am missing here or doing something wrong. Please help.
{code}
select to_timestamp('2013-07-08 17:58:47', 'YYYY-MM-DD HH24:MI:SS.FF') from dual
where
to_timestamp('2013-07-08 17:58:47', 'YYYY-MM-DD HH24:MI:SS.FF') = to_timestamp('2013-07-08 17:58:47', 'YYYY-MM-DD HH24:MI:SS.FF')
{code}
Thanks!user10647455 wrote:
Hello All,
I have a data like this.
{code}
j_id s_id b_id lc t_date my_val1 my_val2
100 200 300 prs 2013-07-17 16:01:47 myval1 myval2
100 200 300 prs 2013-07-17 16:01:47 myCval1 myCval2
{code}
When i am running a query like this
{code}
update my_tab b
set my_col = 'X'
where rowid <> ( select max(t.rowid) from my_tab t
where
t.J_ID = b.J_ID and
t.S_ID = b.S_ID and
t.B_ID = b.B_ID and
t.LC = b.LC
and TO_TIMESTAMP(trim(t.t_DATE), 'YYYY-MM-DD HH24:MI:SS.FF')
= TO_TIMESTAMP(trim(b.t_DATE), 'YYYY-MM-DD HH24:MI:SS.FF')
{code}
I know i have a DATE format but converting it into TIMESTAMP because my data is random and could contain the time stamp as well.
My concern here is when i run above update statement i get error
{code}
ORA-12801: error signaled in parallel query server P005
ORA-01862: the numeric value does not match the length of the format item
{code}
but when i do like below.. It runs fine. Not sure what i am missing here or doing something wrong. Please help.
{code}
select to_timestamp('2013-07-08 17:58:47', 'YYYY-MM-DD HH24:MI:SS.FF') from dual
where
to_timestamp('2013-07-08 17:58:47', 'YYYY-MM-DD HH24:MI:SS.FF') = to_timestamp('2013-07-08 17:58:47', 'YYYY-MM-DD HH24:MI:SS.FF')
{code}
Thanks!
If you have a date column, converting that to a timestamp isn't going to magically add more information to the date.
Date data types hold time information (not to the fractional precision like timestamps, but up to the second) ... if you are having a problem seeing that information, it's likely because of your NLS_DATE_FORMAT setting (whatever client you are using to view the data isn't showing you all of the information, but it's still there).
So basically, this boils down to your code not "making sense" at the moment
Cheers, -
Input Value long enough for date format ,Error in executing parallel query
Hi,
My Table: ANML( ID, STATUS,B_DATE,B_MONTH,B_YEAR, DEATH_DATE)
status 1 for alive and 2 for dead.
i wrote a view to get age.
as
create or relace view view1 as
select top."ID",top."STATUS",top."DOB",top."DEATH_DATE",top."ANML_AGE",top."DAYSDIFF",
CASE
WHEN anml_age < 1
THEN 'D'
ELSE 'M'
END age_unit,
CASE
WHEN anml_age < 1
THEN TO_CHAR (daysdiff || ' Day(s)')
WHEN anml_age < 12
THEN TO_CHAR (anml_age || ' Month(s)')
WHEN MOD (anml_age, 12) = 0
THEN TO_CHAR (ROUND (anml_age / 12, 0) || ' Year(s) '
ELSE TO_CHAR ( ROUND (anml_age / 12, 0)
|| ' Year(s) '
|| MOD (anml_age, 12)
|| ' Month(s)'
END age_string
from
(SELECT a.*,
CASE WHEN status IN ( 1)
THEN FLOOR(MONTHS_BETWEEN(TRUNC(SYSDATE),dob))
WHEN death_date IS NOT NULL AND status IN (2)
THEN FLOOR(MONTHS_BETWEEN(death_date,dob))
END anml_age,
CASE WHEN status IN (1)
THEN FLOOR(TRUNC(SYSDATE)-TRUNC(dob))
WHEN death_date IS NOT NULL AND status IN (2)
THEN FLOOR(TRUNC(death_date) - TRUNC(dob))
END daysdiff
from (
SELECTanml.id, status,
TO_DATE ( DECODE (b_date,
NULL, 1,
b_date
|| '-'
|| DECODE (b_month,
NULL, 1,
b_month
|| '-'
|| b_year,
'dd-mm-yyyy'
) DOB,
death_date
FROM anml
WHERE b_year IS NOT NULL
) a) top
when i tried to fetch all values from view its working fine.
But when i tried to fetch values based on condition like as follows,
select * from view1 where anml_age > 20 and anml_age<30
I am getting error like:
Input Value long enough for date format and Error in executing parallel query
Please tell me wht is wrong.Here is your formatted code
create or relace view view1 as
select top."ID",top."STATUS",top."DOB",top."DEATH_DATE",top."ANML_AGE",top."DAYSDIFF",
CASE
WHEN anml_age < 1
THEN 'D'
ELSE 'M'
END age_unit,
CASE
WHEN anml_age < 1
THEN TO_CHAR (daysdiff || ' Day(s)')
WHEN anml_age < 12
THEN TO_CHAR (anml_age || ' Month(s)')
WHEN MOD (anml_age, 12) = 0
THEN TO_CHAR (ROUND (anml_age / 12, 0) || ' Year(s) '
ELSE TO_CHAR ( ROUND (anml_age / 12, 0)
|| ' Year(s) '
|| MOD (anml_age, 12)
|| ' Month(s)'
END age_string
from
(SELECT a.*,
CASE WHEN status IN ( 1)
THEN FLOOR(MONTHS_BETWEEN(TRUNC(SYSDATE),dob))
WHEN death_date IS NOT NULL AND status IN (2)
THEN FLOOR(MONTHS_BETWEEN(death_date,dob))
END anml_age,
CASE WHEN status IN (1)
THEN FLOOR(TRUNC(SYSDATE)-TRUNC(dob))
WHEN death_date IS NOT NULL AND status IN (2)
THEN FLOOR(TRUNC(death_date) - TRUNC(dob))
END daysdiff
from (
SELECTanml.id, status,
TO_DATE ( DECODE (b_date,
NULL, 1,
b_date
|| '-'
|| DECODE (b_month,
NULL, 1,
b_month
|| '-'
|| b_year,
'dd-mm-yyyy'
) DOB,
death_date
FROM anml
WHERE b_year IS NOT NULL
) a) top -
Materialized view query (Oracle 9i)
I have dropped a materialized view query and trying to create the same with additional columns in the prebuilt table.
Option - 1
when Iam using a query in the materialized view query "select * from schema.table@link, with refresh mode fast option, the database throws an error " no table or view exists"
Option - 2
When Iam using a query in the materialized view query "select * from schema.table@link, with refresh mode option either complete or force, it gets created.
I need to create the above materialized view query in the fast mode option, Please help.
-balaHi,
Does a table named profit_mvw already exist?
The following example illustrates the two steps required to register a user-defined table. First, the table is created, then the materialized view is defined using exactly the same name as the table. This materialized view sum_sales_tab is eligible for use in query rewrite.
CREATE TABLE sum_sales_tab
PCTFREE 0 TABLESPACE demo
STORAGE (INITIAL 16k NEXT 16k PCTINCREASE 0) AS
SELECT s.prod_id, SUM(amount_sold) AS dollar_sales,
SUM(quantity_sold) AS unit_sales
FROM sales s GROUP BY s.prod_id;
CREATE MATERIALIZED VIEW sum_sales_tab
ON PREBUILT TABLE WITHOUT REDUCED PRECISION
ENABLE QUERY REWRITE AS
SELECT s.prod_id, SUM(amount_sold) AS dollar_sales,
SUM(quantity_sold) AS unit_sales
FROM sales s GROUP BY s.prod_id;
Regards,
Simon -
ORA-01762: vopdrv: view query block not in FROM ????
Hi All
any one aware of the error.
ORA-01762: vopdrv: view query block not in FROM
Please reply back.ORA-01762:vopdrv: view query block not in FROM
Cause:This is an internal error message not normally issued.
Action:Contact Oracle Support Services.
Edited by: Karthick_Arp on Sep 23, 2008 11:01 PM -
Declaratively set the value of a bind parameter in a view query
Can I declaratively set that I want the value of the bind parameter in the view query to be the value of a specific field in the current row of a specific iterator in my data bindings? Thanks :D
user11976105 wrote:
Hm I guess I should mention I'm doing the retrieval in Java, using a ValueChangeListenerIn this case, you will still need to bind an ExecuteWithParams action to your page definition and execute it from your ValueChangeListener after supplying its named data.
In the code spinet, the new value from the ValueChangeEvent is passed to the bind variable.
public void yourValidChangeListener(ValueChangeEvent valueChangeEvent) {
// get the ExecuteWithParameters operation binding from the bindings
OperationBinding executeWithParameters = ADFUtils.findOperation("yourExecuteWithParametersBindingId");
// setup bind variable using the new value from the valueChangeEvent
executeWithParameters.getParamsMap().put("yourParameterId", valueChangeEvent.getNewValue());
// execute
executeWithParameters.execute();
// check for errors
if(executeWithParameters.getErrors().size() != 0) {
// error(s) occured
}
Maybe you are looking for
-
Plays on TV, but not on iMac
I imported an iMovie to iDVD and burned a DVD on my iMac. The DVD plays on a standard DVD player for my television, but it does not play on my iMac. Each time I insert the DVD into my computer, it is rejected. What did I do wrong? I know the movie bu
-
ABAP program can't connect to a HTTP destination
Hello, I have an ABAP program that's used to download data from an internet site. As an internet access proxy has been installed, the program stopped working, displaying an error message: ...Connect to host...Port 80 error: NIECONN_REFUSED Reading th
-
Hi, I already succeeded in configuring my router to open port 80 and pointed it to the LAN IP address of my Mac server. Now, when I type the WAN IP address from a remote computer outside my LAN, I can see my temporary website. So my set-up is working
-
Installing VM Server v2.2.1 on Dell PE T110 hangs at loading initrd.img
Hello, I'm trying to install VM Server v2.2.1 on a Dell PowerEdge T110. I burned OracleVM-Server-2.2.1.iso to a CD, booted the T110, got to the Oracle VM Server installation screen, entered: boot: /isolinux/vmlinuz initrd=/isolinux/initrd.img pressed
-
2 Accounts, 1 Login...
Ok, the other day I was 'spring cleaning' my MacBook Pro; creating folders for everything and really organising myself. Being quite obsessive about little things, I thought I'd change the name that appears next to the home icon from 'Phockz' to 'Fox'