Data Subsetting parameters
Hello,
Where does Oracle store the data subnetting parameters in the "Mobileadmin" schema? I'd like to know so I can validate the parameter for each user without having to go through each one on the Mobile Manager.
Thank you.
The data subsetting parameters used in each publication item are stored in c$all_pub_params.
The values for each user are in c$all_subscription_params
NOTE do not change directly through the database, as this would not work correctly. these tables do not have public grants by default, so if you want to examine the data programatically (we do as part of application publishing), then you will need to grant access/create synonyms if you code does not run as mobileadmin
Similar Messages
-
How to set Data Subsetting Parameters in MOBILE SERVER
Hello.
How can I set data subsetting parameters in Mobile Server with patch 5.0.2.10.0 NLS.
From Mobile Server "Control Center" -> "Applications" it's not appears at left screen the following field:
* Data Subsetting
* Registry
* Access
* Files
The browser appears this error message:
"http://120.0.0.1:2000/webtogo/admin/console/apppropinfo?applicationvp=%2FMyApp"
Have you any idea for this problem?
Thanks All.Thanks Oliver,
I have to go in control center in "applications tab" then i have the list of application and i edit one of them, on the left clic Data Subsetting it's not appears.
The following it not appears:
* Data Subsetting
* Registry
* Access
* Files
The browser (internet explorer) appears (at buttom on the left browser) this error message:
"error http://127.0.0.1:2000/webtogo/admin/console/apppropinfo?applicationvp=%2FMyApp missing link".
Whereas (Oliver's solution) in Mobile Server "Control Center" -> "Users Tabs"
i have the list of users go and i edit one of them, on the left clic Data Subsetting then clic on the right pan platform and then i see but not parameter are definited.
Help me please. -
Oracle Lite: How to create data subsetting parameters?
I need to know:
how to create data subsetting parameters?
I need these parameters for use of a restricting predicate in an item publication.
I were looking the forum and i found topics about "how to set?" but i don't found how to create a data subsetting parameter.
I am replacing SQL server 2000 and SQL server CE by oracle 9i and oracle lite 5.0.2.
Thanks in advance.
PCIDHad problems with the parameters shown on pages webtogo in the datasubsettings section because none of them were "defined", but in sections 1.4.1.2 I found these lines:
Template: select * from master.task where CustCity = :city
Then click OK. This brings you back to the previous screen. The template query contains a variable (subscription parameter) named "city". Later, when you provision the application to a user, you will be prompted to enter the value for it.
I found out how to put a parameter to restrict registries that download to the pocket pc from each user.
Thank you very much!!! -
I am using Mobile Data Workbench to create data publications for users on win32 laptops.
While creating publication items, I would like to use parameters whose values I would like to specify using some variables, instead of manually keying them in for each user. Is there some way that I can specify the user name as the value for the parameter? Then I can use the same publication for multiple users and the data subsetting is done by the variable which gets its value dynamically from the user name to whom it is published.
Thanks for your repliesI have not done this with MDW as such, but to include user based data subserring do the following
1) work out how you are going to identify the records for a particular user for the publication items in question. I know this sounds a bit obvious, but it is worth giving this some thought. Is the data directly in the table/view the publication item is based on? do you need to include some subselect to obtain the correct values (consider building a database view to help with this)? are the columns and joins all indexed (otherwise you will have performance problems in the compose process/download)
2) the basic template given by the system for a publication item is 'SELECT * FROM <schema_owner>.TABLE' change this to something like one of the following (dependant on circumstance)
'SELECT * FROM <schema_owner>.TABLE where USER=:user'
'SELECT * FROM <schema_owner>.TABLE where ID IN (select id from <schema_owner.view where USER=:user)'
'SELECT t.* FROM <schema_owner>.TABLE t, <schema_owner>.TABLE2 t2 where t1.ID=t2.ID and t2.USER=:user'
all of these will work.
NOTE <schema_owner> is needed for ALL objects included in the template
NOTE the colon (:) used to identify the bind variable
3) publish the new/altered publication items, and you will find in the mobile manager that under the users>applications tab, there will be a link in the data subsetting tab (probably called the oracle lite client type). click on this and you will get a screen with all of the bind variables you have defined for the application, with a place to add in the values for that user.
Couple of points
a) all bind variables (or data subsetting parameters) are held and tested as VARCHAR2. If you are matching to numerics in the base tables, do 'where ID=TO_NUMBER(:user)' otherwise you will get typecasting and this will affect your performance
b) run conspef on the resultant publication items and check all parts for performance. The apply process uses the publication item priimary key for its selection, whilst the compose uses the selection criteria. You may need to tune for both options
c) you can include multiple subsetting parameters for an application, but this may give more of a maintenance overhead
d) the subsetting parameters are part of the application. If you have two or more applications being used by a user, you will have to include them in each
e) the subsetting parameters can be included in the user setup ini script run by wsh as well
[DATABASE]
TYPE=ORACLE
[USER]
NAME=NBURROWS
PASSWORD=NBURROWS
ENCRYPTED=FALSE
FULLNAME=NBURROWS
PRIVILEGE=C
[USER]
NAME=CTOMKINSON
PASSWORD=CTOMKINSON
ENCRYPTED=FALSE
FULLNAME=CTOMKINSON
PRIVILEGE=C
[ACL]
APPLICATION=/fusionbci
ROLE=DEFAULT ROLE
USER=NBURROWS
ACCESS=ENABLED
ROLE=DEFAULT ROLE
USER=CTOMKINSON
ACCESS=ENABLED
[SNAPSHOTVAR]
NAME=V_PDA_FBS_SITE_DRIVER
PLATFORM=WIN32
VIRTUALPATH=/fusionbci
USER=NBURROWS
VAR=BI_ID,124547
USER=CTOMKINSON
VAR=BI_ID,119489 -
Data subsetting setting parameters
I'm new to Oracle and have just taken over a project using Oracle Lite 10g.
I'm trying to implement data subsetting. I've set up the snapshot using the packaging wizard:
SELECT * FROM DEVELOPMENT.PERSONNEL p WHERE p.TestingCompanyUniqueID = TO_NUMBER(:companyID)
where companyID is the parameter I want to use. I now want to set values for that parameter for each user. When I go into the web to go interface, this parameter does not appear. From my understanding it is created up when the application is published. Am I missing something here?
Thanks
LynneI don't know if subscription parameters are supported in the MDW (mobile database workbench), I don't use it, but you can try it.
But the most reliable method IMO is the Java API (you can find the API documentation in olite\Mobile\doc\javadoc directory). To create and set a parameter for given user, try to use this method:
ConsolidatorManager CM = new ConsolidatorManager();
CM.openConnection(CONS_SCHEMA, PASSWORD, JDBC_URL);
CM.setSubscriptionParameter(publication, clientid, param_name, param_value); -
Data subsetting depending on connected user
hi there.
It is possible to define parameters in the where clause when defining a publication item. This parameter is resolved at runtime which provides the possiblity to send just a subset of the data of the given publication item back to the remote client.
In my case the subset is driven by the connected user. How can I configure this requirement. Do I need to define a own MyCompose class or even an own queue for this purpose?
thx for any hints.
j.Here is a section on shared maps from the documentation. You accomplish your task by assigning the user to a group.
It is very common for publications to contain publication items that are used specifically for lookup purposes. That is, a publication item that creates a read-only snapshot. The server may change these snapshots, but the client would never update them directly. Furthermore, many users often share the data in this type of snapshot. For example, there could be a publication item called zip_codes, which is subscribed to by all Mobile users.
The main function of Shared Maps is to improve scalability for this type of publication item by allowing users to share record state information and reduce the size of the resulting replication map tables. By default, if you have a non-updatable publication item, it defaults to using shared maps.
Note:
Shared Maps can also be used with updatable snapshots if the developer is willing to implement their own conflict detection and resolution logic; however, normally shared maps are only for non-updatable snapshots.
Shared maps shrink the size of map tables for large lookup publication items and reduce the MGP compose time. Lookup publication items contain read-only data that is not updatable on the clients and that is shared by multiple subscribed clients. When multiple users share the same data, their query subsetting parameters are usually identical.
For example, a query could be the following:
SELECT * FROM WHERE EMP WHERE DEPTNO = :dept_id
In the preceding example, all users that share data from the same department have the same value for dept_id. The default sharing method is based on subscription parameter values.
In the following example, the query is:
SELECT * FROM WHERE EMP WHERE DEPTNO = ( SELECT DEPTNO FROM EMP WHERE EMPNO = :emp_id )
In this example, users from the same departments still share data. Their subsetting parameters are not equal, because each user has a unique emp_id. To support the sharing of data for these types of queries (as illustrated by the example), a grouping function can be specified. The grouping function returns a unique group id based on the client id.
There is also another possible use for shared maps. It is possible to use shared maps for shared updatable publication items. However, this type of usage requires implementation of a custom dml procedure that handles conflict resolution. -
GL Trial Balance Report with Effective Dates as Parameters
We have a requirement to show the GL Trial Balance report with Effective dates as Parameters.
Current Analysis:
The Journals get updated with corresponding CCID in GL_BALANCES table when the Journal is posted. GL_BALANCE is SOB specific, if the SOB has month as period then the balances in GL_BALANCES would get updated against the month(period).
To overcome the period problem, we explored the option of using a View based on GL_JE_HEADERS and GL_JE_LINES for 'Posted' Journal Batches of a SOB. We are checking whether the GL_JE_HEADERS.default_effective_date lies between the :p_from_date and :p_to_date which is sent to the Report as a parameter. The above idea does not return expected data when the custom Trial Balance Report is run.
Following is the Query being used:
SELECT cc.segment4 ACCOUNT, bal.code_combination_id,
bal.begin_balance_dr
+ SUM (NVL (gljel.accounted_dr, 0)) opening_bal_dr,
bal.begin_balance_cr
+ SUM (NVL (gljel.accounted_cr, 0)) opening_bal_cr,
ffv.description,
(SELECT SUM (NVL (gljel.accounted_dr, 0))
FROM gl_je_headers gljeh,
gl_je_lines gljel,
gl_code_combinations gcc
WHERE gljeh.default_effective_date BETWEEN :p_from_date
AND :p_to_date
AND gljeh.je_header_id = gljel.je_header_id
AND gljel.code_combination_id = gcc.code_combination_id
AND gljel.period_name = gljeh.period_name
AND gljel.set_of_books_id = :p_set_of_books_id
AND gljeh.status = 'P'
AND gljel.status = 'P'
AND gljeh.actual_flag = 'A'
--AND gljel.code_combination_id =
-- bal.code_combination_id
AND gcc.segment4 = cc.segment4
GROUP BY gcc.segment4) c_dr,
(SELECT SUM (NVL (gljel.accounted_cr, 0))
FROM gl_je_headers gljeh,
gl_je_lines gljel,
gl_code_combinations gcc
WHERE gljeh.default_effective_date BETWEEN :p_from_date
AND :p_to_date
AND gljeh.je_header_id = gljel.je_header_id
AND gljel.period_name = gljeh.period_name
AND gljel.code_combination_id = gcc.code_combination_id
AND gljel.set_of_books_id = :p_set_of_books_id
AND gljeh.status = 'P'
AND gljel.status = 'P'
AND gljeh.actual_flag = 'A'
AND gcc.segment4 = cc.segment4
GROUP BY gcc.segment4) c_cr
FROM gl_period_statuses per,
gl_code_combinations cc,
gl_balances bal,
gl_je_headers gljeh,
gl_je_lines gljel,
fnd_flex_values_vl ffv,
fnd_flex_value_sets ffvs
WHERE cc.chart_of_accounts_id = :p_chart_of_accts_id
AND bal.currency_code = :p_currency
AND bal.actual_flag = 'A'
AND bal.period_name = per.period_name
AND cc.template_id IS NULL
AND cc.code_combination_id = bal.code_combination_id
AND per.set_of_books_id = :p_set_of_books_id
AND per.application_id = 101
AND :p_from_date BETWEEN per.start_date AND per.end_date
AND gljeh.period_name = per.period_name
AND gljeh.default_effective_date <= :p_from_date
AND gljeh.je_header_id = gljel.je_header_id
AND gljel.period_name = gljeh.period_name
AND gljel.set_of_books_id = :p_set_of_books_id
AND ffv.flex_value_set_id = ffvs.flex_value_set_id
AND ffvs.flex_value_set_name = 'JSWEL_ACCOUNT'
AND gljeh.status = 'P'
AND gljel.status = 'P'
AND cc.summary_flag = ffv.summary_flag
AND cc.segment4 = ffv.flex_value
AND gljeh.actual_flag = 'A'
AND gljel.code_combination_id = bal.code_combination_id
GROUP BY bal.begin_balance_dr,
bal.begin_balance_cr,
cc.segment4,
ffv.description,
bal.code_combination_id
Kindly suggest if I am missing anything. I am sure that the great guns here can help me out.
Thanks
Sumitsuggest to create customize TB report.
-
Optional date range parameters
Hi All,
I have a 2 parameters from date and to date.When I didn't selected anything in parameters list then it should show all dates data.
Please suggest how to create a optional parameter for date range parameters.Hi Sastry,
For getting optional date parameter we are using formula like this in record selection
Not(hasvalue({?Date})) OR ({employee.Date} = {?Date})
But the solution you provided doesn't contain not .Can you please suggest what is the difference. -
Code or idea of adding date range parameters
Thanks guys for answering all my past queries.
Another question arises
I don't know how to write code for date range value parameters for a report.
i-e
I have a report that takes a start date and end date range parameter.
I can pass all the other parameters to CrystalReportViewer through code but dont know how to write code to pass date range parameters.
Please help!Hi,
I assume you are using JRC on CR XI or XI R2.
For Single Range Values:
Calendar calendar1 = Calendar.getInstance();
calendar1.clear();
calendar1.set(yyyy,mm,dd);
Date date1 = calendar1.getTime();
Calendar calendar2 = Calendar.getInstance();
calendar1.clear();
calendar.set(yyyy,mm,dd);
Date date2 = calendar2.getTime();
// use yyyy,mm,dd,hh,mm,ss for DateTime parameter.
ParameterFieldValue rangeVal = createSingleRangeVal(date1, date2, RangeValueBoundType.inclusive, RangeValueBoundType.inclusive);
paramFieldController.setCurrentValue("", "<Parameter Name>", rangeVal);
For Multiple Range Values:
Object [] beginVals = {date1, date2, date3};
Object [] endVals = {date4, date5, date6};
//Where date1 - date4 is range 1, date2 - date5 is range 2 and date3 - date 6 is range 3.
RangeValueBoundType [] beginBoundTypes = {RangeValueBoundType.inclusive, RangeValueBoundType.exclusive, RangeValueBoundType.noBound};
RangeValueBoundType [] endBoundTypes = {RangeValueBoundType.noBound, RangeValueBoundType.inclusive, RangeValueBoundType.exclusive};
ParameterFieldValue [] multiRangeVal = createMultiValRangeParameter(beginVals, endVals, beginBoundTypes, endBoundTypes);
paramFieldController.setCurrentValues("", "<Parameter Name>", multiRangeVal);
I hope this helps.
Thanks
Aasavari -
Data Subsetting for users at runtime
Hi all
I have a requirement that I define data subsetting rules for the users based on some conditions which would be done at runtime.
For ex. I want that whenever the user synchronizes the user should get the data for the last 60days which have been assigned to him.
Can I have such policy defined.
If anybody have implemented such thing, kindly let me know.
thanx
ramchowHi Shaun
Thanks for your prompt reply.
I know this functionality and have been using it in my application from the beginning.
But I have a requirement that instead of setting values through the control center which is more like static values for each user and application I could allow users to when they synchronizes then they should have the privilege to download on their conditions.
For example user might say I want to download data for the last 60days.
I appreciate your prompt reply but that did not solve my problem.
Waiting for prompt reply again.
Thanx and regards
ramchow -
10g data subsetting and wsh on linux
Hi
I'm using mobile server 10g in standalone mode on a redhat and
i'd like to know how to use wsh to add/set some parameter variables for data subsetting to an application via wsh
i used to do it on 9i on windows by creating a .ini and running the command :
wsh -c data_subset.ini mobileadmin/[email protected]
with my .ini looking like that :
[DATABASE]
TYPE=ORACLE
[SNAPSHOTVAR]
NAME=DATASUBSET
PLATFORM=WIN32
VIRTUALPATH=/ARBRES_ALIGN_TEST
USER=ITEM-51357
VAR=ATELIER, ('NBE')
does anyone know how to do this on linux ? I see a wsh shell in my ORACLE_HOME/mobile/server/bin, but don't know what to do with it.
thanx a lotsame principle. create a .ini file and use wsh to import it
Navigate to $ORACLE_HOME/mobile/server/bin and execute wsh as below:
./wsh -c /<directory containing ini script>/<script name>.ini mobileadmin/<Standard Password on DB>@DB
NOTE ini script format (including all user set up is as follows
[DATABASE]
TYPE=ORACLE
[USER]
NAME=AARCHIBALD
PASSWORD=AARCHIBALD
ENCRYPTED=FALSE
FULLNAME=A Archibald
PRIVILEGE=C
[USER]
NAME=ABAILEY
PASSWORD=ABAILEY
ENCRYPTED=FALSE
FULLNAME=A Bailey
PRIVILEGE=C
[ACL]
APPLICATION=/fusionbci
ROLE=DEFAULT ROLE
USER=AARCHIBALD
ACCESS=ENABLED
ROLE=DEFAULT ROLE
USER=ABAILEY
ACCESS=ENABLED
[SNAPSHOTVAR]
NAME=V_PDA_FBS_SITE_DRIVER
PLATFORM=WIN32
VIRTUALPATH=/fusionbci
USER=AARCHIBALD
VAR=BI_ID,99977
USER=ABAILEY
VAR=BI_ID,71028
I see in you example you have the variable declaration as
VAR=ATELIER, ('NBE')
you should just need
VAR=ATELIER, NBE
we have had problems with quotes (in our case in user names) within the file -
Date type parameters do not work package procedure
a cordial greeting to the whole community, in advance thank you very much for your precious time
a general way I have the following, a package in which I have a main procedure which I recible three parameters: a start date, a final, and a number of client
to use the dates I enter as parameter to query yields no records, but if I assign the date internally in the procedure, if it sheds records, the strange thing is that both the data and the parameters that are identical internally assigned even in its length and I checked, the truth and I stay out of ideas thank you very much for your time attaching the code
for now I'm just using the second query forget the first
------call to procedure-----
DECLARE
errcode VARCHAR2(200);
errbuf VARCHAR2(200);
BEGIN
xxxxx.pkg.xxxinitial_end(errcode ,errbuf
,'2013/08/19 00:00:00'
,'2013/08/23 00:00:00','456456456546');
END;
-----------------------------------------------------------------procedure---------------------------------------------------------------------
PROCEDURExxxinitial_end (ERRCODE OUT VARCHAR2
, ERRBUFF OUT VARCHAR2
, p_initial_date IN VARCHAR2
, p_end_date IN VARCHAR2
, customer IN VARCHAR2)IS
l_encoding_line VARCHAR2(240);
cur_without_customer SYS_REFCURSOR;
cur_with_customer SYS_REFCURSOR;
initial_date DATE;
end_date DATE;
initial_date2 DATE;
end_date2 DATE;
BEGIN
l_encoding_line := '<?xml version="1.0" encoding=' || '"iso-8859-1"' ||
' ?>' || chr(10) || '<XXOCS_TOTAL_VENTAS_SINEXP>';
initial_date := to_date(p_initial_date, 'YYYY/MM/DD HH24:MI:SS');-----------------input parameters NOT WORKING
end_date := to_date(p_end_date, 'YYYY/MM/DD HH24:MI:SS');-------------------input parameters
initial_date2:=to_date('2013/08/19 00:00:00', 'YYYY/MM/DD HH24:MI:SS');---------------------default values
end_date2:=to_date('2013/08/23 00:00:00', 'YYYY/MM/DD HH24:MI:SS');---------------------default values WORKING FINE
IF customer IS NULL THEN
-- OPEN cur_without_customer;
DBMS_OUTPUT.PUT_LINE('se ejecuto el primero');
-------------------------cursor -----------------------------------
OPEN cur_without_customer FOR
SELECT rct.customer_trx_id
,rctl.customer_trx_line_id
,hp.party_name ---cliente
,hca.account_number ----N° Cliente
,rctl.line_number -----item
,rctt.name---descripcion transaccion
,rct.trx_number -----numero
,rctt.type ------tipo de transaccion
,hp.party_id--control solamente
,rct.trx_date------Fecha de emisión Comprobante de Venta
,rct.attribute1 ---No. de autorización del Comprobante de Venta
,mp.attribute9||rct.trx_number N_Comprobante---No. de Comprobante de Venta
,rct.attribute4-----Unidad Estratégica de Negocio
,mp.attribute9---- N° de establecimiento
,rctl.description-----Descripción (Tipo de Combustible)
,rctl.quantity_invoiced---Cantidad Vendida en galones
,rctl.unit_selling_price---Precio de venta unitario
--,rctl.taxable_amount-------Valor Base Imponible --restriccion
--,rctl.extended_amount---valor iva 12%
-- ,NVL(importe_12(rctl.customer_trx_line_id,rct.customer_trx_id),'N/A')
FROM ra_customer_trx_all rct,
ra_customer_trx_lines_all rctl,
hz_cust_accounts hca,
hz_parties hp,
ra_cust_trx_types_all rctt,
mtl_parameters mp
-- mtl_system_items_b msi,
-- zx_lines zl
--ra_batch_sources_all rbs
WHERE
--rct.trx_date BETWEEN initial_date AND end_date --parametros de fecha
rct.trx_date BETWEEN to_date('2013/08/19 00:00:00', 'YYYY/MM/DD HH24:MI:SS')/*initial_date*/ AND to_date('2013/08/23 00:00:00', 'YYYY/MM/DD HH24:MI:SS')/*end_date*/
AND rct.sold_to_customer_id = hca.cust_account_id
AND hca.party_id = hp.party_id
AND rct.customer_trx_id=rctl.customer_trx_id
--AND rctl.inventory_item_id=msi.inventory_item_id
AND mp.organization_id=rctl.warehouse_id
AND rct.cust_trx_type_id = rctt.cust_trx_type_id;
print_output(fnd_file.output, l_encoding_line);
get_xml(cur_without_customer, 'G_REGISTER', 'CABECERA', ERRCODE);
IF ERRCODE = 1 THEN
ERRBUFF := 'El reporte no arrojo datos para los parametros ingresados';
ERRCODE := 2;
RETURN;
ELSIF ERRCODE = 2 THEN
ERRBUFF := SQLERRM;
RETURN;
END IF;
print_output(fnd_file.output, '</XXOCS_TOTAL_VENTAS_SINEXP>');
ELSE
-- OPEN cur_with_customer;
DBMS_OUTPUT.PUT_LINE('se ejecuto el segundo');
-----------------------cursor 2---------------------------
DBMS_OUTPUT.PUT_LINE('customer ' || customer);
DBMS_OUTPUT.PUT_LINE('ASI ESTAN ENTRANDO LOS PARAMETROS '||length(p_initial_date));
DBMS_OUTPUT.PUT_LINE('ASI ESTAN ENTRANDO LOS PARAMETROS '||length(p_end_date));
DBMS_OUTPUT.PUT_LINE('customer ' || customer);
DBMS_OUTPUT.PUT_LINE('ASI ESTAN ENTRANDO LOS PARAMETROS quemados '|| length(initial_date2));
DBMS_OUTPUT.PUT_LINE('ASI ESTAN ENTRANDO LOS PARAMETROS quemados '|| length(end_date2));
DBMS_OUTPUT.PUT_LINE('customer ' || customer);
DBMS_OUTPUT.PUT_LINE('ASI ESTAN ENTRANDO LOS PARAMETROS convertidso '|| length(initial_date));
DBMS_OUTPUT.PUT_LINE('ASI ESTAN ENTRANDO LOS PARAMETROS convertidos '|| length(end_date));
OPEN cur_with_customer FOR
SELECT rct.customer_trx_id
,rctl.customer_trx_line_id
,hp.party_name ---cliente
,hca.account_number ----N° Cliente
,rctl.line_number-----item
,rctt.name---descripcion transaccion
,rct.trx_number -----numero
,rctt.type ------tipo de transaccion
,hp.party_id---control solamente
,rct.trx_date------Fecha de emisión Comprobante de Venta
,rct.attribute1 ---No. de autorización del Comprobante de Venta
,mp.attribute9||rct.trx_number N_Comprobante--No. de Comprobante de Venta
,rct.attribute4------ Unidad Estratégica de Negocio
,mp.attribute9---------N° de establecimiento
,rctl.description---------Descripción (Tipo de Combustible)
,rctl.quantity_invoiced----Cantidad Vendida en galones
,rctl.unit_selling_price ---Precio de venta unitario
-- ,rctl.taxable_amount-------Valor Base Imponible --restriccion
-- ,rctl.extended_amount---valor iva 12%
-- ,NVL(importe_12(rctl.customer_trx_line_id,rct.customer_trx_id),'N/A')
FROM ra_customer_trx_all rct,
ra_customer_trx_lines_all rctl,
hz_cust_accounts hca,
hz_parties hp,
ra_cust_trx_types_all rctt,
mtl_parameters mp
-- mtl_system_items_b msi,
--zx_lines zl
WHERE hca.account_number=customer
AND hca.party_id=hp.party_id
AND hca.cust_account_id=rct.sold_to_customer_id
AND rct.customer_trx_id=rctl.customer_trx_id
-- AND rctl.inventory_item_id=msi.inventory_item_id
AND mp.organization_id=rctl.warehouse_id
AND rct.cust_trx_type_id = rctt.cust_trx_type_id
AND rownum = 1
AND rct.trx_date BETWEEN initial_date AND end_date;<------------when I assign these parameters( initial_date AND end_date )--are the insert by parameter initial_date2 AND end_date2 defualt
DBMS_OUTPUT.PUT_LINE('customer ' || customer);
DBMS_OUTPUT.PUT_LINE('fe inicial ' || initial_date);
DBMS_OUTPUT.PUT_LINE('fe final ' ||end_date);
print_output(fnd_file.output, l_encoding_line);
get_xml(cur_with_customer, 'G_REGISTER', 'CABECERA', ERRCODE);
IF ERRCODE = 1 THEN
ERRBUFF := 'El reporte no arrojo datos para los parametros ingresados';
ERRCODE := 2;
RETURN;
ELSIF ERRCODE = 2 THEN
ERRBUFF := SQLERRM;
RETURN;
END IF;
print_output(fnd_file.output, '</XXOCS_TOTAL_VENTAS_SINEXP>');
END IF;
EXCEPTION
WHEN OTHERS THEN
print_output(fnd_file.log, 'Error Ventas sin Exportaciones:' || SQLERRM);
ERRCODE := 2;
ERRBUFF := SQLERRM;
-- Initialization
END xxxinitial_end;Welcome. As a note, this question has nothing to do with PL/SQL XML programming and everything to do with SQL and PL/SQL
That said, the simple test case I setup, because I don't have all your tables, works just fine.
declare
l_errcode VARCHAR2(300);
l_errbuff VARCHAR2(300);
PROCEDURE xxxinitial_end (ERRCODE OUT VARCHAR2
, ERRBUFF OUT VARCHAR2
, p_initial_date IN VARCHAR2 -- why not a date?
, p_end_date IN VARCHAR2 -- why not a date?
, customer IN VARCHAR2)
IS
initial_date DATE;
end_date DATE;
l_value VARCHAR2(10);
BEGIN
initial_date := to_date(p_initial_date, 'YYYY/MM/DD HH24:MI:SS');
end_date := to_date(p_end_date, 'YYYY/MM/DD HH24:MI:SS');
-- Not trapping the No Data Found on purpose
SELECT 'hit'
INTO l_value
FROM dual
WHERE SYSDATE BETWEEN initial_date AND end_date;
END xxxinitial_end;
begin
-- Test statements here
xxxinitial_end(l_errcode, l_errbuff
,'2013/08/19 00:00:00'
,'2013/10/19 00:00:00'
,null);
end;
As a comment above says, if you are dealing with dates, why not use a DATE parameter in the procedure and avoid the conversion in your code.
Also, you can simplify your code a bit by using a third sys_refcursor and setting one of the opened cursors to it. This allows you to pull out the common logic following the OPEN and only have one copy of it.
PROCEDURE xxxinitial_end (ERRCODE OUT VARCHAR2
, ERRBUFF OUT VARCHAR2
, p_initial_date IN VARCHAR2 -- why not a date?
, p_end_date IN VARCHAR2 -- why not a date?
, customer IN VARCHAR2)
IS
l_encoding_line VARCHAR2(240);
cur_without_customer SYS_REFCURSOR;
cur_with_customer SYS_REFCURSOR;
cur_comm SYS_REFCURSOR;
initial_date DATE;
end_date DATE;
BEGIN
l_encoding_line := '<?xml version="1.0" encoding=' || '"iso-8859-1"' ||
' ?>' || chr(10) || '<XXOCS_TOTAL_VENTAS_SINEXP>';
initial_date := to_date(p_initial_date, 'YYYY/MM/DD HH24:MI:SS');-----------------input parameters NOT WORKING
end_date := to_date(p_end_date, 'YYYY/MM/DD HH24:MI:SS');-------------------input parameters
IF customer IS NULL THEN
-------------------------cursor -----------------------------------
OPEN cur_without_customer FOR
SELECT rct.customer_trx_id
,rctl.customer_trx_line_id
,hp.party_name ---cliente
,hca.account_number ----N° Cliente
,rctl.line_number -----item
,rctt.name---descripcion transaccion
,rct.trx_number -----numero
,rctt.type ------tipo de transaccion
,hp.party_id--control solamente
,rct.trx_date------Fecha de emisión Comprobante de Venta
,rct.attribute1 ---No. de autorización del Comprobante de Venta
,mp.attribute9||rct.trx_number N_Comprobante---No. de Comprobante de Venta
,rct.attribute4-----Unidad Estratégica de Negocio
,mp.attribute9---- N° de establecimiento
,rctl.description-----Descripción (Tipo de Combustible)
,rctl.quantity_invoiced---Cantidad Vendida en galones
,rctl.unit_selling_price---Precio de venta unitario
--,rctl.taxable_amount-------Valor Base Imponible --restriccion
--,rctl.extended_amount---valor iva 12%
-- ,NVL(importe_12(rctl.customer_trx_line_id,rct.customer_trx_id),'N/A')
FROM ra_customer_trx_all rct,
ra_customer_trx_lines_all rctl,
hz_cust_accounts hca,
hz_parties hp,
ra_cust_trx_types_all rctt,
mtl_parameters mp
-- mtl_system_items_b msi,
-- zx_lines zl
--ra_batch_sources_all rbs
WHERE
--rct.trx_date BETWEEN initial_date AND end_date --parametros de fecha
rct.trx_date BETWEEN to_date('2013/08/19 00:00:00', 'YYYY/MM/DD HH24:MI:SS')/*initial_date*/ AND to_date('2013/08/23 00:00:00', 'YYYY/MM/DD HH24:MI:SS')/*end_date*/
AND rct.sold_to_customer_id = hca.cust_account_id
AND hca.party_id = hp.party_id
AND rct.customer_trx_id=rctl.customer_trx_id
--AND rctl.inventory_item_id=msi.inventory_item_id
AND mp.organization_id=rctl.warehouse_id
AND rct.cust_trx_type_id = rctt.cust_trx_type_id;
cur_comm := cur_without_customer;
ELSE
-----------------------cursor 2---------------------------
OPEN cur_with_customer FOR
SELECT rct.customer_trx_id
,rctl.customer_trx_line_id
,hp.party_name ---cliente
,hca.account_number ----N° Cliente
,rctl.line_number-----item
,rctt.name---descripcion transaccion
,rct.trx_number -----numero
,rctt.type ------tipo de transaccion
,hp.party_id---control solamente
,rct.trx_date------Fecha de emisión Comprobante de Venta
,rct.attribute1 ---No. de autorización del Comprobante de Venta
,mp.attribute9||rct.trx_number N_Comprobante--No. de Comprobante de Venta
,rct.attribute4------ Unidad Estratégica de Negocio
,mp.attribute9---------N° de establecimiento
,rctl.description---------Descripción (Tipo de Combustible)
,rctl.quantity_invoiced----Cantidad Vendida en galones
,rctl.unit_selling_price ---Precio de venta unitario
-- ,rctl.taxable_amount-------Valor Base Imponible --restriccion
-- ,rctl.extended_amount---valor iva 12%
-- ,NVL(importe_12(rctl.customer_trx_line_id,rct.customer_trx_id),'N/A')
FROM ra_customer_trx_all rct,
ra_customer_trx_lines_all rctl,
hz_cust_accounts hca,
hz_parties hp,
ra_cust_trx_types_all rctt,
mtl_parameters mp
-- mtl_system_items_b msi,
--zx_lines zl
WHERE hca.account_number=customer
AND hca.party_id=hp.party_id
AND hca.cust_account_id=rct.sold_to_customer_id
AND rct.customer_trx_id=rctl.customer_trx_id
-- AND rctl.inventory_item_id=msi.inventory_item_id
AND mp.organization_id=rctl.warehouse_id
AND rct.cust_trx_type_id = rctt.cust_trx_type_id
AND rownum = 1
AND rct.trx_date BETWEEN initial_date AND end_date;<------------when I assign these parameters( initial_date AND end_date )--are the insert by parameter initial_date2 AND end_date2 defualt
cur_comm := cur_with_customer;
END IF;
print_output(fnd_file.output, l_encoding_line);
get_xml(cur_comm, 'G_REGISTER', 'CABECERA', ERRCODE);
CLOSE cur_comm;
IF ERRCODE = 1 THEN
ERRBUFF := 'El reporte no arrojo datos para los parametros ingresados';
ERRCODE := 2;
RETURN;
ELSIF ERRCODE = 2 THEN
ERRBUFF := SQLERRM;
RETURN;
END IF;
EXCEPTION
WHEN OTHERS THEN
print_output(fnd_file.log, 'Error Ventas sin Exportaciones:' || SQLERRM);
ERRCODE := 2;
ERRBUFF := SQLERRM;
-- Initialization
END xxxinitial_end; -
Hello All,
I've a SSRS monthly sales report with the sales details for current year and last year. I've 4 paramaters in the report. StartDate1,
EndDate1, StartDate2 (hidden), EndDate2 (hidden).
For
StartDate1 - Beginning of Last month -
DateAdd(DateInterval.Month, -1, DateSerial(Year(Date.Now), Month(Date.Now), 1)) (Will give me Feb 1 2015)
EndDate1 - End of Last month -
DateAdd(DateInterval.Minute, -1, DateSerial(Year(Date.Now), Month(Date.Now), 1)) (Will give me Feb 28 2015)
StartDate2 - Need to get startdate as Feb 1 2014
EndDate2 - Need to get enddate as Feb 28 2014
Any help is greatly appreciated.Hi Venkat,
My report compares sales for current year(2015) and past year(2014). Say user needs to compare sales for Feb 2014 and Feb 2015 I need to pass(Startdate2 & EndDate2) hidden parameters
I can get previous months start date using
StartDate1
DateAdd(DateInterval.Month, -1, DateSerial(Year(Date.Now), Month(Date.Now), 1)) (Will give me Feb 1 2015)
and same with EndDate1
DateAdd(DateInterval.Minute, -1, DateSerial(Year(Date.Now), Month(Date.Now), 1)) (Will give me Feb 28 2015)
How do I set startDate2 as
(Feb, 1, 2014)
and similarly EndDate2 as
Feb, 28, 2014. -
Scheduling WEBI Objects with date as parameters in InfoView
Hi,
We want to know if it is possible to schedule a WEBI Report in InfoVIew passing as parameters the actual day of execution. For example, if we scheduled a report that will run every day, we will want that every instance generated containing the data of the execution date, but when we tried to schedule this execution inside the InfoView the only options that we have is to select one date or a list of dates that will be equal for every execution of the report.
Any ideas?
Thanks a lot.
Kind RegardsHi,
For oracle you can use hard coded 'sysdate' or 'todays date' as a default text in the prompt and then at the back-end you have to decode it and and write the query that will return the todays system date.
Here is the format not the exact code:
Table.Date = decode(@prompt(.....),'sysdate',query that will fetch the todays date)
OR
Table.Date = @prompt(.....)
Regards,
Rohit -
Passing date range parameters in MDX Query
Following is my mdx query
SELECT NON EMPTY
[Measures].[Cache Attendees Count]
ON COLUMNS,
NON EMPTY
([Cache Attendees].[Visit Id].[Visit Id].ALLMEMBERS *
[Cache Attendees].[User Id].[User Id].ALLMEMBERS *
[Cache Attendees].[Screen Name].[Screen Name].ALLMEMBERS *
[Cache Attendees].[User Type Id].[User Type Id].ALLMEMBERS *
[Cache Attendees].[User Type Name].[User Type Name].ALLMEMBERS *
[Cache Attendees].[Group Date Count].[Group Date Count].ALLMEMBERS *
[Cache Attendees].[Insert Time Stamp].[Insert Time Stamp].ALLMEMBERS )
DIMENSION PROPERTIES MEMBER_CAPTION, MEMBER_UNIQUE_NAME ON ROWS FROM
SELECT
STRTOMEMBER(@FromCacheAttendeesInsertTimeStamp) : STRTOMEMBER(@ToCacheAttendeesInsertTimeStamp)
) ON COLUMNS FROM (
SELECT
STRTOSET(@CacheAttendeesConferenceId) ) ON COLUMNS FROM [Cube_Attendee])
WHERE ( IIF( STRTOSET(@CacheAttendeesConferenceId).Count = 1, STRTOSET(@CacheAttendeesConferenceId), [Cache Attendees].[Conference Id].currentmember ) )
CELL PROPERTIES VALUE, BACK_COLOR, FORE_COLOR, FORMATTED_VALUE, FORMAT_STRING, FONT_NAME, FONT_SIZE, FONT_FLAGS
I want to filter my cube with three parameters
1. @CacheAttendeesConferenceId
2. @FromCacheAttendeesInsertTimeStamp
3. @ToCacheAttendeesInsertTimeStamp
When i pass following parameters
ConferenceId = 1, StartDate='2010-01-28T00:00:00', EndDate='2010-02-03T00:00:00'
Then it show records
But When i pass following parameters
ConferenceId = 1, StartDate='2010-01-27T00:00:00', EndDate='2010-02-03T00:00:00'
Then it display message No Data Available
PLease help me on this issue why not FromDate & ToDate range works properly.Step1:- First i create a SSAS datasource. Then i create a cube for my table CacheAttendees.
It has following columns:-
[Cache Attendees].[Conference Id]
[Cache Attendees].[Group Date Count]
[Cache Attendees].[Insert Time Stamp]
[Cache Attendees].[Screen Name]
[Cache Attendees].[User Id]
[Cache Attendees].[User Type Id]
[Cache Attendees].[User Type Name]
[Cache Attendees].[Visit Id]
Step2:- Then i create a dimension with this cube with all columns.
Step3:- Then i deploy my SSAS project.
Step4:- Use SSAS datasource in my SSRS datasource.
Step5:- Create a report with chart control. Add a parameter ConferenceId. Set default to 1. When i preview my report then it show Cache Attendees].[Conference Id].[1] in header of report instead of that, When i pass the parameter value as 1 then report cannot show & throw an error. I want to pass this parameter at runtime.
Step6:- Please help me how is it possible to pass parameter at runtime.
Maybe you are looking for
-
I have an eMac I no longer use. Any advice on how to dispose of this eMac?
I have an eMac from 2002 and have upgraded to other Mac products sionce then. I would like to dispose of this computer but don't want to expose myself to anyone that could solicit information from my files. Does anyone out there have any advice for
-
PHP_OCI8 modul doesn't work with xampp
Hello guy's i've installed the newest xampp version 1.6.3a which contains php version 5.2.3. Now i have to connect with php to an external oracle database. i deleted the comments before extension=php_oci8 in the php.ini and i'have extracted the oracl
-
Firefox 4 crashes on Mac OS X 10.6.6 every time when I run any bangla site
Generally I downloaded fonts from [http://ekushey.org/?page/osx_fonts here] here. It worked fine with previous version of firefox. But in FF4 is crashing frequently. Please give solution
-
I have an ongoing frustrating problem. Java has stopped working on my pc. When I go to the java icon and open I get error "The system cannot find the registry key HKEY_LOCAL_MACHINE\SOFTWARE\Javasoft\Java Runtime Environment 1.5.0_06" If I try to uni
-
How to set Alias name for URL or change URL..
Hi: I am using Apache Tomcat as web server, it contains multiple web applications. Url for one of this application is, e.g. http://localhost:8080/myapplication. This particular url work fine. But i want to use only mypage word instead of all the abov