Select inside a select statement is not running
Can you please explain to me why the bottom is not run and what we need to do to run this kind of scenario.
My second REGEXP_LIKE variable comes from another table
Select
* de
EMP
WHERE
NOT REGEXP_LIKE(ename, select 'LA| AR' from dual
)
Because online select statement needs to be surrounded by square brackets so that the result is regarded as a value.
SQL > ed
A written file afiedt.buf1 Select
2 of PEM
3 * WHERE NO REGEXP_LIKE (ename, (select ' THE |)) AR' double))
SQL > /.EMPNO, ENAME, JOB HIREDATE DEPTNO COMM SAL MGR
---------- ---------- --------- ---------- -------------------- ---------- ---------- ----------
7369 SMITH CLERK 7902 DECEMBER 17, 1980 00:00:00 800 20
7499 ALLEN SALESMAN 7698 20 FEBRUARY 1981 00:00:00 1600 300 30
7566 JONES MANAGER 7839 2 APRIL 1981 00:00:00 2975 20
7788, SCOTT, ANALYST, 7566 19 APRIL 1987 00:00:00 3000 20
PRESIDENT OF KING 7839 17 NOVEMBER 1981 00:00:00 5000-10
7844 TURNER SALESMAN 7698 1981 - SEP - 08 00:00:00 1500 0 30
7876 ADAMS CLERK 7788 23 MAY 1987 00:00:00 1100 20
7900 JAMES CLERK 7698 3 DECEMBER 1981 00:00:00 950 30
7902 FORD ANALYST 7566 3 DECEMBER 1981 00:00:00 3000 20
7934 MILLER CLERK 7782 23 JANUARY 1982 00:00:00 1300 1010 selected lines.
However, why not just make...
Select *.
WCP
If NOT of REGEXP_LIKE (ename, ' THE |) AR')
/
Tags: Database
Similar Questions
-
Why the error message is created, and the statement may not run properly?
Why the error message is created, and the statement may not run properly?
SQL> select sql_handle, plan_name, creator from dba_sql_plan_baselines where sql_text='select*from hr.jobs where min_salary>10000'; select sql_handle,plan_name,creator from dba_sql_plan_baselines where sql_text='select*from hr.jobs where min_salary>10000' * ERROR at line 1: ORA-00932: inconsistent datatypes: expected - got CLOB
It is true that it is the problem of syntax. Change the increased as follows, the increased can run successfully:
SQL> select sql_handle,plan_name,creator from dba_sql_plan_baselines where sql_text like 'select*from hr.jobs where min_salary>10000';
Edited by: jetq may 3, 2010 19:26
-
SELECT statement where not equal number of columns
Hi experts,
I have a sum of column
Thanks in advanceid amount 1 123.0000000000 2 33344.0000 3 66666.36220000000000000000 4 2122222.7878789799999 5 444444444 6 .000000000000000000000 7 wweeeeeeeeeerr 8 eeeeeeeeeeeeeet I want to get : id amount 7 wweeeeeeeeeerr 8 eeeeeeeeeeeeeet
A way
with tempdata as(select '123' amount from dual union select 'ABC12' from dual union select 'abc' from dual union select '123.00' from dual ) select * from tempdata where LENGTH(TRIM(TRANSLATE(amount, ' +-.0123456789', ' '))) is not null
-
Select statement will not accept that so informed data date picker
In my report source region, I have the following. It works but sometimes the user want to have all the dates of: P20_XXD and: P20_DD2
But the report doesn't give you anything if you don't fill in the date two pickers.
Select
incident_id,
incident_type,
status,
ccb_identifier,
last_name,
DBMS_LOB.substr("PROBLEM_TITLE",4000,1) "PROBLEM_TITLE"
DBMS_LOB.substr("PROBLEM_DESCRIPTION",4000,1) "PROBLEM_DESCRIPTION"
create_datex,
related_item,
DBMS_LOB.substr("RESOLUTION_DIARY",4000,1) "RESOLUTION_DIARY".
of 'KEYHD '.
where "INCIDENT_TYPE" as: P20_LIST_INCIDENT_TYPE
and (CREATE_DATEX > = TO_DATE(:P20_XDD,'DD/MM/YYYY'))
and CREATE_DATEX < = TO_DATE (: P20_DD2,' DD/MM/YYYY ""))If the values of the selectors of dates are not supplied then the values null that results do not meet the date comparison predicate. NULL values must be replaced by default appropriate, for example by using the nvl function:
select incident_id, incident_type, status, ccb_identifier, last_name, dbms_lob.substr("PROBLEM_TITLE",4000,1) "PROBLEM_TITLE", dbms_lob.substr("PROBLEM_DESCRIPTION",4000,1) "PROBLEM_DESCRIPTION", create_datex , related_item, dbms_lob.substr("RESOLUTION_DIARY",4000,1) "RESOLUTION_DIARY" from "KEYHD" where "INCIDENT_TYPE" like :P20_LIST_INCIDENT_TYPE and (CREATE_DATEX >= nvl(TO_DATE(:P20_XDD,'DD/MM/YYYY'), date '-4712-01-01') and CREATE_DATEX <= nvl(TO_DATE(:P20_DD2,'DD/MM/YYYY'), date '9999-12-31'))
(Always zip code encapsulated in------)
…\
Labels to preserve formatting).
-
Why this parallel DML statement is not run as fast as DBMS_PARALLEL_EXECUTE?
Hello
I'm on the database Oracle Enterprise Edition, Linux RH 11.2.0.3. I have a pl/sql function that accepts a sdo_geometry (essentially an object with a few varrays), round each number in one of the varrays and retransmits the object. Here is a version of the function, simplified slightly for brevity:
create or replace round_coordinates (p_geometry in sdo_geometry, p_round_factor in numbers)
return sdo_geometry parallel_enable
is
sdo_geometry v_geometry: = p_geometry;
v_ordinates sdo_ordinate_array;
Start
v_ordinates: = p_geometry.sdo_ordinates;
for me in v_ordinates.first... loop of v_ordinates. Last
v_ordinates (i): = round (v_ordinates (i), p_round_factor);
end loop;
Return sdo_geometry (v_geometry.sdo_gtype, v_geometry.sdo_srid, v_geometry.sdo_point, v_geometry.sdo_elem_info, v_ordinates);
end round_coordinates;
/
I need to perform this function as an update DML on hundreds of millions of sdo_geometry objects and according to my estimates it will take weeks. So, I want to run in parallel.
The data is in a bunch of tables, some with lines of k ~ 100 more with millions of people. My preference is to browse the tables and run an update such as:
Update < table > set geometry = round_coordinates (geometry);
But I would like to operate in parallel, so I thought that I would allow the DML parallel to the session with
ALTER session enable parallel dml.
ALTER table < table > parallel;
, and then run the update by: Update / * + parallel * / < table > set geometry = round_coordinates (geometry);
When I do that, I can see a v$ px_session 16 parallel slaves are bent and the plan of the explanation is the following:
------------------------------------------------------------------------------------------------------------------
| ID | Operation | Name | Lines | Bytes | Cost (% CPU). Time | TQ | IN-OUT | PQ Distrib.
------------------------------------------------------------------------------------------------------------------
| 0 | UPDATE STATEMENT. | 10000 | 468K | 43 (0) | 00:00:01 | | | |
| 1. UPDATE | SMALL_10000 | | | | | | | |
| 2. COORDINATOR OF PX | | | | | | | | |
| 3. PX SEND QC (RANDOM). : TQ10000 | 10000 | 468K | 43 (0) | 00:00:01 | Q1 00 | P > S | QC (RAND) |
| 4. ITERATOR BLOCK PX | | 10000 | 468K | 43 (0) | 00:00:01 | Q1 00 | ISSUE | |
| 5. TABLE ACCESS FULL | SMALL_10000 | 10000 | 468K | 43 (0) | 00:00:01 | Q1 00 | SVCP | |
------------------------------------------------------------------------------------------------------------------
But the update statement on my test data set does not any more quickly - it takes a few seconds more series that suggests General fresh extra expectations for the management of parallel slaves that's happened, but they did not have the query run faster.
I tried to use the dbms_parallel_execute with the create_chunks_by_rowid option package and parallel_level = 16 With that I get at the end just over 1/16th of the time that it takes to run in series!That's fine, so I have the option dbms_parallel_execute, but I would like to understand why the query with the parallel flag does not expedite things.
Any ideas?
Thank you
John
It may be that the call to the PL/SQL function slows down things. Did you think to do in pure SQL?
Here is an example:
update test_sdo tsd set tsd.geometry.sdo_ordinates = (select cast(collect(round(t2.column_value)) as sdo_ordinate_array) from test_sdo t1 ,table(t1.geometry.sdo_ordinates) t2 where t1.id = tsd.id)
Post edited by: PaulHorth
BTW: You can parallelize the query part of the SQL but not updating, it's documentation:
"Parallel DML can be done on tables with columns object provided that the columns of the object are not accessible."
-
DECLARE
n NUMBER.
BEGIN
n: = 1;
WHILE (n < = 10)
LOOP
CREATE a user EM | IDENTIFIED BY KLU n;
SESSION CREATION GRANT, GRANT ANY PRIVILEGE TO EM. n;
COMMIT;
n: = n + 1;
END LOOP;
END;
Hello
Here is the dynamic creation of user query and giving grants to the user,.
DECLARE
n NUMBER.
cr_user VARCHAR2 (300);
gr_user VARCHAR2 (300);
BEGIN
n: = 1;
While (n<=>=>
LOOP
cr_user: = 'CREATE user EM | n | "IDENTIFIED BY KLU";
gr_user: = "GRANT CREATE SESSION, GRANT ANY PRIVILEGE to EM '. n | '';
EXECUTE IMMEDIATE cr_user;
EXECUTE IMMEDIATE gr_user;
n: = n + 1;
END LOOP;
END;
Edited: Removed when OTHER exceptions to Code.
See you soon!
-
Insert and update by the select statement
Hi all
How can I insert and update in an oracle 10g database table
by a select statement. do not merge.Florian wrote:
Hi all
How can I insert and update in an oracle 10g database table
by a select statement. do not merge.
>How can I insert and update in a table of database oracle 10g via a select statement. do not merge.
Do you mean by using subqueries?
Something like
insert into whatever ...select statement update whatever set (column, column) = (select column, column ...)
There is a lot of information on this topic in the online documentation
-
Formatting for a select statement
I am trying to include formatting in a select statement.
The data, I'm pulling compared to the SSN for a unique value. The problem is that the SSN is formatted with dashes in a table and not in the other.
Example:
Table 1
Name SSN
John 400-30-8745
Mary 348-00-4093
Table 2
Name SSN
John 400308745
Mary 348004093
What I would do is:
Select * into Table1, Table2 where table1.ssn = table2.ssn
However, I am unable to do so due to the formatting.
Thxs!It will not replace the data in the database because it is a SELECT statement and not a DML (INSERT, UPDATE, DELETE) statement. You can also consider putting a function based on this column in table1 index to facilitate this request. However, it depends on many factors and because we do not know the versions, estimated use, how many times the table is updated, etc., we can say with certainty whether this can help or not. An example would be:
CREATE INDEX TABLE1_SSN_FBIDX ON TABLE1(REPLACE(SSN,'-'))
-
SELECT the view queries do not run unless the shared_pool hot flashes
Hello
Need some urgent advice
We have a system that we are trying to run a simple select statement on a view (nested).
in a first time - it gives a result in less than a second. After that, it takes an hour.
Flushing the shared_pool, she will run again in less then a second... and then again an hour.
flushes of heat if the shared_pool will solve it for a single run.
I have already increased the shared_pool and it did not help... linux db system is 11.2.0.3.
parameters:
pga_aggregate_target 1887436800
Thank you
ORI
You could get an execution plan different for various reasons. Maybe the comments of cardinality: you might try setting _optimizer_use_feedback = false.
-
Popup LOV selected the value not in session state
I have a pop LOV element on a page in my application. Once the item has been selected in the list presented, I would like to use as part of a select statement. Select statement failed. It turns out that the value I want the popup THAT LOV is not being saved in session state, so of course the select statement fails. I determine this by clicking on the session menu item in the developer bar - the item itself presents itself, but the value is empty.
What would cause a popup LOV value choice not finish by in session state, and how do I make sure he gets there?
Thank you!
If you need the value in a SQL report, you can just set "Elements of Page to submit" in your report to your LOV element definition. Otherwise, create a dynamic fire action when your LOV is changed with a set of pl/sql null process action; then set Page elements to send to your LOV element.
Alternatively you could do it manually with your own function/Manager javascript using the '$s' Apex API by creating a dynamic action that JavaScript is triggered then the loading of the page:
$("#PXX_YOUR_LOV").on('change',function(){ var getValue=$(this).val(); $s('PXX_YOUR_LOV', getValue); });
Changing the value in LOV only updates the HTML code, the element must be submitted to the server so that the value that will be put in session state. The gurus can explain more, but the above methods are what I use depending on the situation.
see you soon,
John
-
Pivot will not get result in the select statement
This is the version of oracle 11g R2 on windows details 7 OS
CREATE TABLE OTBOOKINGDETAILS
(EMPNO VARCHAR2 (10 BYTE),
DATE OF OTBOOKEDDATE,
NUMBER (5.0) DAY OF THE WEEK.
DAYCEILINGHRS VARCHAR2 (10 BYTE));
Here is the data
INSERT INTO OTBOOKINGDETAILS VALUES (101 ', 3 MARCH 2013', 1,' 09:00 ');
INSERT INTO OTBOOKINGDETAILS VALUES (101 ', 3 APRIL 2013', 2' 01:00 ');
INSERT INTO OTBOOKINGDETAILS VALUES (101 ', 3 MAY 2013', 3,' 01:00 ');
INSERT INTO OTBOOKINGDETAILS VALUES (101 ', 3 JUNE 2013', 4' 01:00 ');
INSERT INTO OTBOOKINGDETAILS VALUES (101 ', 3 JULY 2013', 5,' 01:00 ');
INSERT INTO OTBOOKINGDETAILS VALUES (101 ', 3 AUGUST 2013', 6,' 01:00 ');
INSERT INTO OTBOOKINGDETAILS VALUES (101 ', 3 SEPTEMBER 2013', 7,' 00:00 ');
INSERT INTO OTBOOKINGDETAILS VALUES (102 ', 3 MARCH 2013', 1,' 09:00 ');
INSERT INTO OTBOOKINGDETAILS VALUES (102 ', 3 APRIL 2013', 2' 01:00 ');
INSERT INTO OTBOOKINGDETAILS VALUES (102 ', 3 MAY 2013', 3,' 01:00 ');
INSERT INTO OTBOOKINGDETAILS VALUES (102 ', 3 JUNE 2013', 4,' 02:00 ');
INSERT INTO OTBOOKINGDETAILS VALUES (102 ', 3 JULY 2013', 5,' 01:00 ');
INSERT INTO OTBOOKINGDETAILS VALUES (102 ', 3 AUGUST 2013', 6,' 04:00 ');
INSERT INTO OTBOOKINGDETAILS VALUES (102 ', 3 SEPTEMBER 2013', 7' 01:00 ');
INSERT INTO OTBOOKINGDETAILS VALUES (101 ', 3 OCTOBER 2013', 1,' 00:00 ');
INSERT INTO OTBOOKINGDETAILS VALUES (101 ', 3 NOVEMBER 2013', 2' 01:00 ');
INSERT INTO OTBOOKINGDETAILS VALUES (101 ', 3 DECEMBER 2013', 3,' 01:00 ');
INSERT INTO OTBOOKINGDETAILS VALUES (101 ', 13 MARCH 2013', 4,' 04:45 ');
INSERT INTO OTBOOKINGDETAILS VALUES (101 ', 14 MARCH 2013', 5,' 01:00 ');
INSERT INTO OTBOOKINGDETAILS VALUES (101 ', 15 MARCH 2013', 6,' 01:00 ');
INSERT INTO OTBOOKINGDETAILS VALUES (101 ', 16 MARCH 2013', 7' 01:00 ');
Here, I want to Dayceiling hours below the output using pivot
EMPNO OTBOOKEDDATE DAY1_HRS DAY2_HRS DAY3_HRS DAY4_HRS DAY5_HRS DAY6_HRS DAY7_HRS
101 03/03/2013 09:00 01:00 01:00 01:00 01:00 01:00 00:00
102 03/03/2013 09:00 01:00 01:00 02:00 01:00 04:00 01:00
101 03/10/2013 00:00 01:00 01:00 04:45 01:00 01:00 01:00ChakravarthyDBA wrote:
I need to include the pivot query in the select statementCan' are you use PIVOT here since you do not know from the start what values OTBOOKEDDATE. So use:
select empno, otbookeddate - weekday + 1 otbookeddate, max( case weekday when 1 then dayceilinghrs end ) day1_hrs, max( case weekday when 2 then dayceilinghrs end ) day2_hrs, max( case weekday when 3 then dayceilinghrs end ) day3_hrs, max( case weekday when 4 then dayceilinghrs end ) day4_hrs, max( case weekday when 5 then dayceilinghrs end ) day5_hrs, max( case weekday when 6 then dayceilinghrs end ) day6_hrs, max( case weekday when 7 then dayceilinghrs end ) day7_hrs from otbookingdetails group by empno, otbookeddate - weekday + 1 order by otbookeddate, empno / EMPNO OTBOOKEDDA DAY1_HRS DAY2_HRS DAY3_HRS DAY4_HRS DAY5_HRS DAY6_HRS DAY7_HRS ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- 101 03-03-2013 09:00 01:00 01:00 01:00 01:00 01:00 00:00 102 03-03-2013 09:00 01:00 01:00 02:00 01:00 04:00 01:00 101 10-03-2013 00:00 01:00 01:00 04:45 01:00 01:00 01:00 SQL>
SY.
-
Not finding the correct syntax for the select statement
Hello
The following statement works very well and gives the expected results:
As an academic exercise, I wanted to rewrite the above statement without using the WITH clause, I tried this (amongst dozens of other tests - I hit a mental block and cannot understand):prompt prompt Using WITH t prompt with t as ( select a.proj_id, a.proj_start, a.proj_end, case when ( select min(a.proj_start) from v b where (a.proj_start = b.proj_end) and (a.proj_id != b.proj_id) ) is not null then 0 else 1 end as flag from v a order by a.proj_start ) select proj_id, proj_start, proj_end, flag, -- -- the following select statement is what I am having a hard time -- "duplicating" without using the WITH clause -- ( select sum(t2.flag) from t t2 where t2.proj_end <= t.proj_end ) s from t;
Thanks for the help, much appreciated.prompt prompt without with prompt select c.proj_id, c.proj_start, c.proj_end, c.flag, -- -- This is what I've tried as the equivalent statement but, it is -- syntactically incorrect. What's the correct syntax for what this -- statement is intended ? -- ( select sum(t2.flag) from c t2 where t2.proj_end <= c.proj_end ) as proj_grp from ( select a.proj_id, a.proj_start, a.proj_end, case when ( select min(a.proj_start) from v b where (a.proj_start = b.proj_end) and (a.proj_id != b.proj_id) ) is not null then 0 else 1 end as flag from v a order by a.proj_start ) c;
John.
PS: The DDL for table v used by the above statements is:
drop table v; create table v ( proj_id number, proj_start date, proj_end date ); insert into v values ( 1, to_date('01-JAN-2005', 'dd-mon-yyyy'), to_date('02-JAN-2005', 'dd-mon-yyyy')); insert into v values ( 2, to_date('02-JAN-2005', 'dd-mon-yyyy'), to_date('03-JAN-2005', 'dd-mon-yyyy')); insert into v values ( 3, to_date('03-JAN-2005', 'dd-mon-yyyy'), to_date('04-JAN-2005', 'dd-mon-yyyy')); insert into v values ( 4, to_date('04-JAN-2005', 'dd-mon-yyyy'), to_date('05-JAN-2005', 'dd-mon-yyyy')); insert into v values ( 5, to_date('06-JAN-2005', 'dd-mon-yyyy'), to_date('07-JAN-2005', 'dd-mon-yyyy')); insert into v values ( 6, to_date('16-JAN-2005', 'dd-mon-yyyy'), to_date('17-JAN-2005', 'dd-mon-yyyy')); insert into v values ( 7, to_date('17-JAN-2005', 'dd-mon-yyyy'), to_date('18-JAN-2005', 'dd-mon-yyyy')); insert into v values ( 8, to_date('18-JAN-2005', 'dd-mon-yyyy'), to_date('19-JAN-2005', 'dd-mon-yyyy')); insert into v values ( 9, to_date('19-JAN-2005', 'dd-mon-yyyy'), to_date('20-JAN-2005', 'dd-mon-yyyy')); insert into v values (10, to_date('21-JAN-2005', 'dd-mon-yyyy'), to_date('22-JAN-2005', 'dd-mon-yyyy')); insert into v values (11, to_date('26-JAN-2005', 'dd-mon-yyyy'), to_date('27-JAN-2005', 'dd-mon-yyyy')); insert into v values (12, to_date('27-JAN-2005', 'dd-mon-yyyy'), to_date('28-JAN-2005', 'dd-mon-yyyy')); insert into v values (13, to_date('28-JAN-2005', 'dd-mon-yyyy'), to_date('29-JAN-2005', 'dd-mon-yyyy')); insert into v values (14, to_date('29-JAN-2005', 'dd-mon-yyyy'), to_date('30-JAN-2005', 'dd-mon-yyyy'));
select c.proj_id, c.proj_start, c.proj_end, c.flag, -- -- This is what I've tried as the equivalent statement but, it is -- syntactically incorrect. What's the correct syntax for what this -- statement is intended ? -- ( select sum(t2.flag) from (select a.proj_id, a.proj_start, a.proj_end, case when ( select min(a.proj_start) from v b where (a.proj_start = b.proj_end) and (a.proj_id != b.proj_id) ) is not null then 0 else 1 end as flag from v a order by a.proj_start ) t2 where t2.proj_end <= c.proj_end ) as proj_grp from ( select a.proj_id, a.proj_start, a.proj_end, case when ( select min(a.proj_start) from v b where (a.proj_start = b.proj_end) and (a.proj_id != b.proj_id) ) is not null then 0 else 1 end as flag from v a order by a.proj_start ) c;
-
Hey everybody,
First of all, Yes, I searched through the 8.5 database schema guide. As I went through the scheme, I've developed some ideas on how to collect the data you want. However, if someone has already developed or found the SQL statements (which I'm sure that someone already has) it would help by reducing to the minimum of the buggs in my data collection program.
All these statistics must be grouped by CSQ and selected for a certain time interval (
and ). That is, levels of 1 hour. I have no problem to get a list of results and then perform v.f. to achieve the desired final result. Also, if I need to run several select statements for tables of essentially two join, please include two statements. Finally, I saw the RtCSQsSummary table, but I need to collect data for the past, not at this time. 1 total calls presented by the CSQ
2. total number of calls answered by the CSQ
3 total number of calls abandoned by the CSQ
4. percentage of calls abandoned by CSQ (if it is not stored in the database, I think:
/ ) 5. average abandon time in seconds (if it is not stored in the DB, I think: sum (
) / ) 6. service level - % calls answered in 90 seonds by a set of skills (I have seen metServiceLevel in the ContactQueueDetail table; however, I need to find how to configure this threshold for application)
7. average speed of response by CSQ
8 average conversation by CSQ calls
9. the aggregates connected full-time resources or agents CSQ
10. resources/agents of CSQ ready time
I realize that some of them should be easy to find (as I always am search in the guide of db schema), but I was reading how a new record is created for each step of the call so I could easily see how I could get inaccurate information without properly developed select statements.
Any help will be greatly appreciated.
Brendan
Brendan,
I read your message very well.
You have the schema of database with tables and description. each table has its associated tables (connected with primary and foreign keys). I think you should start the tables to determine what you need.
Cisco uses the stored procedure to prepare the reports. the stored procedure is 'sp_csq_interval' to create the report.
Activity report of Queue Service contact"
HTH
Anas
Please note all useful posts
-
Skip and capture the Oracle SQL record dirty in a select statement
Hello
I have the Oracle Oracle 11.2.0.4 database when I run a select query.
Question:
10 columns have given Date format. When I try to execute this query into a FROG he says, a month not valid. Since the records are billion in nature, I am not able to know which line has this problem.
Is there a way I can capture the failed row and add it to other tables and continues with the select statement regardless of this error
OK, you have several TO_DATE functions fed a string that is built on the fly. At least part of the time, the chain that is built does not match the date format mask used.
For example:
TO_DATE (SUBSTR (TO_CHAR (SQ_W_PURCH_CYCLNS_ORA. LAST_SUBMITTED_ON_DTTM_WID), 0, 8). » -'|| SUBSTR (TO_CHAR (SQ_W_PURCH_CYCLNS_ORA. (LAST_SUBMITTED_ON_DTTM_WID), 9, 6), "YYYYMMDD-HH24MISS")
"SQ_W_PURCH_CYCLNS_ORA. LAST_SUBMITTED_ON_DTTM_WID' does not have a string where characters 5-6 are in the range 01-12. You'll have to do an analysis on this column. From its data and how that is managed by to_char. What ARE the data type of ' SQ_W_PURCH_CYCLNS_ORA. LAST_SUBMITTED_ON_DTTM_WID' and what is a typical value?
As others have said, this is simply an impossibility for a column of a table to actually have invalid month (or day, or year, or hour or minute or second). ONLY, you get this error during the conversion of a string to a date with the TO_DATE function.
-
DDL lock on the object in a SELECT statement?
Environment:
Oracle 11.2.0.4 EE on Solaris
My client called me when she was trying to create a new index on a table and the process was just hanging. Also, she was not able to DELETE an existing index on the same table, which deal with hang them as well.
After reviewing the advice DBA_DDL_LOCKS, I found a DDL lock on the target of the index table.
The DDL lock is held by a process doing a SELECT on the table and this process worked for several hours.
There was no entry in V$ LOCKED_OBJECTS for the table.
I don't know, yet, what other operations prior to the SELECT statement in the offending process, I have not heard of the user yet.
I realize a DDL lock is placed on objects to prevent changes while specific operations are directed against this object, i.e. the DROP, UPDATE, compile the PACKAGE, etc.
Question: Is a select also place a DDL lock on a table at a level that would avoid a new index is created or an existing index having fallen?
Thank you very much for your comments!
Any reference to the resolution is greatly appreciated.
I searched some Concepts Developers Guide, SQL, even Google reference Guide.
-gary
> My question is now, this lock persists for the duration of the running query?
Easy enough to show that it is not.
Session1:
SQL> create table foo(bar number); Table created. SQL> insert into foo values(1); 1 row created. SQL> commit; Commit complete. SQL> variable x refcursor SQL> variable a number SQL> begin 2 open :X for select bar from foo; 3 end; 4 / PL/SQL procedure successfully completed.
Session 2:
SQL> drop table foo; Table dropped.
Note that I was able to remove the table even if select is still 'in progress' - the cursor is open.
If you really want to blow your mind, go back to the session 1:
SQL> begin 2 fetch :X into :a; 3 end; 4 / PL/SQL procedure successfully completed. SQL> print a A ---------- 1
The picture has gone, but I can always look for him. However, try again:
SQL> / begin * ERROR at line 1: ORA-00604: error occurred at recursive SQL level 1 ORA-00942: table or view does not exist
Note that the forum software is stupid. is: followed by x. seems it's really important to have a smiley to lovey eyes in a technical forum.
Edit - and when you format the SQL code, it is removed completely and render invisible... silly.
I edited my code to use: X and the problem disappeared...
Maybe you are looking for
-
Already running vi "not compiled?
I have a mixed device FPGA, we access by ethernet and I a VI on this unit and it works, and it's just wonderful. I have an application which refers to this VI. He used to work. Then we moved to another location and the network address has changed. We
-
I got a call today two microsoft workers online / call center agents calling from London, although they all Indian accents. They made me see the viewer certmgr.msc and events and showed some errors. Then they said to install teamviewer. They said all
-
Aspire V3 does not work on battery
I have a week old Aspire V3 - 372T initally worked on the battery. One day it won't turn at all out of fashion 'sleep' with or without battery. According to the instructions here, I reset the battery with a paper clip, and it worked to the power.
-
Hello I'm going to buy a BB Z10 as a gift, but it's going to serve in Kosovo, where network operators do not support the Blackberry Internet Service (BIS). I said to carphone warehouse could not get connected to the mobile internet because of this. C
-
BlackBerry Smartphones need help with resetting the voice message counter
Recently, I moved the United States in India and brought with me my favorite Storm 9530. In the United States, I had Verizon as my career and I went to Vodafone in India. Prior to joining Vodafone, he had 5 posts not read/unheard voices and so my Sto