dynamic control of would adopt does not work - what am I doing wrong
Oracle 10g versionDECLARE
v_sort VARCHAR2 (1000);
p_sort_obj WE_SORTOBJ_TAB
:= WE_SORTOBJ_TAB (WE_SORT_OBJ (1, 'full_name', 'DESC'),
WE_SORT_OBJ (2, 'p2g_score', 'ASC')) ;
BEGIN
FOR i IN 1 .. p_sort_obj.COUNT
LOOP
v_sort :=
v_sort
|| ', '
|| p_sort_obj (i).field_name
|| ' '
|| p_sort_obj (i).asc_desc;
END LOOP;
v_sort := TRIM (LEADING ',' FROM v_sort);
v_sql :=
'SELECT /*+ first_rows(100) */ total_pages, full_name, p2g_score '
|| ' FROM (SELECT ROWNUM rnum, a.* '
|| ' FROM ( SELECT CEIL(COUNT ( * ) '
|| ' OVER (PARTITION BY search_id) '
|| ' / :page_size) '
|| ' total_pages, '
|| ' a.* '
|| ' FROM client_history_tmp a '
|| ' WHERE search_id = :search '
|| ' ORDER BY :sort) a '
|| ' WHERE ROWNUM <= :page_no * :page_size) '
|| ' WHERE rnum >= (:page_no - 1) * :page_size ';
OPEN p_dataset FOR v_sql
USING p_page_size,
v_search_id,
v_sort,
p_page,
p_page_size,
p_page,
p_page_size;
END;
And when I run the above ProcI get follows him out put
DBMS_OUTPUTS
Sort Order : full_name DESC, p2g_score ASC
457,Michelle Hall,3-5
457,Jane G Confer,3-2
457,Elizabeth Fox,3-5
457,Geraldine Wiggins,4-0
457,Baby Boy Duda,4-0
457,Richard A Cobb,3-6
457,Timothy Dampier,3-3
457,Paul E Collins,3-5
457,Virginia R Kennedy,3-6
457,James T Ganger,4-0
Help, pleaseThank you
I think that the dynamic linking of the names of columns in the order by is considered a string rather than columns.
Try this,
DECLARE
v_sort VARCHAR2 (1000);
p_sort_obj WE_SORTOBJ_TAB
:= WE_SORTOBJ_TAB (WE_SORT_OBJ (1, 'full_name', 'DESC'),
WE_SORT_OBJ (2, 'p2g_score', 'ASC')) ;
BEGIN
FOR i IN 1 .. p_sort_obj.COUNT
LOOP
v_sort :=
v_sort
|| ', '
|| p_sort_obj (i).field_name
|| ' '
|| p_sort_obj (i).asc_desc;
END LOOP;
v_sort := TRIM (LEADING ',' FROM v_sort);
v_sql :=
'SELECT /*+ first_rows(100) */ total_pages, full_name, p2g_score '
|| ' FROM (SELECT ROWNUM rnum, a.* '
|| ' FROM ( SELECT CEIL(COUNT ( * ) '
|| ' OVER (PARTITION BY search_id) '
|| ' / :page_size) '
|| ' total_pages, '
|| ' a.* '
|| ' FROM client_history_tmp a '
|| ' WHERE search_id = :search '
|| ' ORDER BY '||v_sort||') a '
|| ' WHERE ROWNUM <= :page_no * :page_size) '
|| ' WHERE rnum >= (:page_no - 1) * :page_size ';
OPEN p_dataset FOR v_sql
USING p_page_size,
v_search_id,
p_page,
p_page_size,
p_page,
p_page_size;
END;
G.
Tags: Database
Similar Questions
-
HY, I used to use your adobe photoshop cs6 I have my laptop. some of the reasons for my laptop was not working, so I've restored my laptop. I have tried to reinstalled photoshop with old license No, but his does not work. what I would do.
Please return to the message sent to you.
-
Hi all
Need help
Hp5510 locked
I works fine when connected to my laptop - but-not when it is connected to Compaq Presario desktop mu
Software removal - tried reinstalling. Failed to install. printer Message "print spooler does not work - what's up."
↑ hanks
Scott
Consult HP printer experts found in the HP printer Forum.
-
HI, I have a sony vaio VGN-CR21S WHAT and I've upgraded to windows 7, but now my motion eye camera does not work what do I do, please quick help
all I need is someone find my phone on the Sony site and that will be a prettyhttp://eSupport.Sony.com/us/Perl/select-System.pl?Director=home&PRODTYPE=24
go to this site and to detect my model (vaio only)
-
My gmail does not work what do I do?
My gmail does not work what do I do?
Please visit the link for help below
http://www.Google.com/support/
or
http://mail.Google.com/support/
or
http://www.Google.com/support/forum/
I hope this helps
If this post can help solve your problem, please click the 'Mark as answer"If you find it useful, mark it as useful by clicking the 'Useful' button at the top of this message. Marking a post as answer, or relatively useful, you help others find the answer more quickly.
-
my built in webcam does not work.i one of my kids deleted some how and now it does not work what do I do
Hello
Try doing a system restore. Go to the SEARCH bar and type system restore.Once the System Restore screen, select a restore point (it must be before the problem occurred), launch it. Check.You can also update the drivers of your computer (the webcam driver). If you do not know how to locate, you can use RadarSync to find out-of-date drivers.David -
I loaded windows 8 and have a dvd matshita bd - mlt uj23oas in a sony viao and it player will not work what I do
Hello
Check this location of registry for Upper and Lower filters...
They will appear on the right after clicking on the location of Reg...
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\ {4d36e965-e325-11ce-bfc1-08002be10318}
Remove all entries found perhaps restore your disk, but can also cause something to stop working...
Maybe you can identify the program causing the problem with the name of the filter and update...
An example of this is iTunes... It uses a "GEAR" driver that can cause problems...
Install the most recent usually solves the problem...
-
I made pdf file and added the audio file as a file embedded using acrobat pro 8, it works fine on pc (windows) when I move to tab (android) the pdf file open but sound did not work. what I have to do to make it work
Adobe Acrobat for Android or iOS software currently play any sound or video.
-Dov
-
Select multiple channels for a single task - control and shift keys do not work
Hello
Following the advice of several other positions, I try to choose several physical channels in the drop-down list so that I can then use the function "unflatten channel channel" later. It seems that if I hold this key is pressed or cntrl, I should be able to select multiple channels in the list, however, this does not work for me. I tried to go in the "navigation key" property for the control channel to task, but there not all listed associations. Someone else has encountered this and found a solution? I previously around that by declaring several channels by a colon (for example, ai1:3), but it does not work for the unflatten function.
Thank you
Claire.
If I understand correctly, I think that you need to do is use a task property DAQmx. Try to use the channels property to get an array of strings.
-
M30 - buttons Mode Front and control Audio and video do not work
Hello
Front Mode and Audio/video control buttons do not work
Any ideas?
Thank you
Hello
As far as I know the Toshiba utility controls is responsible for the use of the key.
Have you tried to install Toshiba controls?
See the page of the Toshiba driver for this driver.Good bye
-
I can't get updates because of the validation process does not work, what can I do?
I just formatted my hard drive and need to update my windows xp sp2. i cant get thru because of the genuine validation process that does not work. What can I do next to buy an apple product...
Hello
· What is the brand and model of the computer?
· You get the error message?
See this Microsoft KB article and check if it helps to resolve the issue.
Windows Genuine Advantage does not validate a copy of Windows XP
http://support.Microsoft.com/kb/916247
See also:
How to activate Windows XP
-
Find missing files does not work - what don't get me?
I have had my photos stored on an external hard drive and upgraded to a bigger external drive. My husband has copied the files to the new drive. Now I can't access photos on the drive. I followed the steps to update the location of the pictures, but it does not work. I tried "find lack of pictures" and that does not work either. I follow the steps, but nothing happens.
What I am doing wrong? I suspect, I'm missing a simple step, but I tried several times with both drives. I restarted LR. I restarted the computer. Nothing makes no difference.
Thanks for any help or someone can give advice.
Hi nannetter,
Please connect the new external drive that contains all of the images, now open Lightroom and on the Library tab, update the location of the folder.
See the link below.
How to find missing photos in Photoshop Lightroom
Note: Please make sure that copy you all images in the structure of the last hard drive to the new.
Kind regards
Mohit
-
does not work what does this analysis of stabilization of bend - average stabilizer
on a short clip 10 seconds without effects, I get this msg
stabilizer chain does not work with the transformations of the collapse
What this means, anyone know - thank you
Todd you linked to a page of information about the switch.
In addition, why you ask first? It is a question of AE.
-
the bluetooth on my laptop does not work what do I do?
I need help to get my bluetooth to work what do I do?
Please check do you Bluetooth connectivity on this note Book...
to check go initially to characters just look in Device manager and see will it do u hav a driver bluetooth
or else you just help me with your product details
-
Reader of PDF in Firefox does not work, what should I do?
Firefox does not open PDF files. The tab remains empty and the PDF file does not open. He continues to display a dialog box saying 'Open' and 'Save', but it never opens.
No, not open with Firefox, you must select the "Preview in Firefox" on the Options page. If Firefox does not follow that the server cannot send ' application/pdf' as content type. A test, you want to try this link:
http://www.jeffersonscher.com/GM/Google-hit-Hider-by-Domain_About_v160.PDF
(My apologies for the typo in the original post's fault!)
Maybe you are looking for
-
HelloI have a laptop Toshiba Satellite T130. I reinstalled (and re-enabled) Win7 x 64. There are four registry patchesLink: [regpatch - 20091111092833.zip | http://www.toshiba.eu/innovation/download_driver_details.jsp?service=EU&selCategory = 2 & sel
-
Library of nivision - imaqMakeRect: access violation writing location
I am writing a script of image acquisition using the nivision and libraries niimaqdx in python 2.7 using types. When I use the imaqMakeRect function to make a Rect structure to be used in the imaqImagetoArray function, I get a write error access viol
-
I can't record to operators
-
Difficulties of username and password. In Windows Mail I suddenly wonder for the user name and password. I fill them but receive no mail from mu. I get the message: Account: 'pophost1.classicfm.net', server: 'pophost1.classicfm.net', Protocol: POP3
-
Bookmarking in browser crashes the browser to empty bookmark dialog box!
Someone at - it see this one! I deleted the history, cache and all my favorite. If I call any page and try to bookmark, I get hooked to an empty bookmark - no page info dialog, cannot select icon! Cannot cancel or save or anything - I leave the brows