Can Order By Clause be used on a Text Column to Sort the Data????
Hello There,
I am trying to sort the code generated by the PL/SQL Package..I mean the procedures inside the package should be ordered in a ascii collating
sequence..(A to Z)..
Could I get a help to perform this.......
look like you have a nasty teacher,
this might give you an idea :
select
LINE, TEXT
from
user_source
where
NAME = 'YOUR_PACKAGE_NAME'
and TYPE = 'PACKAGE BODY'
and substr(ltrim(upper(text)) , 1 , instr(ltrim(text) || ' ' , ' ' , 1 ) - 1) in ('PROCEDURE' , 'FUNCTION')
Similar Messages
-
Why can't i see documents using adobe reader even though I have the most updated version?
Why can't I see documents using adobe reader even though I have the most updated version?
Hi lawalton,
Please tell me a bit more--what happens when you try to open your files in Reader? Are you getting an error message? Do they open, but don't display correctly?
I look forward to hearing back from you so we can get this mystery sorted out.
Best,
Sara -
How can i read the text files and buffer the data in Vector?
hi. I have been running into this problem for days, but with no luck and losing right direction.
The problem is : I am trying to read a text file and buffer the data into a
Queue for each user.
the sample text file is as below:( 1st column is timestamp, 2nd is user_id, 3rd is packet_id, 4th is packet_seqno, 5th is packet_size)
0 1 1 1 512
1 2 1 2 512
2 3 1 3 512
3 4 1 4 512
4 5 1 5 512
5 6 1 6 512
6 7 1 7 512
7 8 1 8 512
8 9 1 9 512
9 10 1 10 512
10 1 2 11 512
11 2 2 12 512
12 3 2 13 512
13 4 2 14 512
14 5 2 15 512
15 6 2 16 512
16 7 2 17 512
17 8 2 18 512
18 9 2 19 512
19 10 2 20 512
20 1 3 21 512
21 2 3 22 512
22 3 3 23 512
23 4 3 24 512
24 5 3 25 512
25 6 3 26 512
26 7 3 27 512
27 8 3 28 512
28 9 3 29 512
29 10 3 30 512
30 1 4 31 512
31 2 4 32 512
32 3 4 33 512
33 4 4 34 512
34 5 4 35 512
35 6 4 36 512
36 7 4 37 512
37 8 4 38 512
38 9 4 39 512
39 10 4 40 512
40 1 5 41 512
41 2 5 42 512
42 3 5 43 512
43 4 5 44 512
44 5 5 45 512
45 6 5 46 512
46 7 5 47 512
47 8 5 48 512
48 9 5 49 512
49 10 5 50 512
50 1 6 51 512
51 2 6 52 512
52 3 6 53 512
53 4 6 54 512
54 5 6 55 512
55 6 6 56 512
56 7 6 57 512
57 8 6 58 512
58 9 6 59 512
59 10 6 60 512
60 1 7 61 512
61 2 7 62 512
62 3 7 63 512
63 4 7 64 512
64 5 7 65 512
65 6 7 66 512
66 7 7 67 512
67 8 7 68 512
68 9 7 69 512
69 10 7 70 512
70 1 8 71 512
71 2 8 72 512
What I wanna do is to read all the data above and buffer them in a queue for each user( there are only 10 users in total).
I already created a class called Class packet:
public class packet {
private int timestamp;
private int user_id;
private int packet_id;
private int packet_seqno;
private int packet_size;
/** Creates a new instance of packet */
public packet(int timestamp,int user_id, int packet_id,int packet_seqno, int packet_size)
this.timestamp = timestamp;
this.user_id=user_id;
this.packet_id=packet_id;
this.packet_seqno=packet_seqno;
this.packet_size=packet_size;
}then I wanna to create another Class called Class user which I can create a queue for each user (10 users in total) to store type packet information. the queue for each user will be in the order by timestamp.
any idea and sample code will be appreciated.Doesn't sound too hard to me. Your class User (the convention says to capitalize class names) will have an ArrayList or Vector in it to represent the queue, and a method to store a Packet object into the List. An array or ArrayList or Vector will hold the 10 user objects. You will find the right user object from packet.user_id and call the method.
Please try to write some code yourself. You won't learn anything from having someone else write it for you. Look at sample code using ArrayList and Vector, there's plenty out there. Post in the forum again if your code turns out not to behave. -
Getting an error when using adobe photoshop CC, "Could not move the data because of a program error". Any idea on what this means?
Have no idea of what you were even doing in Photoshop my crystal ball is out for repairs so I can not see.
-
How to use DS's text processing to parsel the text data stored in DB table?
I want to use DS's text processing to parse the text data stored in a database table, but all the demo I see is parsing text from a flat file. I tried with the blueprint sample and edit the input from a flat file to database table, but can not map the column with the base entityExtraction. anyone can give me a guide or example? thanks so much!
regards,
BinStill looking for some ansewers. Can any one help me?
-
How to place two different indesign documents side by side on my desktop in order to copy and paste images and text from one to the other?
Or choose Window > Arrange > Tile
And, you of course can copy/paste without tiling. -
Can clicking on column heading sort the column contents instead of drill in
I have a pivot table with data that the client doesn't want to drill into. Instead, they want to be able to click the column heading and have the pivot table re-sort the data in the table based on the data in that column. Is that possible, or are clickable column headings only used for drilling in OBIEE? Thanks.
Madan -
That seems like a feature that should be added to the Pivot Table view if they are going to have it in the Table View. Still, thanks for pointing out the "Enable column sorting in Dashboards" check box in the Table view. I'll see if I can either get this data into the Table view, or at least let the client know the limitations of OBIEE.
Thanks again.
Daniel -
Unable to print e-mail messages from my Mac book pro directly to my HP ink jet printer. Can print from Word, Excel, Safari. E-mail messages only print the date And "sent to" name, the remainder is blank.
If you haven't done so already, try resetting the printing system.
Reset Printing System -
Using Javax.print I have to print the data which are stored in resultsets.
Using Javax.print I have to print the data which are stored in resultsets.
Actually we ar working on a project where n numbers of records are fetched from database and stored in Resultsets. We made JSF pages which displayes the records in Web Browser.
There is a link in that page. If we click that print link, It has to be printed all the records row by row using javax.print. It should act like Printer friendly in browser.
Kindly send us any example code to proceed.Is it possible to access the cache datasource inside the script component which is available in the same data flow task??
Thanks in advance,
Saravanan -
Problem with group by/order by clause when using huge data
Hi,
I'm using below query on my table of size more than 210 million rows.
SELECT booking_date FROM T_UTR
WHERE four_eyes_status = 'A' AND booking_date <= '01-jul-2005' AND booking_date >= '01-jan-2004'
AND invoice_id IS NULL AND link_id = 12345
AND billing_indicator = 'L'
GROUP BY booking_date ORDER BY booking_date
If I'm skipping last line "GROUP BY booking_date ORDER BY booking_date", its giving me immediate result, but, because of group by/order by, the query may take 30 seconds to 2 minutes based on the data fetched for the date range. It may vary from 2 to 2 million rows, & grouping by for so many rows at run time will automatically take some time.
Here I want to know, is there any procedure in oracle(any function based index) so that I can store/retrieve distinct values for link_id, & booking_date without grouping them at run time. Or the performance of the query can be increased
Thanks
DeepakHi,
You can use Materialized Views as stated earlier - specifically by using Query Rewrite. If the conditions on columns "four_eyes_status", "invoice_id", and "billing_indicator" never change in your query - then you can create a Materialized View that is targeted for those conditions and has lower cardinality (since you aren't grouping by those columns). The "COUNT(*)" allows the use of the DISTINCT operator in addition to "GROUP BY' as well for Query Rewrite.
Create the Materialized View like this:
CREATE MATERIALIZED VIEW test_mv1
BUILD IMMEDIATE
USING NO INDEX
REFRESH FORCE ON DEMAND
ENABLE QUERY REWRITE
AS
SELECT booking_date
, link_id
, COUNT(*) AS count_star
FROM T_UTR
WHERE four_eyes_status = 'A'
AND invoice_id IS NULL
AND billing_indicator = 'L'
GROUP BY booking_date
, link_id ;To improve performance further - create an index on the "LINK_ID" column like this:
CREATE INDEX test_mv1_link_id_idx
ON test_mv1 (link_id);Then - gather stats immediately on the Materialized View so that the CBO can use it for rewriting your original query - like this:
BEGIN
DBMS_STATS.gather_table_stats (ownname => USER
, tabname => 'TEST_MV1'
, partname => NULL
, estimate_percent => DBMS_STATS.auto_sample_size
, block_sample => FALSE
, method_opt => 'FOR ALL COLUMNS SIZE 1'
, degree => NULL
, granularity => 'ALL'
, cascade => TRUE
, no_invalidate => FALSE
END;
/Now - the CBO should be able to rewrite your original query to use the Materialized View - provided you set up your session for Query Rewrite like this:
ALTER SESSION SET query_rewrite_enabled = TRUE;
ALTER SESSION SET query_rewrite_integrity = ENFORCED; -- set this to whatever staleness you can tolerate - see the docs for details...Now - after setting up your session - try running your query with autotrace to see if it was rewritten...
Good luck!
Message was edited by:
PDaddy -
As the title says, my previous macbook broke, and now I have a new computer...PC :/ and I can't sync my iphone 4s to the computer properly wihtout losing the data on the iphone. It says i have to wipe my iphone.
Only iTunes content and any photos transferred from the computer that was used for syncing the iPhone.
Transfer your iTunes library from your computer's backup which should include other important data such as documents and photos, etc. -
Can my photoshop subscription be used on more than one laptop at the same address
am i able to use photoshop/lightroom on 2 laptops at the same address with my subscription
You can install on two computers for your own personal use; but not for use at the same time, and not for sharing with colleagues or family.
-
How to specifically sort the data in a database using c#?
H!,
I have a problem in c# that require sorting of names of students in a sql database and i want it to be specific, i used data grid view to view the data of the students as shown below:
Students First Name:
Ann
Antoinette
Brenda
Judith
Lester
Santos
Suzie
Tim
if i type in a letter or abbreviation @ a textbox1 for example "s", all Names that starts with letter s will be sorted first so the output now of the query will become:
Students First Name:
Santos
Suzie
Ann
Antoinette
Brenda
Judith
Lester
Tim
So if i type j, all that starts with j will be first, and so on.
I need help for this problem coz it is so hard for me to output the students with this kind of sorting and is there a code or query string related to this problem?
thanks in advance.
HardzHi,
One way is to write a query as shown below:
declare @char nvarchar(1)
select @char = 'S'
Declare @t table(name nvarchar(max))
insert into @t
values
('Santos'),
('Suzie'),
('Ann'),
('Antoinette'),
('Brenda'),
('Judith'),
('Lester'),
('Tim')
select name
from @t
where RIGHT(name,1) like @char
union all
select name
from
(select top 100 percent name
from @t
where RIGHT(name,1) not like @char
order by name) a
Hope this helps.
-Chintak -
Help in sorting the data using Rank
Hello Experts
I am having trouble in selecting the record which is one less than the maximum rank Please see the desired results part.
I am trying using the Rank or Dense_rank but I could not.
Please help in solving this issue.
The Oracle version I am working on is
Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Thanks
RB
with t as
SELECT 29951 SOURCE_ID,'03/4/2013' CREATE_DATE, 'AAAA' NAME FROM DUAL UNION ALL
SELECT 29951 SOURCE_ID,'03/11/2013' CREATE_DATE, 'BBBB' NAME FROM DUAL UNION ALL
SELECT 29951 SOURCE_ID,'03/21/2013' CREATE_DATE, 'CCCC' NAME FROM DUAL UNION ALL
SELECT 29952 SOURCE_ID,'03/14/2013' CREATE_DATE, 'SSSS' NAME FROM DUAL UNION ALL
SELECT 29952 SOURCE_ID,'03/4/2013' CREATE_DATE, 'TTTT' NAME FROM DUAL UNION ALL
SELECT 29952 SOURCE_ID,'03/24/2013' CREATE_DATE, 'PPPP' NAME FROM DUAL UNION ALL
SELECT 29953 SOURCE_ID,'03/01/2013' CREATE_DATE, 'MMMM' NAME FROM DUAL UNION ALL
SELECT 29953 SOURCE_ID,'03/11/2013' CREATE_DATE, 'RRRR' NAME FROM DUAL UNION ALL
SELECT 29954 SOURCE_ID,'03/24/2013' CREATE_DATE, 'WWWW' NAME FROM DUAL
SELECT row_number() over (PARTITION BY source_id ORDER BY SOURCE_ID,create_date ) rank, source_id,create_date
FROM t
SOURCE_ID CREATE_DATE NAME
29951 03/11/2013 BBBB
29952 03/14/2013 SSSS
29953 03/1/2013 MMMM
29954 03/24/2013 WWWWselect source_id,create_date,name
from (
SELECT row_number() over (PARTITION BY source_id ORDER BY create_date ) rank, source_id,create_date,name
FROM t
where rank = 1
Perhaps you want to handle the dates as dates.
Do you want the first or the second rank?
Could there be equal create_dates in one partition?
What do you expect as second for source_id=29954?
select source_id,create_date,name
from (
SELECT row_number() over (PARTITION BY source_id ORDER BY to_date(create_date,'MM/DD/YYYY') ) rank, source_id,create_date,name
FROM t
where rank = 2
SOURCE_ID
CREATE_DATE
NAME
29951
03/11/2013
BBBB
29952
03/14/2013
SSSS
29953
03/11/2013
RRRR
Ah, now i see, you want descending order
select source_id,create_date,name
from (
SELECT row_number() over (PARTITION BY source_id ORDER BY to_date(create_date,'MM/DD/YYYY') desc ) rank, source_id,create_date,name
FROM t
where rank = 2
Finally i might have understood
with t as
SELECT 29951 SOURCE_ID,'03/4/2013' CREATE_DATE, 'AAAA' NAME FROM DUAL UNION ALL
SELECT 29951 SOURCE_ID,'03/11/2013' CREATE_DATE, 'BBBB' NAME FROM DUAL UNION ALL
SELECT 29951 SOURCE_ID,'03/21/2013' CREATE_DATE, 'CCCC' NAME FROM DUAL UNION ALL
SELECT 29952 SOURCE_ID,'03/14/2013' CREATE_DATE, 'SSSS' NAME FROM DUAL UNION ALL
SELECT 29952 SOURCE_ID,'03/4/2013' CREATE_DATE, 'TTTT' NAME FROM DUAL UNION ALL
SELECT 29952 SOURCE_ID,'03/24/2013' CREATE_DATE, 'PPPP' NAME FROM DUAL UNION ALL
SELECT 29953 SOURCE_ID,'03/01/2013' CREATE_DATE, 'MMMM' NAME FROM DUAL UNION ALL
SELECT 29953 SOURCE_ID,'03/11/2013' CREATE_DATE, 'RRRR' NAME FROM DUAL UNION ALL
SELECT 29954 SOURCE_ID,'03/24/2013' CREATE_DATE, 'WWWW' NAME FROM DUAL
, ranks as (
SELECT
row_number() over (PARTITION BY source_id ORDER BY to_date(create_date,'MM/DD/YYYY') desc ) rank
,source_id
,create_date
,name
FROM t
select
source_id
,create_date
,name
from ranks r
where rank =
case
when (select count(*) from ranks where source_id = r.source_id) = 1
then 1 else 2
end
SOURCE_ID
CREATE_DATE
NAME
29951
03/11/2013
BBBB
29952
03/14/2013
SSSS
29953
03/01/2013
MMMM
29954
03/24/2013
WWWW
Message was edited by: chris227 extended -
How to sort the data in JSP using stylesheet sorting?
Hi, i extracted data out in and display them <%=data%> in the jsp, but how to sort? do i have to provide a drop down list that gives different sorting options, and when user clicks on one option, say sort by title, the collection of results are sorted out on the same jsp page? so all in all, only one jsp page is needed or do i need to create xml files, etc?
i have no idea how to integrate the xml sorting into the jsp page, even after seeing online help, cos there is no example of a jsp page with sorting to refer to. PLease help, thanks alot!im getting the data from beans, but one of the requirements was that i cant use the database to sort and display but i have to use xslt to do the sorting in the jsps, so i have no idea how to do so. possible to give an example? thanks
Maybe you are looking for
-
So, if R wants to sync her iphone 5C but still have L pay for it on the family plan, can R just get her own itunes account for buying music and apps? Or is she stuck using L's account?
-
FM for adding/deleting partner functions
Hello everyone, Is there an Fm to add/delete partner functions of customer.I am not sure whether sd_partner_single_modify works.Can anyone confirm this or post other FM which does this. Thanks in Advance, Kiran
-
Hi All, I am authoring a DVD and have a need for four menus - PAL 4:3, PAL 16:9, NTSC 4:3, and NTSC 16:9. Does anybody have a good workflow for creating the menus in Photoshop? I'd like all menus to look as close as possible to each other but still h
-
Option to move files rather than to copy them in "consolidate Project"
The option to move files rather than to copy them in "consolidate Project" seems to be missing in LPX. Bummer. Am I missing something?
-
IPad 2 photo streaming empty folder
I can't see photo on my iPad at all in photo stream folder, when I switch off and on the iPad than it appears but 5 min than disappear again :( pls help me if u know what I should do. Thx