CIS query
I have a query on Construction Industry Scheme. If we have someone in the UK who we should deduct 20% tax for to then pay to the Inland Revenue, how does the system distinguish between the parts of the invocie which are exempt? ie if the invocie includes services and materials, the materials would not need the 20% tax deducting.
I can't see anyhting in the configuration notes that cover this.
OK MM02 select sales org data.
You want the field MG03STEUER-TAXKM which is in the sales org 1 tab.
Normally if it has a 1 then it is valid for tax, 0 means it is not.
To find your material view it in your sales document or purchase order.
Similar Messages
-
Hi,
I need to query the stellent content store( database) and get the values through my CIS application code.Is it possible ? if so how ?
For ex : if want to check the existence of a folder name , how can i query and check that from CIS Code.The Query is:-SELECT A.ID, A.NAME, A.COMB, B.C1,B.C2, B.C3 FROM NT_KFD_RFT_TEST_DATE A, TABLE(OB_KFD_RFT_DATA) B
Nested Table structure Example:-
ID NAME COMB OB_KFD_RFT_DATA
01 TEST ALL
The inner table (OB_KFD_RFT_DATA) structure is
C1 C2 C3
23.5 56.7 78.9
00.9 76.9 53.3
12.4 33.4 23.2
Here outer record is 01 TEST ALL, and inner record is the 3 row decimal numbers.
In Universe, I need to create Objects from C1, C2, C3 columns.
Currently i'm doing it with derived table (by running above query). Is there any other option to do it?
Thanks,
Anu -
Content presenter: content source based on a query resulting in error
Hi all,
I am using a content presenter taskflow showing content based on a query. After some changes were made to the Webcenter Content instance (extra metadata field, extra profiles) the query is resulting in an error. In my WC_Spaces log I see the following message:
Caused By: oracle.webcenter.content.integration.RepositoryException: Jun 13, 2012 11:15:11 AM oracle.webcenter.content.integration.spi.ucm.search.SearchService search
SEVERE: An error occurred when searching repository WebCenterSpaces-UCM. When calling service GET_SEARCH_RESULTS, as user weblogic, at timestamp 6/13/12 11:15 AM, received status code -32. The search was Search[repositoryId=WebCenterSpaces-UCM, max to return=100, useFullTextSearch=true, useCache=true, sort="toProperty('dDocTitle') ASC", fullText="
Metadata criteria((cm_contentType equals IDC:Profile:qblIntranetArtikel)AND(xqblGroep [any] equals Quobell)AND(xqblIntranetSubGroep [any] equals Opleidingen))
isOr=false"] and the parameter map was {ResultCount=51, FolderPathInSearchResults=1, SortField=dDocTitle, IdcService=GET_SEARCH_RESULTS, SortOrder=ASC, vcrAppendObjectClassInfo=1, StartRow=1, QueryText=(xqblGroep <matches> `Quobell`) <AND> (xqblIntranetSubGroep <matches> `Opleidingen`), vcrContentType=IDC:Profile:qblIntranetArtikel}.
The profile qblIntranetArtikel I am using already existed before the change were made and the query worked fine then.
In WCC I see the following error:
(internal)/6 06.13 11:15:10.272 IdcServer-551 -1 exception backtrace:java.lang.ArrayIndexOutOfBoundsException: -1(internal)/6 06.13 11:15:10.272 IdcServer-551 at java.util.Vector.get(Vector.java:696)
(internal)/6 06.13 11:15:10.272 IdcServer-551 at intradoc.data.DataResultSet.getStringValue(DataResultSet.java:2183)
(internal)/6 06.13 11:15:10.272 IdcServer-551 at collections.CollectionFilters.doFilter(CollectionFilters.java:95)
(internal)/6 06.13 11:15:10.272 IdcServer-551 at intradoc.shared.PluginFilters.filterWithAction(PluginFilters.java:115)
(internal)/6 06.13 11:15:10.272 IdcServer-551 at intradoc.shared.PluginFilters.filter(PluginFilters.java:68)
(internal)/6 06.13 11:15:10.272 IdcServer-551 at intradoc.server.Service.executeFilter(Service.java:4095)
(internal)/6 06.13 11:15:10.272 IdcServer-551 at intradoc.server.SearchService.doResponse(SearchService.java:2081)
(internal)/6 06.13 11:15:10.272 IdcServer-551 at intradoc.server.ServiceRequestImplementor.doRequest(ServiceRequestImplementor.java:802)
(internal)/6 06.13 11:15:10.272 IdcServer-551 at intradoc.server.Service.doRequest(Service.java:1956)
(internal)/6 06.13 11:15:10.272 IdcServer-551 at intradoc.server.ServiceManager.processCommand(ServiceManager.java:437)
(internal)/6 06.13 11:15:10.272 IdcServer-551 at intradoc.server.IdcServerThread.processRequest(IdcServerThread.java:265)
(internal)/6 06.13 11:15:10.272 IdcServer-551 at intradoc.server.IdcServerThread.run(IdcServerThread.java:160)
(internal)/6 06.13 11:15:10.272 IdcServer-551 at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:545)
(internal)/6 06.13 11:15:10.272 IdcServer-551 at weblogic.work.ExecuteThread.execute(ExecuteThread.java:256)
(internal)/6 06.13 11:15:10.272 IdcServer-551 at weblogic.work.ExecuteThread.run(ExecuteThread.java:221)
services/3 06.13 11:15:10.274 IdcServer-551 !csUserEventMessage,weblogic,CIS!csSystemCodeExecutionError java.lang.ArrayIndexOutOfBoundsException: -1services/3 06.13 11:15:10.274 IdcServer-551 at java.util.Vector.get(Vector.java:696)
services/3 06.13 11:15:10.274 IdcServer-551 at intradoc.data.DataResultSet.getStringValue(DataResultSet.java:2183)
services/3 06.13 11:15:10.274 IdcServer-551 at collections.CollectionFilters.doFilter(CollectionFilters.java:95)
services/3 06.13 11:15:10.274 IdcServer-551 at intradoc.shared.PluginFilters.filterWithAction(PluginFilters.java:115)
services/3 06.13 11:15:10.274 IdcServer-551 at intradoc.shared.PluginFilters.filter(PluginFilters.java:68)
services/3 06.13 11:15:10.274 IdcServer-551 at intradoc.server.Service.executeFilter(Service.java:4095)
services/3 06.13 11:15:10.274 IdcServer-551 at intradoc.server.SearchService.doResponse(SearchService.java:2081)
services/3 06.13 11:15:10.274 IdcServer-551 at intradoc.server.ServiceRequestImplementor.doRequest(ServiceRequestImplementor.java:802)
services/3 06.13 11:15:10.274 IdcServer-551 at intradoc.server.Service.doRequest(Service.java:1956)
services/3 06.13 11:15:10.274 IdcServer-551 at intradoc.server.ServiceManager.processCommand(ServiceManager.java:437)
services/3 06.13 11:15:10.274 IdcServer-551 at intradoc.server.IdcServerThread.processRequest(IdcServerThread.java:265)
services/3 06.13 11:15:10.274 IdcServer-551 at intradoc.server.IdcServerThread.run(IdcServerThread.java:160)
services/3 06.13 11:15:10.274 IdcServer-551 at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:545)
services/3 06.13 11:15:10.274 IdcServer-551 at weblogic.work.ExecuteThread.execute(ExecuteThread.java:256)
services/3 06.13 11:15:10.274 IdcServer-551 at weblogic.work.ExecuteThread.run(ExecuteThread.java:221)
When I select a single item to be shown in the content presenter taskflow, I works fine. It also works fine when showing all documents in a folder.
Does any body have an idea what might be the problem I am facing and how to fix it?
thanks in advance,
HaroldHi all,
I found what caused the error. Someone had set the CollectionID metadata field in WCC to non-searchable. This resulted in an error in the CollectionsFilter.
Setting the field back to searchable in WCC solved the problem.
regards,
Harold -
Suggestions about query optimization
Hello,
i have the following query i would like to write in the other way or add indexes/hints/pin in memory if it's possible so it could be better optimiized.
Query is :
SQL> explain plan for
2 with a as
3 (select * from
4 (select msisdn,valid_from
5 from prepaid_options_option
6 where active =1 and option_id in (1,2) )a )
7 select count(*) from [email protected], a
8 where transaccessflag=6
9 and cgpacallingparty=a.msisdn
10 and optionid IN (16,17,18)
11 and timestamp > a.valid_from
12 and callcharge=0
13 and internalcause='254';
Explained.
SQL> r
1* select * from table(dbms_xplan.display)
PLAN_TABLE_OUTPUT
| Id | Operation | Name | Rows | Bytes | Cost | Inst |IN-OUT|
| 0 | SELECT STATEMENT | | 1 | 148 | 529K| | |
| 1 | SORT AGGREGATE | | 1 | 148 | | | |
|* 2 | HASH JOIN | | 1 | 148 | 529K| | |
| 3 | REMOTE | | 82 | 9922 | 529K| WENT | R->S |
|* 4 | TABLE ACCESS FULL | PREPAID_OPTIONS_OPTION | 4506 | 118K| 10 | | |
PLAN_TABLE_OUTPUT
Predicate Information (identified by operation id):
2 - access("CALL_RECORD"."CGPACALLINGPARTY"="PREPAID_OPTIONS_OPTION"."MSISDN")
filter("CALL_RECORD"."TIMESTAMP">"PREPAID_OPTIONS_OPTION"."VALID_FROM")
4 - filter("PREPAID_OPTIONS_OPTION"."ACTIVE"=1 AND ("PREPAID_OPTIONS_OPTION"."OPTION_ID"=1
OR "PREPAID_OPTIONS_OPTION"."OPTION_ID"=2))
Note: cpu costing is off
20 rows selected.
SQL> select * from v$version;
BANNER
Oracle9i Enterprise Edition Release 9.2.0.7.0 - 64bit Production
PL/SQL Release 9.2.0.7.0 - Production
CORE 9.2.0.7.0 Production
TNS for HPUX: Version 9.2.0.7.0 - Production
NLSRTL Version 9.2.0.7.0 - Production
SQL> select * from [email protected];
BANNER
Oracle9i Enterprise Edition Release 9.2.0.7.0 - 64bit Production
PL/SQL Release 9.2.0.7.0 - Production
CORE 9.2.0.7.0 Production
TNS for HPUX: Version 9.2.0.7.0 - Production
NLSRTL Version 9.2.0.7.0 - ProductionI think that the main problem could be in the remote partitioned table that is quite big .
SQL> SELECT SUM (BYTES) / 1024 / 1024 / 1024 GB
2 FROM [email protected]
3 WHERE segment_name = 'CALL_RECORD';
GB
181.453125
SQL> select num_rows,last_analyzed
2 from [email protected]
3 where table_name='CALL_RECORD';
NUM_ROWS LAST_ANA
928646610 12.03.09Can some suggestion about making changes in this query/objects be given based on this informations ?
Thank you very much.Thans for the reply Urs,
by changing that query as you suggested, i got different plan, although i can't fully understand if it means that it's better in the mean of faster execution time because i can't(yet) run those queries to see.
new plan is :
SQL> explain plan for
2 with a as
3 (select msisdn,valid_from
4 from prepaid_options_option
5 where active =1 and option_id in (1,2) )
6 select /*+ driving_site(c) */count(*) from [email protected] c,a
7 where transaccessflag=6
8 and cgpacallingparty=a.msisdn
9 and optionid IN (16,17,18)
10 and timestamp > a.valid_from
11 and callcharge=0
12 and internalcause='254';
Explained.
SQL>
SQL>
SQL> select * from table(dbms_xplan.display);
PLAN_TABLE_OUTPUT
| Id | Operation | Name | Rows | Bytes | Cost | Pstart| Pstop | Inst |IN-OUT|
| 0 | SELECT STATEMENT REMOTE| | 1 | 78 | 529K| | | |
| 1 | SORT AGGREGATE | | 1 | 78 | | | | |
| 2 | NESTED LOOPS | | 1 | 78 | 529K| | | |
| 3 | PARTITION RANGE ALL | | | | | 1 | 128 | |
|* 4 | TABLE ACCESS FULL | CALL_RECORD | 1 | 42 | 529K| 1 | 128 | WENT |
| 5 | REMOTE | | 1 | 36 | 10 | | | ! |
PLAN_TABLE_OUTPUT
Predicate Information (identified by operation id):
4 - filter("A2"."TRANSACCESSFLAG"=6 AND (TO_NUMBER("A2"."OPTIONID")=16 OR
TO_NUMBER("A2"."OPTIONID")=17 OR TO_NUMBER("A2"."OPTIONID")=18) AND "A2"."CALLCHARGE"=0 AND
"A2"."INTERNALCAUSE"=254)
Note: fully remote operation, cpu costing is offas we can see the cost remained the same but there are some new columns as pstart and pstop.
what do they mean?
I think that it would be good to make statistics on that table , do you guys agree ?
Also shoud i consider parallel hint option for that query ? -
What is the limit on the number of tables that Query Builder can display? I am new to BI Publisher and when I connect to my datasource and select my schema I get the message "The list of tables is too long." There are about 80 tables in the selected schema.
We will have some developers working on our project who are not familiar with this applications schemas and would like to know what the limit is so we can understand how big a problem it will be for us and whether we should use something other than Query Builder to write our queries.
Thanks.Hi
I get the same message.I connected to the Apps database and the connection was successful.
I would retrieve tables from schema which has 60 tables in it.For others even when I enter the first few letters in the serach entry field they cannot be retrived.
I installed the BI Publisher 10.1.3.3.2 for Windows x86 (703 MB) on my local machine and I'm using http://wal1cd231.cis.concentra.corp:9704/xmlpserver/
to login into BI publisher enterprise using the administrator credentials provided when installed.
Any solution??? -
I am working with UCM API to access information related to Folders component.
ISCSSearchResponse result=null;
ISCSSearchAPI searchApi = this.application.getUCPMAPI ().getActiveAPI ().getSearchAPI ();
result = searchApi.search (context,strQuery, 100);
iter = result.getResults ().iterator ();
while (iter.hasNext ()) {
sres = (ISCSSearchResult) iter.next ();
folderApi = this.application.getUCPMAPI().getActiveAPI().getComponentFolderAPI();
ISCSFolderInfoResponse folderRes = folderApi.getFolder(context, sres.getFolderID());
ISCSFolder fold = folderRes.getFolder();
String folderPath = fold.getFolderPath();
I need to execute the code inside the while loop based on a condition. I need to check if the returned item from search results is a document or a folder, that is the item in *'sres'*.
Can someone please help me with this?
Thank you,
Padmaja.To search in a case sensitive manner, if you're using an Oracle database I know you can set a variable in config.cfg -- DatabasePreserveCase. This may also work for other databases, but I am not sure.
The available fields to filter on are all the metadata fields, whether they be UCM metadata fields or custom metadata fields.
The query is doing a database query so you need to use the name of the column name in the database -- custom variables start with x and ucm variables start with d.
I'm not an expert on UCM, but have been working on an implementation. I didn't really find a comprehensive guide for CIS, just used the examples from the sample code, the javadocs, some forum posts, and trial and error. -
CommonSearchParseException: Error building query, common name {0} specified
Hi,
I have installed Content Server and I have setup CIS on Oracle OC4J standalone. I have also validated the configuration by the action "Validate communication with Oracle Content Server".
I tried to execute the sample program CommonSearch from SDK.
The program is taking a default query as "$author <substring> 'Adm'" and default metadata map from /resources/ucpmcommon-metamap-default.xml ]
But I got the following error:
CommonSearchParseException: Error building query, common name {0} specified but is not mapped.
at com.stellent.cis.client.command.impl.services.CommandExecutorService.executeCommand(CommandExecutorService.java:62)
at com.stellent.cis.client.command.impl.CommandFacade.executeCommand(CommandFacade.java:158)
at com.stellent.cis.client.command.impl.BaseCommandAPI.invokeCommand(BaseCommandAPI.java:84)
at com.stellent.cis.client.api.common.search.impl.CISSearchAPI.search(CISSearchAPI.java:59)
at com.stellent.cis.sdk.samples.search.CommonSearch.execute(CommonSearch.java:78)
I have configured the adapterconfig.xml matching the CIS adapter config in OC4J as given below:
<?xml version="1.0" ?>
<config>
<adapter type="scs" default="true" name="myadapter">
<config>
<property name="port">4444</property>
<property name="host">localhost</property>
<property name="type">web</property>
<property name="contentServerAdminID">sysadmin</property>
<property name="contentServerAdminPassword">idc</property>
</config>
<beans template="classpath:/META-INF/resources/adapter/adapter-services-scs.jxml"/>
</adapter>
</config>
My metada map is the default mapping as follows
<metamap>
<adapter name="scsadapter">
<common>
<map name="Title" native="dDocTitle" />
<map name="Author" native="dDocAuthor" />
<map name="Date" native="dInDate" />
<map name="ID" native="dID" />
</common>
<contribution>
<!-- native fields are used only for contribution -->
<native name="comments" default="" override="true" />
<!-- common fields refer back to common map, can also be tagged with default and override attributes -->
<common name="title" />
<common name="author" />
</contribution>
</adapter>
</metamap>
When is this error "common name {0} specified but is not mapped" thrown? Is my metadata map file correct?
Thanks
RajiHi,
I changed the query and executed the program, still getting the same error. I have followed the instructions in CIS developer guide to create the metamap file but unable to figure out the reason for the error. Any other suggestions?
Thanks
Raji -
How to use RIDC to query WebCenter Content Tables
Hi all
Can we use RIDC API to query WebCenter Content 11g Tables.if yes then How can I achieve this?
i am newbiealways find in oracle doc
http://docs.oracle.com/cd/E21764_01/doc.1111/e11011/c05_core.htm#BABBABBF
and this too
http://jonathanhult.com/blog/2012/07/ridc-versus-cis/ -
How to use RIDC to query WebCenter Content Tables/Views
Hi,
Can I use RIDC API to query WebCenter Content 11g Tables/Views, if so, How can I achieve this?
Regards,Yes, you can.
Call one of the Schema services (such as GET_SCHEMA_VIEW_VALUES) and you will get back a ResultSet which you can iterate over.
http://docs.oracle.com/cd/E21764_01/doc.1111/e11011/c05_core.htm#BABBABBF
Some links to RIDC code examples can be found here: http://jonathanhult.com/blog/2012/07/ridc-versus-cis/
Jonathan
http://jonathanhult.com -
Hi,
I have column which is having values like
EMEA/MEA/IT
EMEA/WE/GE
EMEA/MEA/SA
EMEA/WE/jk
but i need to get all these rows based on some front selected values where we will select like EMEA/MEA & EMEA/WE.But that value will be ';' separated like EMEA/MEA%;EMEA/WE%.Based on this value l need to retrieve all the rows based on this value (Note ';' as the delimiter) .I tried with INSTR , but not able to sort out.
Could some one please me on this one how to make this condition in my query.
Thanks,Thanks Frank for your response.
Table will have thousands of rows where column which I comparing(OU_DIV_REG) will be like with many combination's.I am attaching some data for reference.
EMEA/DIV/
EMEA/DIV/HYP
EMEA/EE
EMEA/EE&CIS
EMEA/EE&CIS/
EMEA/EE&CIS/CENT
EMEA/EE&CIS/CIS
EMEA/EE&CIS/GR
EMEA/EE&CIS/RO
EMEA/EE&CIS/RTG
EMEA/EE&CIS/SBL
EMEA/EE&CIS/SEES
EMEA/EE&CIS/TR
EMEA/EMEA_OTM/
EMEA/FMEA/FR
EMEA/FMEA/MEA
EMEA/IL
EMEA/MEA
EMEA/MEA/
EMEA/MEA/EG
EMEA/MEA/SA
EMEA/MEA/ZA
EMEA/NE/BLX
EMEA/SE
EMEA/SE/ALPS
EMEA/SE/IBE
EMEA/UK
EMEA/UK/
But I am using this condition in APEX.Actually I have a report with return query and that will execute. I need this condition to be in where clause.I am attaching my APEX report query for your reference. I updating that where clause condition in BOLD letters where i need to add this condition that will consider all the rows from the table wherever input from APEX page will be like fallowing with ';' as delimter.
EMEA/MEA%;EMEA/EE&CIS%
Considering this input values, I need to consider all the rows above where that column value us having EMEA/MEA% and EMEA/EE&CIS%.
I tried adding the where clause which in BOLD letter (cluster condition).Please let me know will it work or also I need to how to add these XMLtable separation based on ',' in where clause.
For you reference I am just my full report query(which is not needed i know - but just have the full understanding).
DECLARE
lc_query VARCHAR2(4000);
BEGIN
lc_query := 'SELECT INITCAP(SUBSTR(end_cli_name,1,20)) Customer
,DECODE(cps_id,NULL,INITCAP(SUBSTR(title,1,20)),''<a href="http://cpotsi.oraclecorp.com/pls/cpotsiweb/CPOTSI.EP_WITHDRDTA_RAG_L.show_cps?p_cps_id=''||cps_id||''&p_uptodate=''||:P_DD||''" target=_blank>''||INITCAP(SUBSTR(title,1,20))||''</a>'') Project
,ou_ctry_code
,funding_amnt
,budgeted_margin_amnt
,TO_NUMBER(eac_margin_amnt)
,decode(substr(PREV_CPS_RAGU_L_1,1,1),
''R'',''<img src="#APP_IMAGES#red.jpg" alt="Red">'',
''A'',''<img src="#APP_IMAGES#amber.jpg" alt="Amber">'',
''G'',''<img src="#APP_IMAGES#green.jpg" alt="Green">'',
''U'',''<img src="#APP_IMAGES#unknown.jpg" alt="Unknown">'',
''<img src="#APP_IMAGES#unknown.jpg" alt="Unknown">'') RAGU
FROM emea_pmr_disco_input WHERE
month=:P_SELECTED_MONTH
AND year=:P_SELECTED_YEAR
AND region IN (SELECT region_code
FROM emea_pmr_regions
START WITH ( INSTR('':''||:P_SELECTED_REGION||'':'','':''||region_code||'':'',1,1) > 0 )
CONNECT BY PRIOR region_code=parent_region_code)
AND prof_com_text LIKE :P_SELECTED_INDUSTRY ';
IF :P_SELECTED_CLUSTER <> '%' THEN
lc_query := lc_query ||
*' AND upper(ou_div_reg) LIKE ''*
SUBSTR(:P_SELECTED_CLUSTER,1,INSTR(:P_SELECTED_CLUSTER,'';'',1,1)-1 )'' OR
upper(ou_div_reg) LIKE ''
SUBSTR(:P_SELECTED_CLUSTER,INSTR(:P_SELECTED_CLUSTER,'';'',1,1)+1,(INSTR(:P_SELECTED_CLUSTER,'';'',1,2) - (INSTR(:P_SELECTED_CLUSTER,'';'',1,1)-1) ) ) ''
OR upper(ou_div_reg) LIKE ''
SUBSTR(:P_SELECTED_CLUSTER,INSTR(:P_SELECTED_CLUSTER,'';'',1,2)+1,(INSTR(:P_SELECTED_CLUSTER,'';'',1,3) - (INSTR(:P_SELECTED_CLUSTER,'';'',1,2)-1) ) ) ''
OR upper(ou_div_reg) LIKE ''
SUBSTR(:P_SELECTED_CLUSTER,INSTR(:P_SELECTED_CLUSTER,'';'',1,3)+1,(INSTR(:P_SELECTED_CLUSTER,'';'',1,4) - (INSTR(:P_SELECTED_CLUSTER,'';'',1,3)-1) ) ) ''
OR upper(ou_div_reg) LIKE ''
SUBSTR(:P_SELECTED_CLUSTER,INSTR(:P_SELECTED_CLUSTER,'';'',1,4)+1,(INSTR(:P_SELECTED_CLUSTER,'';'',1,5) - (INSTR(:P_SELECTED_CLUSTER,'';'',1,4)-1) ) ) ''
OR upper(ou_div_reg) LIKE ''
SUBSTR(:P_SELECTED_CLUSTER,INSTR(:P_SELECTED_CLUSTER,'';'',1,5)+1,(INSTR(:P_SELECTED_CLUSTER,'';'',1,6) - (INSTR(:P_SELECTED_CLUSTER,'';'',1,5)-1) ) ) ''
OR upper(ou_div_reg) LIKE ''
SUBSTR(:P_SELECTED_CLUSTER,INSTR(:P_SELECTED_CLUSTER,'';'',1,6)+1,(INSTR(:P_SELECTED_CLUSTER,'';'',1,7) - (INSTR(:P_SELECTED_CLUSTER,'';'',1,6)-1) ) ) ''
END IF;
IF :P1_TIER2 <> '%' THEN
lc_query := lc_query || ' AND INSTR('';''||upper(:p1_tier2)||'';'','';''||upper(T2)||'';'',1,1) > 0 ';
END IF;
IF :P1_TIER3 <> '%' THEN
lc_query := lc_query || ' AND INSTR('';''||upper(:p1_tier3)||'';'','';''||upper(T3)||'';'',1,1) > 0 ';
END IF;
IF :P1_TIER4 <> '%' THEN
lc_query := lc_query || ' AND INSTR('';''||upper(:p1_tier4)||'';'','';''||upper(T4)||'';'',1,1) > 0 ';
END IF;
IF :P_SELECTED_COUNTRY <> '%' THEN
lc_query := lc_query || ' AND INSTR('';''||upper(:P_SELECTED_COUNTRY)||'';'','';''||upper(ou_ctry_code)||'';'',1,1) > 0 ';
ELSE
IF :P_IS_ADMIN = 'N' THEN
lc_query := lc_query || 'AND ou_ctry_code IN (SELECT country_code
FROM emea_pmr_user_countries
WHERE INSTR('':''||:P_SELECTED_REGION||'':'','':''||region_code||'':'',1,1) > 0
AND user_id = :P_SELECTED_USER_ID
AND view_access = ''Y'') ';
END IF;
END IF;
IF :P_TOPMARLOV='Current' THEN
lc_query := lc_query || ' AND UPPER(ep_state_name)=''STARTED''';
ELSIF :P_TOPMARLOV='Closed' THEN
lc_query := lc_query || ' AND UPPER(ep_state_name)=''CLOSED''';
END IF;
IF:P1_MARGIN_STATUS='R' THEN
lc_query := lc_query || ' AND
UPPER(substr(PREV_CPS_RAGU_L_1,1,1))=''R''';
ELSIF:P1_MARGIN_STATUS='G' THEN
lc_query := lc_query || ' AND
UPPER(substr(PREV_CPS_RAGU_L_1,1,1))=''G''';
ELSIF:P1_MARGIN_STATUS='A' THEN
lc_query := lc_query || ' AND
UPPER(substr(PREV_CPS_RAGU_L_1,1,1))=''A''';
ELSIF:P1_MARGIN_STATUS='U' THEN
lc_query := lc_query || ' AND
UPPER(substr(PREV_CPS_RAGU_L_1,1,1))=''U''';
END IF;
htp.p(lc_query);
RETURN lc_query;
END; -
Inserting field text into sql query and comparing values to another table
I have an issue in Visual Web Developer 2010 that I need help with.
The code below is a Gridview Sql query where I'm extracting PART_NUMBER from various tables. I would like to add the table name in a separate field named Table. The end result should appear as follows:
PART_NUMBER Table
010-0075-06 Resistors (or Capacitors, etc.)
Sql query:
SELECT PART_NUMBER
FROM Capacitors
EXCEPT
SELECT PART_NUMBER
FROM [CIS Manufacturer Parts]
UNION
SELECT PART_NUMBER
FROM Connectors
EXCEPT
SELECT PART_NUMBER
FROM [CIS Manufacturer Parts]
UNION
SELECT PART_NUMBER
FROM Diodes
EXCEPT
SELECT PART_NUMBER
FROM [CIS Manufacturer Parts]
UNION
SELECT PART_NUMBER
FROM ICs
EXCEPT
SELECT PART_NUMBER
FROM [CIS Manufacturer Parts]
UNION
SELECT PART_NUMBER
FROM Inductors
EXCEPT
SELECT PART_NUMBER
FROM [CIS Manufacturer Parts]
UNION
SELECT PART_NUMBER
FROM Misc
EXCEPT
SELECT PART_NUMBER
FROM [CIS Manufacturer Parts]
UNION
SELECT PART_NUMBER
FROM Relays
EXCEPT
SELECT PART_NUMBER
FROM [CIS Manufacturer Parts]
UNION
SELECT PART_NUMBER
FROM Resistors
EXCEPT
SELECT PART_NUMBER
FROM [CIS Manufacturer Parts]
UNION
SELECT PART_NUMBER
FROM Switches
EXCEPT
SELECT PART_NUMBER
FROM [CIS Manufacturer Parts]
UNION
SELECT PART_NUMBER
FROM Transformers
EXCEPT
SELECT PART_NUMBER
FROM [CIS Manufacturer Parts]
UNION
SELECT PART_NUMBER
FROM Transistors
EXCEPT
SELECT PART_NUMBER
FROM [CIS Manufacturer Parts]
UNION
SELECT PART_NUMBER
FROM [Crystals and Oscillators]
EXCEPT
SELECT PART_NUMBER
FROM [CIS Manufacturer Parts]
ORDER BY PART_NUMBER
I have a separate table (CIS Manufacturer Parts) that contains manufacturer data for the above parts. Multiple manufacturer rows can exist. The connection between tables in the PART_NUMBER field. What I would like to do is make this query
add the table name to the gridview output listing only parts without manufacturer data and the table they can be found in.
This is a lot for a newbie so I will appreciate any help, thanks!Hello Bulldog248,
Thank you for your post.
Your issue is out of support range of VS General Question forum which mainly discusses the usage issue of Visual Studio IDE such as
WPF & SL designer, Visual Studio Guidance Automation Toolkit, Developer Documentation and Help System
and Visual Studio Editor.
I am moving your question to the moderator forum ("Where is the forum for..?"). The owner of the forum will direct you to a right forum.
Best regards,
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey. -
Error while running a query-Input for variable 'Posting Period is invalid
Hi All,
NOTE: This error is only cropping up when I input 12 in the posting period variable selection. If I put in any other value from 1-11 I am not getting any errors. Any ideas why this might be happening?
I am getting the following error when I try and run a query - "Input for variable 'Posting Period (Single entry, mandatory)' is invalid" - On further clicking on this error the message displayed is as follows -
Diagnosis
Variable Posting Period (Single Value Entry, Mandatory) is used as a lower limit (X) and an upper limit () in an interval selection. This limit has the value #.
System Response
Procedure
Enter a different value for variable Posting Period (Single Value Entry, Mandatory). If the value of the other limit is determined by another variable, you can change its value also.
Procedure for System AdministrationOK.
Well, if the variable is not used in any interval selection, then I would say "something happened to it".
I would make a copy of the query and run it to check if I get the same problem with period 12.
-> If not, something is wrong in the original query (you can proceed as below, if changes to original are permitted).
If so, then try removing the variable completely from the query and hardcode restriction to 12.
-> If problem still persists, I would have to do some thinking.
If problem is gone, then add the variable again. Check.
-> If problem is back, then the variable "is sick". Only quick thing to do, is to build an identical variable and use that one.
If problem also happens with the new variable, then it's time to share this experience with someone else and consider raising an OSS.
Good luck!
Jacob
P.S: what fisc year variant are you using?
Edited by: Jacob Jansen on Jan 25, 2010 8:36 PM -
Logical database in adhoc query
Hello All,
Can anyone tell me what is the logical database in adhoc query?Hi
When you create a query , you have to select an infoset. Infoset can be considered as a source from which data is populated in the Query Fields.
Infosets are created from Transaction SQ02.
There can be four methods through which an Infoset can become a source of data:
1. Table join ( By joining two or more tables from Data dictionary)
example: Joining tables PA0001 and PA0006 on Pernr to get a one resultant dataset
2. Direct read of Basis Table ( Like PA0001 as a source for data in Infoset )
3. Logical Database ( A Pre-written Program by SAP that extract data from clusters, tables taking care of authorizations and validity periods)
Example : Logical database PNP, PNPCE (Concurrent Employement),PCH ( LDB for Personnel Development Data)
Custom Logical DBs can be created in T_Code SE-36.
4. Data Retrieval by a Program ( Custom code written by ABAP developers which will collect and process data) . This program has a corresponding Structure in data dictionary and the fields of this structure will be used in query)
Reward Points, if helpful.
Regards
Waseem Imran -
Query help on Goods Receipt Query with AP Invoice
Looking for a little help on a query. I would like to list all the goods receipts for a given date range and then display the AP Invoice information (if its been copied to an AP Invoice). I think my problem is in my where clause, I plagerized an SAP query to show GR and AP from a PO as a start. SBO 2005 SP01. Any help would be great appreciated. Thanks
SELECT distinct 'GR',
D0.DocStatus,
D0.DocNum ,
D0.DocDate,
D0.DocDueDate,
D0.DocTotal,
'AP',
I0.DocStatus,
I0.DocNum ,
I0.DocDate,
I0.DocDueDate,
I0.DocTotal,
I0.PaidToDate
FROM
((OPDN D0 inner Join PDN1 D1 on D0.DocEntry = D1.DocEntry)
full outer join
(OPCH I0 inner join PCH1 I1 on I0.DocEntry = I1.DocEntry)
on (I1.BaseType=20 AND D1.DocEntry = I1.BaseEntry AND D1.LineNum=I1.BaseLine))
WHERE
(D1.BaseType=22 AND D1.DocDate>='[%0]' AND D1.DocDate<='[%1]')
OR (I1.BaseType=20 AND I1.BaseEntry IN
(SELECT Distinct DocEntry
FROM PDN1 WHERE BaseType=22 AND DocDate>='[%0]' AND DocDate<='[%1]'))Hi Dalen ,
I believe it is because of the condition
(D1.BaseType=22 AND D1.DocDate>='%0' AND D1.DocDate<='%1')
OR (I1.BaseType=20 AND I1.BaseEntry IN
(SELECT Distinct DocEntry FROM PDN1 WHERE PDN1.BaseType=22 AND DocDate>='%0' AND DocDate<='%1'))
Try changing
D1.BaseType=22 OR D1.DocDate>='%0' AND D1.DocDate<='%1
PDN1.BaseType=22 OR DocDate>='%0' AND DocDate<='%1'))
Lets see what would be the result . Lets have some fun with troubleshooting
See what would be the difference in the result .
Thank you
Bishal -
Can you check for data in one table or another but not both in one query?
I have a situation where I need to link two tables together but the data may be in another (archive) table or different records are in both but I want the latest record from either table:
ACCOUNT
AccountID Name
123 John Doe
124 Jane Donaldson
125 Harold Douglas
MARKETER_ACCOUNT
Key AccountID Marketer StartDate EndDate
1001 123 10526 8/3/2008 9/27/2009
1017 123 10987 9/28/2009 12/31/4712 (high date ~ which means currently with this marketer)
1023 124 10541 12/03/2010 12/31/4712
ARCHIVE
Key AccountID Marketer StartDate EndDate
1015 124 10526 8/3/2008 12/02/2010
1033 125 10987 01/01/2011 01/31/2012
So my query needs to return the following:
123 John Doe 10526 8/3/2008 9/27/2009
124 Jane Donaldson 10541 12/03/2010 12/31/4712 (this is the later of the two records for this account between archive and marketer_account tables)
125 Harold Douglas 10987 01/01/2011 01/31/2012 (he is only in archive, so get this record)
I'm unsure how to proceed in one query. Note that I am reading in possibly multiple accounts at a time and returning a collection back to .net
open CURSOR_ACCT
select AccountID
from
ACCOUNT A,
MARKETER_ACCOUNT M,
ARCHIVE R
where A.AccountID = nvl((select max(M.EndDate) from Marketer_account M2
where M2.AccountID = A.AccountID),
(select max(R.EndDate) from Archive R2
where R2.AccountID = A.AccountID)
and upper(A.Name) like parameter || '%'
<can you do a NVL like this? probably not... I want to be able to get the MAX record for that account off the MarketerACcount table OR the max record for that account off the Archive table, but not both>
(parameter could be "DO", so I return all names starting with DO...)if I understand your description I would assume that for John Dow we would expect the second row from marketer_account ("high date ~ which means currently with this marketer"). Here is a solution with analytic functions:
drop table account;
drop table marketer_account;
drop table marketer_account_archive;
create table account (
id number
, name varchar2(20)
insert into account values (123, 'John Doe');
insert into account values (124, 'Jane Donaldson');
insert into account values (125, 'Harold Douglas');
create table marketer_account (
key number
, AccountId number
, MktKey number
, FromDt date
, ToDate date
insert into marketer_account values (1001, 123, 10526, to_date('03.08.2008', 'dd.mm.yyyy'), to_date('27.09.2009', 'dd.mm.yyyy'));
insert into marketer_account values (1017, 123, 10987, to_date('28.09.2009', 'dd.mm.yyyy'), to_date('31.12.4712', 'dd.mm.yyyy'));
insert into marketer_account values (1023, 124, 10541, to_date('03.12.2010', 'dd.mm.yyyy'), to_date('31.12.4712', 'dd.mm.yyyy'));
create table marketer_account_archive (
key number
, AccountId number
, MktKey number
, FromDt date
, ToDate date
insert into marketer_account_archive values (1015, 124, 10526, to_date('03.08.2008', 'dd.mm.yyyy'), to_date('02.12.2010', 'dd.mm.yyyy'));
insert into marketer_account_archive values (1033, 125, 10987, to_date('01.01.2011', 'dd.mm.yyyy'), to_date('31.01.2012', 'dd.mm.yyyy'));
select key, AccountId, MktKey, FromDt, ToDate
, max(FromDt) over(partition by AccountId) max_FromDt
from marketer_account
union all
select key, AccountId, MktKey, FromDt, ToDate
, max(FromDt) over(partition by AccountId) max_FromDt
from marketer_account_archive;
with
basedata as (
select key, AccountId, MktKey, FromDt, ToDate
from marketer_account
union all
select key, AccountId, MktKey, FromDt, ToDate
from marketer_account_archive
basedata_with_max_intervals as (
select key, AccountId, MktKey, FromDt, ToDate
, row_number() over(partition by AccountId order by FromDt desc) FromDt_Rank
from basedata
filtered_basedata as (
select key, AccountId, MktKey, FromDt, ToDate from basedata_with_max_intervals where FromDt_Rank = 1
select a.id
, a.name
, b.MktKey
, b.FromDt
, b.ToDate
from account a
join filtered_basedata b
on (a.id = b.AccountId)
ID NAME MKTKEY FROMDT TODATE
123 John Doe 10987 28.09.2009 31.12.4712
124 Jane Donaldson 10541 03.12.2010 31.12.4712
125 Harold Douglas 10987 01.01.2011 31.01.2012
If your tables are big it could be necessary to do the filtering (according to your condition) in an early step (the first CTE).
Regards
Martin
Maybe you are looking for
-
Account Determination error during Goods Receipt
Good Day, I get the error Account determination for 2000 WRX is not possible when trying to post a Goods Receipt for a material without a master. My material is linked to material material type 1. Material type 1 is linked to valuation class 3000. In
-
How to unlock ipad 2 forgot password, with app find iphone on
Please help.
-
Multiuser multi-screen resolutions not saved when restarted?
I love my new iMac, but can't stand the fact that I allways have to change resolutions after rebooting the thing, ughh.. I Use the highest resolution, my girlfriend uses a lower one. When I reboot all accounts default to the high resolution, that's f
-
2 X Complete networks conncted with ethernet on firewall?
I have 2 separate networks operating with their own firewalls, internet connection and servers each in its own subnet on the inside. I have been tasked to inter connect these networks to communicate with each other by inter connecting the firewalls (
-
HFM process control alerting only while submitting
Hi, I want to use the email alerting for process management. All settings are done and everything works fine. But I want to limit the alerting to the submit process. It means, the system should send a mail only if the user submits the process to the