I do not understand this behavior using Expression of Table common Recuersive
I haven't used the RCTE much, but I'm using it each time as possible to better understand. Unfortunately, this one left me speechless.WITH test_data as
( select 'Bob' nm, 11 grp, 1 rnk from dual union all
select 'Ray' nm, 12 grp, 1 rnk from dual union all
select 'Joe' nm, 12 grp, 2 rnk from dual union all
select 'Liz' nm, 13 grp, 1 rnk from dual union all
select 'Jan' nm, 13 grp, 2 rnk from dual union all
select 'Lea' nm, 13 grp, 3 rnk from dual union all
select 'Sam' nm, 14 grp, 1 rnk from dual union all
select 'Ozy' nm, 14 grp, 2 rnk from dual union all
select 'Fae' nm, 14 grp, 3 rnk from dual union all
select 'Lee' nm, 14 grp, 4 rnk from dual
)
, recurs ( grp, lst, rnk, nm ) AS
(
SELECT grp, nm, rnk, nm
from test_data
where rnk=1
--and grp = 14
UNION ALL
SELECT t.grp
-------------------------------------------------------------------------------------
-- Toggle the commenting of the next two lines to see the error ----------------------
--, r.lst || ', ' || t.nm --- This is the line that I would like to have work
-- Instead, using the next line, to limit the length of the string concatenation, but the result is wrong
, SUBSTR( r.lst, 1, 2000) || ', ' || t.nm
-------------------------------------------------------------------------------------
, t.rnk
, t.nm
FROM test_data t
JOIN recurs r ON ( t.rnk = r.rnk + 1
AND t.grp = r.grp)
)
SELECT recurs.*, LENGTH ( nm )
FROM recurs
ORDER BY grp, rnk;
If I Uncomment a line (and comment out the line that accompanies it, at the same time), the error will be:ORA-01489: result of string concatenation is too long
And by running the query of how it is demonstrated, this returns: GRP LST RNK NM LENGTH(NM)
---------- ------------- ---------- --- ----------
11 Bob 1 Bob 3
12 Ray 1 Ray 3
12 Ray, Joe 2 Joe 3
13 Liz 1 Liz 3
13 Liz, Jan 2 Jan 3
13 Liz, Jan, Lea 3 Lea 3
14 Sam 1 Sam 3
14 Sam, Ozy 2 Ozy 3
14 Sam, Ozy, Fae 3 Fae 3
14 Sam, Ozy, Lee 4 Lee 3
10 rows selected.
Note that 'rnk = 4' record in "grp = 14". The value of "E" is outside the "lst".Can someone make sense this for me?
It works, explicitly express the result to varchar2 (4000) in the anchoring of the union query.
SQL> WITH test_data as
2 ( select 'Bob' nm, 11 grp, 1 rnk from dual union all
3 select 'Ray' nm, 12 grp, 1 rnk from dual union all
4 select 'Joe' nm, 12 grp, 2 rnk from dual union all
5 select 'Liz' nm, 13 grp, 1 rnk from dual union all
6 select 'Jan' nm, 13 grp, 2 rnk from dual union all
7 select 'Lea' nm, 13 grp, 3 rnk from dual union all
8 select 'Sam' nm, 14 grp, 1 rnk from dual union all
9 select 'Ozy' nm, 14 grp, 2 rnk from dual union all
10 select 'Fae' nm, 14 grp, 3 rnk from dual union all
11 select 'Lee' nm, 14 grp, 4 rnk from dual
12 )
13 , recurs ( grp, lst, rnk, nm ) AS
14 (
15 SELECT grp, cast(nm as varchar2(4000)), rnk, nm
16 from test_data
17 where rnk=1
18 --and grp = 14
19 UNION ALL
20 SELECT t.grp
21 -------------------------------------------------------------------------------------
22 -- Toggle the commenting of the next two lines to see the error ----------------------
23 , r.lst || ', ' || t.nm --- This is the line that I would like to have work
24 -- Instead, using the next line, to limit the length of the string concatenation, but the result is wrong
25 --, SUBSTR( r.lst, 1, 2000) || ', ' || t.nm
26 -------------------------------------------------------------------------------------
27 , t.rnk
28 , t.nm
29 FROM test_data t
30 JOIN recurs r ON ( t.rnk = r.rnk + 1
31 AND t.grp = r.grp)
32 )
33 SELECT recurs.*, LENGTH ( nm )
34 FROM recurs
35 ORDER BY grp, rnk;
GRP LST RNK NM LENGTH(NM)
---------- ------------------------------ ---------- --- ----------
11 Bob 1 Bob 3
12 Ray 1 Ray 3
12 Ray, Joe 2 Joe 3
13 Liz 1 Liz 3
13 Liz, Jan 2 Jan 3
13 Liz, Jan, Lea 3 Lea 3
14 Sam 1 Sam 3
14 Sam, Ozy 2 Ozy 3
14 Sam, Ozy, Fae 3 Fae 3
14 Sam, Ozy, Fae, Lee 4 Lee 3
10 rows selected.
Tags: Database
Similar Questions
-
Hello
anyone ever did in Winxp with success. I do not understand this step«We can assume that any MAC address, we want by finding the key that controls the NIC we want change, put in a value chain called "NetworkAddress" and affecting the MAC address we want to use formatted as a hexadecimal 12-digit number (example: 000000000001).»
It is a part of the "Windows 2000/XP/Vista: The Hard Way.
from this link
http://www.irongeek.com/i.php?page=security/changemacConcerning
original title: change MAC address
Hello
I suggest to refer to this thread and follow the steps in this thread and check if that helps:
The steps in this link are for Windows 7 and they are valid for Windows XP.
It will be useful.
-
It's a good idea to keep track that uses a bunch of Audio channels selected in the arrange window, unless you actively play or record on a software Instrument.
Which no longer applies in Logic Pro X 10.2.3. In old versions of logic, selecting a range with a software instrument automatically would make this instrument in "Live" mode, which means that the instrument has begun to transform any MIDI in sound with a minimum of delay. This direct mode becomes an instrument need CPU power (on a single processor) and peut overload the audio engine. It is a waste of CPU if there is no direct game. Then select an audio track would ensure that No instrument is in direct mode. Now (LPX 10.2.2 or more) in direct mode can be turned on or off on a track, chosen or not - it is the R button on the track header.
-
No recent changes have been made to my computer. I hesitate to upgrade to 7 until this problem is sorted
There could be a problem with Vista.
Run the Advisor to upgrade in clean boot and check:
http://support.Microsoft.com/kb/929135If this does not help, then run the vista repair and then run Upgrade Advisor and check:
http://www.Vistax64.com/tutorials/88236-repair-install-Vista.htmlAlso take a look at this:
http://Windows.Microsoft.com/systemrequirementsHope this helps!
-
the downloaded program title is taken from the site spanky. the title is frain204 zip
Have you checked with the person or the company that produces the show? Whereas it is for Windows 95, 98 and XP, it may well not be compatible with Vista.
"spud-u-like" wrote in the new message: * e-mail address is removed from the privacy... *
the downloaded program title is taken from the site spanky. the title is frain204 zip
-
can not understand this type of exxtension...
These all files are video files...
by mistake I deleted these files, but when I got the file extension was the change...
How to solve this permanent... ???Hello
The selected file is a video made with Windows Phone, so try to rename the file and provide an .mp4 extension, and press enter. Now try to open the file with video app in Windows 8.Hope this helps, good luck :) -
that means "window.parent.document.forms".
is there a way to know what mean without having the rest of the code?
Alert ('Aviso!'); Window.parent.document.Forms [0].edAlgo.Select (); Window.parent.document.Forms [0].edAlgo.Focus (); It is a JavaScript question, not a question of ColdFusion, but I'll try to answer anyway.
window = self.
parent = self is a child window's parent window that gave birth to oneself.
document = document object (the code) model.
Forms [0] = first shape in an array of forms.
Window.parent.document.Forms [0] = (parent) window form opening.
. adAlgo.select () = form element select 'adAlgo '.
. adAlgo.focus () = place cursor on the form (focus) element "adAlgo".
It seems that it is a part of the validation of the form; If something in adAlgo is not correct, place the cursor there so that the user knows that the value must be corrected.
It's a full proposal, of course.
HTH,
^_^
-
Has anyone else had this problem with trying to buy Adobe photshop.
Hi Ozziegirl,
Please check the Doc: How to complete a purchase when I get an incorrect error 'country'?
Kind regards
Rave
-
Can not understand this issue with the layout - please help
Hello
I have a problem with the page layout in the header of my site portion. I would like the Facebook icon, the text "Write us", "Reservations welcome!" text and phone number all rinse just like on the picture below.
No matter what I do the text "Write to us" is not the right move.
I don't know what I'm not doing correctly so I ask some fresh eyes to take a look at the code CSS (here). The tags I'm tweaking are:
#et-social-icons {float: right; margin: 20px 0px 0px 0px ;}}
#et-social-icons one {make-size: 14px; color: #581b1a ;}}
#email - us {margin: 60px banner 0px 0px 0px; padding-left: 40px ;}}
#email - we a {make-size: 14px; color: #581b1a ;}}
#reservations p {margin: 0px 0px 30px 0px; do-size: 14px; police-weight: 800; color: #581b1a ;}}
The header html/php code is here:http://codeviewer.org/view/code:383 has
Try the css below. I'm not sure where you want to put as there seems to be a lot of css files associated with the page. We really need to finish the css cascade.
#email - us {}
text-align: right;
}
{#et-social-icons}
text-align: right;
padding: 0;
}
#reservations p {}
text-align: right;
margin: 0;
padding: 0;
}
-
Toshiba 39L4333DG CloudTV: I do not understand! Guide needed
Hello
I've just set up my new TV, I think it's great (besides being too slow), but I do not understand how to use the CloudTV.
My TV came with NO manuals: it included only a quick installation guide and a brief description of cloud TV.
I was able to download the full manual, but it says to look at the TV guide of cloud that I can't find anywhere.So I have set up my user in the TV of cloud, but how can I manage my messages? Or who are the 4 guys right suggesting me things to see, based on what?
If anyone can provide Cloud TV guide PDF or some other form of guide?
Thank you very much!!!
Hello
Visit this link:
http://www.Toshiba-OM.NET/LCD/PDF/English/L4333-323950-English.PDFThis is the instructions I found on the Toshiba Toshiba L43 CP portal * and W43 TV *.
Information and service cloud TV details are on page 52
Cloud TV includes the use of the browser web and Skype -
I do not understand file history
What is that thing in the history of the files all about? All the explanations I've found are so shallow and does not explain what he actually did. What are all of the advanced options and how they do it? Why can not I just have a complete and detailed description of how to use it?
I put it up to send files on a network drive. There are about 100 GB of photos, music and documents in my libraries. He sat there for two days, saying: it was market back them and whenever I checked to what extent she had progress was pathetic. What is it meant to be so slow? Why can't have just a progress indicator to show what he does?
Historical files seems to take 80 GB to save backups to about 40 GB of files, even if I did not bring any changes or the file structure, and this is the case when it is only about to half way through all my backup files. It must make a complete backup of base before trying to do things smart version?
I don't want you to save hundreds of versions of files, my destination drive is not large enough for this. I want to save a version and leave it at that. I have a 200 GB backup drive and 100 GB of data to go inside.
Microsoft is trying to make it intuitive and simple, by simply not explain it in detail. But when he doesn't have what you want and you do not understand this policy is of no use.
Can anyone point a complete and detailed guide decent? Maybe someone can help answer some of my ignorant questions above?
Thank you
Historical files would probably meet your needs. It is not a copy of a versioned file if this file has not changed, so it would indeed give you one copy of this file. Of course if you have modified the source file, it would keep the two if you can "go back".
If you don't want that kind of thing of time machine, you can actually do what you want with a programmed control. Some people use the robocopy command, but I'm not too familiar with it, and I prefer the simpler xcopy command. For example, this command copies all the files in the Documents folder on the hard disk in E:, overwrite files already on E: (so replace it with the latest version). The other options I used are described in the screenshot below:
xcopy C:\Users\Shawn\Documents /s /v/c/i/q/y/z per day
You can put this in Task Scheduler and tell him to repeat every night at 04:00 or something your backup is never more than one day old.
-
Can not understand ADF code example
Hi all
I am trying to learn the tutorial Oracle ADF, but I do not understand this loop:
public Integer getNextLineItem() {}
int maxLineNo = 0;
for (ServiceHistories
{:GetServiceRequests().getServiceHistoriesCollection())} SVH
If (svh.getLineNo ()! = null) {}
int testLineNo = svh.getLineNo () .intValue ();
If (testLineNo > maxLineNo) {}
maxLineNo = testLineNo;
}
}
}
return ++ maxLineNo;
}Hello
It is always best to display the required information, while displaying issues.
1. version JDeveloper.
2. the link to the tutorial that you use.The initial appearance, the code finds a row in the ServiceRequests table (as a collection) and gets the linenumber column. Check its value and returns the line COMP + 1 max.
Arun-
-
Can someone tell me how to set up an Airport Express Terminal to expand Network provided by my Fios router/modem without going through an airport as a base? I understand that apple does not support this use, but my applecare Advisor said it's possible. Thank you!
Unfortunately, your AppleCare Advisor is wrong if he or she has told you that an AirPort Express to extend wireless signal of a Fios router/modem.
Function of "Extend a wireless network" Apple is an exclusive feature that was designed by Apple engineers to extend the signal from another wireless only router from Apple. Thus, the AirPort Express... or any other router Apple besides... would not be able to extend wireless a Fios network.
SO... you have the possibility to locate the Airport Express where it is needed... And... Connect it to the Fios router/modem with a permanent, wired Ethernet cable connection, then the AirPort Express can 'extend' in this way.
Or... If you are ready to add a second AirPort Express, connect the first near Fios modem/router with an Ethernet cable, then the second Airport Express could extend the signal first Express wireless.
Another way to say the same thing, is that if you want an Apple AirPort router to extend wireless network... then you need two Apple routers to achieve this goal.
-
Last night, everything seemed normal. When I try to open Outlook Express, I get this message. "Outlook express could not be started. The application could not open message store outlook express. Your computer may be out of memory or your disk is full. Contact Microsoft Support for assistance. (0x800700C1, 193) "after this message, the message above was posted. I bought and ran a program called FixCleaner with the same results. I also cleaned my disk and more 66 G remains to use and have a lot of available memory.
Thank you all for your help, but I gave up and took it to my computer guru and fixed it. He said there where a few old accounts in the computer and registry was messed up and it solved the problem and now it works.
THANKS again!
-
Query Sub behavior strange when using Expressions regular Oracle
I met a strange "inconsistent" when you use an Expression regular Oracle with subqueries in SQL. Here are some details on how to reproduce what I have observed. We managed to find a solution to this "problem" using a database index; I'm writing this case hoping to better understand why Regular Expressions Oracle do not seem to work in the same way that the older, standard functions integrated as INSTR, SUBSTR, AS, etc..
Environment settings:
This test has been done using Oracle XE (GR 11, 2) on 32-bit Windows operating system. For my test, I used the HR schema (which is delivered pre-completed with the installation of this product) with some modifications of my own.
Make the Test objects:
To illustrate my test, I inserted mixed alphanumeric values and a null value in the column of my emp_id_char for good measure:create table hr.emp_test as select to_char(employee_id) as emp_id_char, employee_id as emp_id, first_name, last_name, hire_date from hr.employees;
* (1) this request fails once a nonnumeric value is inserted into the emp_test table.*insert into hr.emp_test (emp_id_char, first_name, last_name, hire_date) values ('XKCD123','TEST','LASTNAME',sysdate); insert into hr.emp_test (emp_id_char, first_name, last_name, hire_date) values (null,'TEST1','LASTNAME2',sysdate); commit;
* (2) this query works OK.*with sub1 as ( select to_number(emp_id_char) as emp_id, first_name, last_name, hire_date from hr.emp_test ) select * from sub1 where emp_id between 100 and 110
* (3) this query works OK.*with sub1 as ( select to_number(emp_id_char) as emp_id, first_name, last_name, hire_date from hr.emp_test where emp_id_char not like 'X%' ) select * from sub1 where emp_id between 100 and 110
* (4) this query Fails.*with sub1 as ( select to_number(emp_id_char) as emp_id, first_name, last_name, hire_date from hr.emp_test where instr(emp_id_char,'X',1) = 0 ) select * from sub1 where emp_id between 100 and 110
* (5) even down the results of the rational expression of 3rd under the query in sequential processing order also FAILS *.with sub1 as ( select emp_id_char, first_name, last_name, hire_date from hr.emp_test where regexp_instr(emp_id_char, '[^[:digit:]]') = 0 ), sub2 as ( select to_number(emp_id_char) as emp_id, first_name, last_name, hire_date from sub1 ) select * from sub2 where emp_id between 100 and 110 ERROR: ORA-01722: invalid number
* (6) that it does not like previous query as well *.with sub1 as ( select emp_id_char, first_name, last_name, hire_date from hr.emp_test where regexp_instr(emp_id_char, '[^[:digit:]]') = 0 ), sub2 as ( select to_number(emp_id_char) as emp_id, first_name, last_name, hire_date from sub1 ), sub3 as ( select emp_id, first_name, last_name, hire_date from sub2 ) select * from sub3 where emp_id between 100 and 110 ERROR: ORA-01722: invalid number
Our Solution...with sub1 as ( select to_number(emp_id_char) as emp_id, first_name, last_name, hire_date, regexp_instr(emp_id_char, '[^[:digit:]]') as reg_x from hr.emp_test where reg_x = 0), sub2 as ( select emp_id, first_name, last_name, hire_date, reg_x from sub1 where reg_x = 0 ) select * from sub2 where emp_id between 100 and 110 ERROR: ORA-00904: "REG_X": invalid identifier
Add a hint to the query of sup that 'hiding' the result of sub1 in memory. That did the trick. This suspicion resembles only viable workaround for this behavior. Other old built-in functions (INSTR, AS, etc.) an they were automatically following the execution plan (results of cache memory) that he had to use a 'hint' to force with the function of the regular expression.
The conclusion, which is what I would like to help to understand or explain is that:
If you create a series of queries/sup queries or inline views, values depend on "regular expression" type built-in sql functions do not seem to stick or maintain when implemented in complex query logic.
Any idea is appreciated!
Thank you!
Published by: 870810 on July 6, 2011 15:47870810 wrote:
I met a strange "inconsistent" when you use an Expression regular Oracle with subqueries in SQL.This is the expected behavior and has nothing to do with regular expressions - much less directly (I'll explain later). Main rule: there is no WHERE clause predicate order. Even if you use views, views online, subquery factoring, optimizer etc. can extend your display, display online, a subquery factoring. And it's Optimizer who decides the order of execution predicate unless you use the ORDERED_PREDICATES key. Now, I can explain. Regular expressions are powerful enough but also everywhere in life to pay for it with the higher cost of execution. That's why optimizer decides to apply emp_id between 100 and 110 first and regexp_instr (emp_id_char, "[^ [: digit:]]'") = 0 later.
explain plan for with sub1 as ( select emp_id_char, first_name, last_name, hire_date from emp_test where regexp_instr(emp_id_char, '[^[:digit:]]') = 0 ), sub2 as ( select to_number(emp_id_char) as emp_id, first_name, last_name, hire_date from sub1 ) select * from sub2 where emp_id between 100 and 110; SQL> @?\rdbms\admin\utlxpls PLAN_TABLE_OUTPUT ------------------------------------------------------------------------------------- Plan hash value: 3124080142 ------------------------------------------------------------------------------ | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | ------------------------------------------------------------------------------ | 0 | SELECT STATEMENT | | 1 | 57 | 3 (0)| 00:00:01 | |* 1 | TABLE ACCESS FULL| EMP_TEST | 1 | 57 | 3 (0)| 00:00:01 | ------------------------------------------------------------------------------ Predicate Information (identified by operation id): --------------------------------------------------- PLAN_TABLE_OUTPUT ------------------------------------------------------------------------------------- 1 - filter(TO_NUMBER("EMP_ID_CHAR")>=100 AND TO_NUMBER("EMP_ID_CHAR")<=110 AND REGEXP_INSTR ("EMP_ID_CHAR",'[^[:digit:]]')=0) 15 rows selected. SQL>
As you can see, optimizer uses a FULL SCAN to read data from the table and apply emp_id between 100 and 110 which translates TO_NUMBER ("EMP_ID_CHAR") > = 100 AND TO_NUMBER ("EMP_ID_CHAR")<=110. and="" obviously="" it="" fails="" trying="" to="" convert="" xkcd123="" to="" number.="" now="" cost="" of="" instr(emp_id_char,'x',1)="0" is="" lower="" and="" optimizer="" decides="" to="" apply="" instr="" first.="" therefore="" xkcd123="" is="" filtered="" out="" before="" to_number="" is="">=110.>
SQL> explain plan for 2 with 3 sub1 as ( select emp_id_char, first_name, last_name, hire_date 4 from emp_test 5 where instr(emp_id_char, 'X') = 0 ), 6 sub2 as ( select to_number(emp_id_char) as emp_id, first_name, last_name, hire_date 7 from sub1 ) 8 select * 9 from sub2 10 where emp_id between 100 and 110; Explained. SQL> @?\rdbms\admin\utlxpls PLAN_TABLE_OUTPUT ----------------------------------------------------------------------------------------------- Plan hash value: 3124080142 ------------------------------------------------------------------------------ | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | ------------------------------------------------------------------------------ | 0 | SELECT STATEMENT | | 1 | 57 | 3 (0)| 00:00:01 | |* 1 | TABLE ACCESS FULL| EMP_TEST | 1 | 57 | 3 (0)| 00:00:01 | ------------------------------------------------------------------------------ Predicate Information (identified by operation id): --------------------------------------------------- PLAN_TABLE_OUTPUT ----------------------------------------------------------------------------------------------- 1 - filter(INSTR("EMP_ID_CHAR",'X')=0 AND TO_NUMBER("EMP_ID_CHAR")>=100 AND TO_NUMBER("EMP_ID_CHAR")<=110) 14 rows selected. SQL>
The bottom LINE: With the help of strings to store non-chaine (numeric in your case) is never a good idea and shows design problems.
SY.
Maybe you are looking for
-
Portege M500 - cannot read overburned DVD + r
Hi all running a Toshiba Portege M500, WXP SP2, the v3.30 BIOS HomeMatsu * a DVD-RAM UJ-842 drive with firmware 1.01. My problem is that the drive will not read overburned DVD + r - reports "disk may be corrupted or using a format that is not compati
-
My Satellite L300-1dn does not connect to my router
A couple of months, I changed internet service providers and my laptop connects to the new router, even if he says that it is connected.I have to keep the ethernet connection is plugged in, and as soon as I take, I lose the connection. I did everythi
-
Cannot type the Alphabets in the VM in Y550
Hello I bought a Lenovo Y550 a year ago and its working well. Recently I installed the virtual machine on my system. I can not at the entrance of the alphabets in the virtual machine. It interprets the alphabets as numbers as 0,1,2... When I Windows
-
Connection a wireless printer HP Netbook (Windows XP).
I put up wireless a new Brother MFC-J265W printer to a desktop operations Dell Windows 7. It works fine, but I'm not working, how do I get my HP Netbook to be able to print to the printer. I've implemented 'Sharing' of the printer. Trying to ADD pri
-
How to configure the fax stored on a MFP FutureSmart to require a PIN code retrieve faxes?