Sort in a Query as a Webservice ?
Hi everyone,
I can't manage to apply a sort filter in a query as a webservice, is there a way to do it ? We are using BO XI R2 with webi.
thank you.
Sebastien
Hi Alan,
thank you for your reply. I can also do that in the Webi / infoview control panel, but I am talking of applying a sort in a query built with the "query as web service wizard".
Do you say that in this wizard you can apply sorts ? I don't have any right click function on the objects in this part of the interface.
thank you.
Sebastien
Edited by: Sebastien Anezo on Jan 7, 2009 4:28 PM
Similar Messages
-
Applying sort to a query returned by a stored procedure
I am looking for some advice on the best approach for applying a dynamic sort to a query returned by a stored procedure.
We have a stored procedure that has 3 inputs fields which are used to specify sort columns and it has an additional 3 fields to indicate if the corresponding input column is to be sorted in ascending or descending order. We presently accomplish this by using dynamic SQL in the procedure but this approach has some drawbacks. Ideally we would like these queries to compile just like any other cursor. We have tried using decodes but this does not seem practical or easy to maintain.
This procedure is used by a web application that allows the user to click on a column header to specify their sort preference. The previous sort selection becomes the second sort field and the one before that the third.
Your advice is much appreciated!I see, so you want to be able to sort by "name desc, age asc, salary asc", for example.
there is no built in option. it's either dynamic sql, or decodes.
the decodes could still work, with only 6 lines, but the problem is handling mixed data types. I'll stick with sort col of 1=name (char), 2=number_col, 3=date_col
order by
decode(sort_order1, 'A', decode (sort_col1, 1,name_col, 2,to_char(number_col,'9999999999.00000'), 3,to_char(date_col,'yyyymmddhh24miss'), 'X'),'X'),
decode(sort_order1, 'D', decode (sort_col1, 1,name_col, 2,to_char(number_col,'9999999999.00000'), 3,to_char(date_col,'yyyymmddhh24miss'), 'X'),'X') DESC,
decode(sort_order2, 'A', decode (sort_col2, 1,name_col, 2,to_char(number_col,'9999999999.00000'), 3,to_char(date_col,'yyyymmddhh24miss'), 'X'),'X'),
decode(sort_order2, 'D', decode (sort_col2, 1,name_col, 2,to_char(number_col,'9999999999.00000'), 3,to_char(date_col,'yyyymmddhh24miss'), 'X'),'X') DESC,
decode(sort_order3, 'A', decode (sort_col3, 1,name_col, 2,to_char(number_col,'9999999999.00000'), 3,to_char(date_col,'yyyymmddhh24miss'), 'X'),'X'),
decode(sort_order3, 'D', decode (sort_col3, 1,name_col, 2,to_char(number_col,'9999999999.00000'), 3,to_char(date_col,'yyyymmddhh24miss'), 'X'),'X') DESC,Message was edited by:
shoblock
forgot to make 3 asc/desc variables -
Implementing Interactive Reports Sorts in Report Query
My users love how the Interactive Reports work, especially being able to choose their sort fields. I have an Report Query that can use multiple sorts and many sort fields (chose from APEX page). Is it possible to implement this type of thing in the Report Query (without using decodes or dynamic SQL).
I looked at the code being executed by Interactive Reports and can see the order by changing
select
null as apxws_row_pk,
"CODE",
"CITY_NAME",
"STATE_CODE",
"PK_ID",
count(*) over () as apxws_row_cnt
from (
select * from (
select "PK_ID",
"CODE",
"CITY_NAME",
"STATE_CODE"
from "#OWNER#"."ZIP"
) r
) r where rownum <= to_number(:APXWS_MAX_ROW_CNT)
order by "CODE"Ben, Not sure I follow.
I'm passing in the column names of the order by's from my APEX page to the DB function. Right now I'm doing a huge case statement for each one.
FUNCTION get_student_demographic (l_user in varchar2,
l_owner in varchar2,
l_report_order1 in varchar2,
l_report_order2 in varchar2,
l_report_order3 in varchar2,
l_report_order4 in varchar2,
SELECT (CASE l_report_order1
WHEN '%null%' THEN ''
WHEN 'LAST_NAME' THEN A.LAST_NAME
WHEN 'FIRST_NAME' THEN A.FIRST_NAME
..... many more
ELSE ''
END ) report_order1, -
Hi,
While generating a BEx report, we applied sorting to the column.
When I run query in BEx analyzer the sequence of the columns is fine, but when I run the same query through the portal, the sorting applied to the query is not working.
Do you have any idea why such a thing happens?
ThanksHi,
The note (1256102) I sent you in my last response is valid for the java runtime. Have you already checked whether this note solves this issue? Please also let us know which Support Package you are on and which patchlevel you are using for the bi java components BI-BASE-S and BIWEBAPP.
Best regards,
Janine -
Hello,
Can someone write an sql query using fieldname and table to sort.
I am using the Database Connectivity Toolset and I believe I am able to query using sql but I am not sure about the syntax for sorting.
I looked it up, but I am coming up with an error when implementating it in my vi.
Thanks.Thanks for helping. I appreciate your input and time.
I have attached what I have seen and it does not show the sql query although I have done as you suggested.
I have also pasted a little of the table: jenny and the fields that I am sorting in ascending and descending order by sql.
Message Edited by roboticstudent on 03-09-2006 10:05 AM
Attachments:
Jenny.doc 279 KB -
Sort in the query (7.0)?
Hi Experts,
In the query it is sorting by Document number. I changed the properties of the individual characteristic to sort by posting date. But it is not working any idea?
Thanks in advance.
Sharat.Can anybody answer this question?
Thanks. -
All,
I'm trying to display "Mon" (i.e. Jan, Feb, Mar, ...), but sort by "MM" (i.e. Mar, Apr, May) but am having issues with the query. This is the query I'm trying to run:
<pre>
select null link, to_char(date_created, 'Mon'), count(applicant_id)
from applicant
group by null, to_char(date_created, 'Mon')
order by to_char(date_created,'MM')
</pre>
Looking for some advice on how to sort by the cardinal month value while displaying the month name value.
Thanks.One solution would be:
select null link, createdate, cnt
from ( select to_char(date_created,'MM') sortdate, to_char(date_created, 'Mon') createdate, count(applicant_id) cnt
from applicant
group by to_char(date_created,'MM'), to_char(date_created, 'Mon')
order by sortdate -
Hi All,
I know that we can use webservice to query BW Data. My only doubt here is that how do we restrict only certain user groups to access that webservice.
In other words how is the authentication and authorization done on these exposed webservices. Any pointers/documentation or sample java code is highly appreciated.
Thanks in advance,
Ankurif you are still looking for an answer let me know.
Raja -
How to remove Sorting Option in Query's Report
Hi All,
When i try to run a Query in Enterprise Portal, I'm getting a " Sorting option" in each column. Thats not needed in a Report.
Kindly suggest me How to remove that Sorting options from Each colum header.
Thanks in Advance.
Regards,
Jayaprakash Jayachandran.Hi
Keep the cursor on that characteristics in the navigation pane, right click>Characterisitcs>properties>Sorting-> change the option as you like..
Else go to Query designer...GO to DISPLAY tab>under SORTING> set it as AS IN THE QUERY
hope this helps
Thanks
BI Learner -
Any way to set the sort order other than in the query?
The report has an OrderBy parameter so the user can select which field is used for sorting. The query has an OrderBy clause referencing the parameter. The problem is that it doesn't always pay any attention to the parameter. (Since it appears to be intermittent my suspicion is that it really never pays any attention to it but that sometimes whatever actually is determining the order gives the same results.)
The problem is that putting an OrderBy clause in a query is the only way I know of to determine the output order of a report. Is there any other way?
Thanks.Unfortunately Break Order doesn't seem to be controlling the sort order. I found that the value was set on numerous fields but I've changed them all to None & it still isn't displaying in the order specified by the OrderBy parameter.
Note that this is a 'form layout' report with one page/record so it doesn't really have columns-but the pages are supposed to be printed in the order chosen by the user from a list of values. It doesn't seem to matter what's selected from that list though, the output appears in the same order as if no Order By clause is specified.
Can you think of anything else that would cause the report to ignore the order by clause?
thanks. -
Functionality to determine/change the sort oreder of a query in Webi and CR
Hi
Does Business Objects Web Intelligence have the functionality to
determine/change the sort order of a query, or does it always push down
the order by into the database and have the database do the sorting? The
background to my question is particularly multi-byte characters (e.g.
Japanese or Chinese characters).
What about the feature in Crystal Reports product?
Regards
NishaThe sort order of the query is completely irrelevant to reports, which default to sorting by columns on a left to right basis.
The only reason to sort in a query is where you are restricting the number of rows returned and want the top n rows. -
Some Sorting Related Query I am facing....
I have a class
Period
DateAndTime DT; // DT is a member variable
There can be multiple instances of class Period...I am maintaing
a vector for storing multiple objects...After vector is populated, I have
to sort these Period objects (on DateTime-wise)...(I have to line them
up so that they are in ascending order time-wise)
I want to add the objects in vector in Sorted-way only, so that I don't have
to iterate the Whole vector again.....I don't need to do the comparison of DateAndTime of
Each object with other and then populate the collection again..
How can achieve it.
That when a new object comes, I put it into the right place
depending upon DateAndTime field.....
I am open to use any other Collection object (other than Vector)..
Please give me suggestions...
collectionhi,
I have done the following:-
class Period implements Comparable
Calender startTime;
public int compareTo(Object obj) throws ClassCastException
if (!(obj instanceof Period))
throw new ClassCastException("A Period object expected.");
Period prd = (Period)obj;
if (startTime.before(prd.startTime)
return -1;
else if (startTime.after(prd.startTime)
return 1;
else
return 0;
ArrayList list = new ArrayList();
addObjectsInList(Period prd)
list.add(prd);
sortObjectsInList()
Collections.sort(list);
My Query is
1) Where should I do handling for ClassCastException..
In my case, no other type of object would come, but still
I have added the check for ClassCastException....
Is it mandatory to have this check or can I leave that
I have seen many examples of CompareTo on threads in forum/as well as net...where no check has been done for ClassCastException...
What should I do....Should the exception handling be done
while I am adding the objects in List or sorting them?
2) Is there anything else, I need to take care while
implementing Comparable interface... -
Hi all
I create matrix report( in version 9i)
I want sort columns of report
when i use order by it sort rows but i want sort columns
my query is like this:
SELECT
Code,
name,
DECODE(cons_code, '1', 'A',
'2', 'B',
'3','C',
'4', 'D',
'5', 'E') Activity,
SUM(amnt) amount
From Mytable
Where ....
group by
Code,
DECODE(cons_code, '1', 'A',
'2', 'B',
'3','C',
'4', 'D',
'5', 'E')
my group base on code
my columns base on Activity
and cells are Amount
my report result is:
........ B E D A C
name1 1 1 1 1 2
name2 3 4 8 6 1
I want this :
........ A B C D E
name1 1 1 1 1 2
name2 3 4 8 6 1
....Hello,
How about this?
SELECT Code, name,
DECODE(cons_code, '1', 'A', '2', 'B', '3','C', '4', 'D','5', 'E') Activity, SUM(amnt) amount
From Mytable
WHERE ....
GROUP BY Code, name, DECODE(cons_code, '1', 'A', '2', 'B', '3','C', '4', 'D', '5', 'E')
ORDER BY code, DECODE(cons_code, '1', 'A', '2', 'B', '3','C', '4', 'D', '5', 'E') -
hello all,
i have a two tables called item and order, and i have a form on order.
the table item is having itemid & itemname
the table order is having orderid, itemid & qty
in the order form when the user executes the query the data has to be displayed in asc. order of Itemname, not on itemid
the order forms is having database fields orderid,itemid,qty and non database field itemname
how to do this....?
thanks in adv
KrisYou can use Query From clause to base your block on instead of a table based block, or even create a view and base your table on the view.
This way you can include your column in the block and do the sort, or do the sort in the query itself.
Regards,
Tony -
FS - Error code 3006 from SQL-Query
Hello world!
Can someone inform me which possible errors in a query cause the following error message after the query is activated?
Internal Error (3006) Message [131-183]
Until now I had only error code 1003, which signals syntax errors etc. in the query.
By the way: Does anywhere exists a list of error codes/messages occuring in SAP B1?
Thank you!
Frank RomeniError codes and their description can be found in SDK help files
I have pasted them below for your ref
-39
End of File
-43
File not Found
-47
File is Busy
-50
File Cannot Open
-51
File Corrupted
-99
Division by Zero
-100
Out of Memory
-101
Print Error
-103
Print Canceled
-104
Money Overflow
-111
Invalid Memory Access
-199
General Error
-213
Bad Directory
-214
File Already Exists
-216
Invalid File Permission
-217
Invalid Path
-1001
Data Source - Bad Column Type
-1003
Data Source - Alias Not Found
-1004
Data Source - Value Not Found
-1005
Data Source - Bad Date
-1012
Data Source - No Default Column
-1013
Data Source - Zero/Blank Value
-1015
Data Source - Integer Overflow
-1016
Data Source - Bad Value
-1022
Data Source - Other File Not Related
-1023
Data Source - Other Key Not In Main Key
-1025
Data Source - Array Record Not Found
-1027
Data Source - Value Must Be Positive
-1028
Data Source - Value Must Be Negative
-1029
Data Source - Column Cannot be updated
-1100
Data Source - Cannot Allocate Environment
-1101
Data Source - Bad Connection
-1102
Data Source - Connection Not Opened
-1103
Data Source - DB Already Exists
-1104
Data Source - Cannot Create Database
-1200
Data Source - Data Bind General Error
-2001
Data Source - Bad Parameters
-2003
Data Source - Too Many Tables
-2004
Data Source - Table Not Found
-2006
Data Source - Bad Table Definition
-2007
Data Source - Bad Data Source
-2010
Data Source - Bad Data Source Offset
-2013
Data Source - No Fields In Table
-2014
Data Source - Bad Field Index
-2015
Data Source - Bad Index Number
-2017
Data Source - Bad Alias
-2020
Data Source - Bad Alias
-2022
Data Source - Bad Field Level
-2024
Data Source - Not Matching Data Source
-2025
Data Source - No Keys In Table
-2027
Data Source - Partial Data Found
-2028
Data Source - No Data Found
-2029
Data Source - No Matching Field
-2035
Data Source - Duplicate Keys
-2038
Data Source - Record Lock
-2039
Data Source - Data Was Changed
-2045
Data Source - End of Sort
-2049
Data Source - Not Opened for Write
-2056
Data Source - No Matching With Current Data Source
-2062
Data Source - Bad Container Offset
-3001
Query - Field Not Found
-3003
Query - Bad Data Source
-3004
Query - Bad Token
-3005
Query - Token After End
-3006
Query - Unexpected End
-3008
Query - Too Long Query
-3009
Query - Extra Right Parenthesis
-3010
Query - Missing Right Parenthesis
-3012
Query - No Operation Code
-3013
Query - No Field In Comparison
-3014
Query - Bad Condition
-3015
Query - Bad Sort List
-3017
Query - No String
-3018
Query - Too Many Fields
-3019
Query - Too Many Indexes
-3020
Query - Too Many Tables
-3021
Query - Reference Not Found
-3022
Query - Bad Range Set
-3023
Query - Bad Parsing
-3025
Query - Data Bind is Missing
-3026
Query - Bad Input
-3027
Query - Progress Aborted
-3028
Query - Bad Table Index
-3032
Query - General Failure
-3033
Query - Empty Record
-3036
Query - Bad Parameter
-3037
Query - Missing Table in List
-3040
Query - Bad Operation
-3041
Query - Bad Expression
-3042
Query - Name Already Exists
-3044
Query - Time Expired
3001
Form - Is Not Initialized
3002
Form - Bad Data Source
3003
Form - Exceeded Data Sources Limit
3006
Form - Invalid Form Item
3007
Form - Exceeded Forms Limit
3009
Form - Too Many Saved Data
3012
Form - Invalid Form
3015
Form - Cannot Get Multi-Line Edit
3016
Form - Bad Item Type
3017
Form - Bad Parameter
3023
Form - No Message Callback
3029
Form - Item Is Not Selectable
3031
Form - Bad Value
3033
Form - Item Not Found
4007
Grid - Invalid
4008
Grid - Bad Size
4009
Grid - No Data
4011
Grid - Invalid Parameters
4013
Grid - Not Super Title
4014
Grid - Super Title 2 Exits
4015
Bad Item Unique ID
4016
Grid - Bad Data
4017
Grid - Column is Already Folded
4018
Grid - Column is Already Expanded
4019
Grid - Line Exists
4020
Grid - Not Enough Data
4022
Grid - Super Title Exists
4027
Grid - Row Is Not Collapsible
8004
Status Bar - No Such Info
8005
Status Bar - Info Occupied
8006
Status Bar - No Message Bar
8007
Status Bar - Progress Stopped
8008
Status Bar - Too Many Progress
5001
Graph - Invalid
5002
Graph - Bad Form Item
5005
Graph - Bad Parameters
-7008
Form not found
-7000
Invalid Form
-7031
Form - Reserved /Illegal form Unique ID
-7032
Form - Invalid Mode
-7006
The item is not a user defined item and cannot be manipulated in such manner
-7005
Invalid table name
-7004
XML batch load failed
-7003
Menu operation Add failed
-7002
Function not supported
-7001
Invalid Item
-7034
Could not clear item in group
-7033
Out of boundaries
-7020
This method cannot be invoked by a Cell object
-7019
Invalid form unique ID. Should not begin with an F_ prefix
-7018
Invalid Field Value
-7017
Invalid Field Name
-7016
This datasource object is not a user-defined object
-7015
Invalid Column
-7014
A Column object with the specified unique ID already exists in the system.
-7013
The string value entered should be less then 10 characters.
-7012
An Item object with the specified unique ID already exists in the system.
-7011
The string value entered should be less then 11 characters.
-7010
A form with the requested unique ID already exists in the system.
-7009
The string value entered should be less the 32 characters.
-7040
Cannot Load XML File
-7051
Unexpected usage of the specified XML TAG.
-7050
This action type is not valid or not implemented yet.
-7043
Cannot load the Menu resource from the specified XML file.
-7042
Cannot load the Item resource from the specified XML file.
-7041
Cannot load the Form resource from the specified XML file.
-7071
Failed to create the items group.
-7070
UID
-7069
Failed to change the form current pane level.
-7068
Failed to change the form color.
-7067
Failed to change the Form mode.
-7066
Failed to fix the form default button.
-7065
Failed to change the form Visible state.
-7064
Could not change the form title.
-7063
The change of form dimensions has failed
-7062
Unknown Form attribute
-7061
XML batch resource update is not supported yet.
-7060
Reached Max Number of user data sources.
-7094
Failed to add the items child objects.
-7093
Failed to batch add the items
-7092
Failed to bind the item to the data source
-7091
Wrong Item Attribute
-7090
Unknown Field Type
-7114
Type of Column is Not Supported.
-7113
Failed to add the column child objects.
-7112
Failed to add the new columns.
-7111
Failed to bind the column to a data source
-7110
Invalid column attributes
-7133
The specified menu position is not valid
-7132
Invalid menu type
-7131
Failed to add the menu object
-7130
The specified menu already exists.
-7030
Invalid Row Number
-7029
Operation not supported on system form.
-7028
Out of boundary of DB data source offset.
-7027
The menu item is not a user defined menu item and cannot be manipulated in such manner.
-7026
Menu item was not found
-7025
Unknown Form State
-7024
Failed setting form bounds
-7023
Invalid Target
-7022
Could not commit action because the item is currently in focus.
-7021
Operation could not be set on extended edit text item.
-7200
Your connection string doesn't much UI development work mode.
-7201
The specified connection string is not valid.
Maybe you are looking for
-
Why are videos loading so slowly on iweb site?
So I built a site with lots of video, but each video is on its own separate page. Why do the videos take so long to long and then sometimes stop intermittently while playing? Would appreciate multiple responses for things to try. Also, what is the op
-
Synch iCal To-Do's to my 2G iTouch?
I can synch all my iCal appointments from my MacBook to my iTouch however but I can't find a way to also synch my To-dos from iCal to the iTouch. I know there's a 3rd party app that does this but I can't believe Apple would overlook this basic need s
-
Can JSSE stop TLS on a socket?
I create a java.net.socket then create a javax.net.SSLsocket over the top of it (Using the same host and port: SSLSocketFactory( socket, host, port, false - this flag says that the underlying socket is not closed) Now I need to go back to the clear t
-
Handle double click of divider of HDividedBox
I'm trying to give the user an easy way to expand/contract an HDividedBox, instead of having to drag the divider all the way to the left. In order to do this I need to handle something besides the 3 standard DividerEvents (press, release, drag). Has
-
What to do if it says connect to itunes to configure?
I removed the battery, and my phone went dead,,,now it says "connect to itunes to configure" what should i do?