Query structure with parameter
Hi,
Consuming the web service, results in a xml with complex structures.
The function below query structure
<CcResultItems TemplateName="CgrInfo_1">
My question is how to reorganize query to get results from structure
<CcResultItems TemplateName="CgrOwners_4">
which should return three rows.
Regards,
Kostadin
create or replace
FUNCTION WS_SELECT_XML RETURN VARCHAR2 AS
XML_VAR XMLTYPE := XMLTYPE (
'<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Header>
<XmlSoapHeader xmlns="https://test.wstestx.com/XWS2/"/>
</soap:Header>
<soap:Body>
<ProcessRequestResponse xmlns="https://test.wstestx.com/XWS2/">
<ProcessRequestResult><![CDATA[<CcResponse>
<CcResultItems TemplateName="CgrInfo_1">
<CcResultItem><InfoMessage></InfoMessage><IsitTerminated>0</IsitTerminated><IdObject>365124</IdObject><ObjectlName>BlueRed</ObjectlName><ObjectTaxNumber>305089321502</ObjectTaxNumber></CcResultItem>
</CcResultItems>
<CcResultItems TemplateName="CgrUnits_2">
</CcResultItems>
<CcResultItems TemplateName="CgrActors_3">
<CcResultItem><IdObject>365124</IdObject><UnitNo>0</UnitNo><EntityTYPEcode>1</EntityTYPEcode><EntityTYPEdesc>Person</EntityTYPEdesc></CcResultItem>
</CcResultItems>
<CcResultItems TemplateName="CgrOwners_4">
<CcResultItem><IdObject>365124</IdObject><EntityTYPEcode>1</EntityTYPEcode><EntityTYPEdesc>Person</EntityTYPEdesc><OwnerID>610697843014</OwnerID><OwnerName>ALEX</OwnerName></CcResultItem>
<CcResultItem><IdObject>365124</IdObject><EntityTYPEcode>1</EntityTYPEcode><EntityTYPEdesc>Person</EntityTYPEdesc><OwnerID>840645947005</OwnerID><OwnerName>JOHN</OwnerName></CcResultItem>
<CcResultItem><IdObject>365124</IdObject><EntityTYPEcode>2</EntityTYPEcode><EntityTYPEdesc>Company</EntityTYPEdesc><OwnerID>703454</OwnerID><OwnerName>BROWN</OwnerName></CcResultItem>
</CcResultItems>
<CcResultItems TemplateName="CgrActivities_5">
</CcResultItems>
<CcResultItems TemplateName="CgrMembership_6">
</CcResultItems>
<CcResultItems TemplateName="CgrFounding_7">
<CcResultItem><IdObject>365124</IdObject><FoundingDate>8/16/2007 1:53:00 PM</FoundingDate><Total>146701.00</Total></CcResultItem>
</CcResultItems>
</CcResponse>]]></ProcessRequestResult>
</ProcessRequestResponse>
</soap:Body>
</soap:Envelope>
BEGIN
FOR R IN (
WITH T AS( SELECT ( XML_VAR ) COL FROM DUAL)
SELECT x2.*
FROM XMLTable(
XMLNamespaces(
'http://www.w3.org/2003/05/soap-envelope' AS "soap"
, default 'https://test.wstestx.com/XWS2/'
, 'soap:Envelope/soap:Body/ProcessRequestResponse/ProcessRequestResult'
passing XML_VAR
columns CcResponse clob path '.'
) x1
, XMLTABLE(
'/CcResponse/CcResultItems'
PASSING XMLPARSE(DOCUMENT X1.CCRESPONSE)
COLUMNS
TemplateName VARCHAR2(140) PATH '@TemplateName'
, IDOBJECT VARCHAR2(140) PATH 'CcResultItem/IdObject'
, OBJECTLNAME VARCHAR2(340) PATH 'CcResultItem/ObjectlName'
, VRSKA VARCHAR2(140) PATH 'CcResultItem'
) X2
WHERE X2.TemplateName ='CgrInfo_1'
-- WHERE X2.TemplateName ='CgrActors_3'
-- WHERE X2.TemplateName ='CgrOwners_4'
) LOOP
DBMS_OUTPUT.PUT_LINE( ' IdObject: ' || R.IDOBJECT || ' ObjectlName: ' || R.ObjectlName || ' TemplateName '||R.TemplateName);
END LOOP;
DBMS_OUTPUT.PUT_LINE( '-- end --' );
RETURN NULL;
END WS_SELECT_XML;
Based on your query, I am going to assume that you started with
Extract data from webservice response
I believe this is the modification that you are looking for
FOR R IN (
SELECT x2.TemplateName, x3.idobject, x3.OWNERID
FROM XMLTable(
XMLNamespaces(
'http://www.w3.org/2003/05/soap-envelope' AS "soap"
, default 'https://test.wstestx.com/XWS2/'
, 'soap:Envelope/soap:Body/ProcessRequestResponse/ProcessRequestResult'
passing XML_VAR
columns
CcResponse clob path '.'
) x1
, XMLTABLE(
'/CcResponse/CcResultItems[@TemplateName="CgrOwners_4"]'
PASSING XMLPARSE(DOCUMENT X1.CCRESPONSE)
COLUMNS
TemplateName VARCHAR2(20) PATH '@TemplateName'
, ItemXML XMLTYPE PATH 'CcResultItem'
) X2
, XMLTABLE(
'/CcResultItem'
PASSING x2.itemXML
COLUMNS
IDOBJECT VARCHAR2(20) PATH 'IdObject'
, OWNERID VARCHAR2(20) PATH 'OwnerID'
) X3
As Odie's post points out. The first XMLTable (x1) retrieves the contents of ProcessRequestRequest and by doing so, removes the CDATA tag. We now have a CLOB that looks like XML. The second XMLTable (x2) converts that CLOB into an XMLType and looks for the node that matches the XPath. This is where I hard-coded in your request to look for a specific node. As that desired node has a repeating structure that you want to retrieve each row for, I passed the repeating structure into the third XMLTable (x3) so it could parse them. You could combine x2 and x3 by using XQuery, but I would suggest starting with this method as I find it is easier to understand what is happening.
To test this outside of your code, simply replace the line
passing XML_VAR
with
passing XMLTYPE('...contents of the SOAP Message...')
and run the query. You can do this to debug the query as you and simply do a SELECT * to see what all is being passed from XMLTable to XMLTable this way to verify the correct data is being passed.
Similar Messages
-
Dynamic query structures with restrictions - is this possible
Hi experts,
We have a client that has hard coded query structures, much to our chagrin. These structures change quarterly and because the structures are used across several queries and workbooks, I need to find a new solution that will makes the dynamic and can be updated in production. We have investigated the use of hierarchies for this, and unfortunately this will not work.
Also, their queries are locked down in production, so all changes must transport from Dev to QA to Production. This setting is mandated from the parent company, so changing this is not possible.
Question: Is it possible to write a WebDynpro or ABAP program that will allow users to change these hard coded structures? What tables would be used for this? I'm hoping we can create custom tables that dynamically populate the structures of the query, but I have doubts this can be done.
I suspect this is a stretch, but I'm hoping somebody might have attempted this.
Any ideas would be appreciated. We're proficient in BI so any suggestions would be great.
Example structure:
P&L Structure
Revenue ......................(restricted on Revenue GL accounts)
Out of Pocket Revenue.....(restricted on Out of Pocket GL accounts)
Total Revenue...................(total of the Revenue and Out of Pocket Revenue from above)
Best,
Larry...to put a maintainable table in front of the users can be as easy as creating a 'parameters' cube and putting an input ready query on it. Lots of other options, such as a simple custom table and a gui based form to maintain, but I've used exit variables looking up values from custom parameter cubes a great deal in planning applications.
Another alternative may be to add a new attribute to your gl accounts to indicate the nominal reporting group, and base your variable exits or row structures on that, leaving your users simply to mainain their GL Account Mastre data as required.
Edited by: Andrew Trousdell on Jun 18, 2010 4:07 AM -
Query structure with does not display all rows in VC
Hello Gurus,
I am trying to build a query based VC application.
I have a Row structure and Column structure in the query, but when I drag the query into ivew, I only see name of the structure but not the rows in the structure. At the same time when I deploy it is showing me all the rows in the result. I also did "Define/test query" and pressed the "Generate" button, but It is showing me only Colum struture rows but not Row strucure rows.
Any help in this issues is very much appreciated.
Thanks in advance
ganeshHi Mario,
To overcome this limitation is possible to substitute the VC Table with WAD Table and keep the functionality of send events (like open a pop-up after user click)?
Best Regards,
Marcos -
SSRS report with tabular model - MDX query to filter parameter data based on Tuple value.
Hello Everyone,
I am working on SSRS report in which a tabular model is being used as a backend.
I want to filter the report parameters which are dependent to other parameters. Like, country, state, and cities drop downs.
All are multi-select parameters. I am using MDX queries to filter the parameters data.
Based on selected one or more countries, the data of states needs to be filtered.
The point is the text which is being displayed in state dropdown for each state name is combination of 3 different members.
So, I created the following Tuple for the same and can see the expected display names in states dropdown.
"("+
[Location].[Code 1].CURRENTMEMBER.UNIQUENAME +","+
[Location].[Code 2].CURRENTMEMBER.UNIQUENAME +","+
[Location].[Descr].CURRENTMEMBER.UNIQUENAME +")"
Now, when I would like filter the cities data based on selected one or more states, I am unable to pass the multiple Tuples (more than one selected Tuples) as parameter for cities dropdown.
The following is my query for City parameter. It is working well when I select only one State from the dropdown.
However, when I select multiple states, it is unable to convert the Tuple into SET in ELSE part of IIF condition specified in following query.
Can anybody help me how to resolve the error that I am getting about STRTOSET function?
Or
Are there any other alternatives to achieve this requirement?
Any help would be much appreciated.
Query:
WITH MEMBER [Measures].[ParameterCaption] AS [City].[City Business].CURRENTMEMBER.MEMBER_CAPTION
MEMBER [Measures].[ParameterValue] AS [City].[City Business].CURRENTMEMBER.UNIQUENAME
MEMBER [Measures].[ParameterLevel] AS [City].[City Business].CURRENTMEMBER.LEVEL.ORDINAL
SELECT {[Measures].[ParameterCaption], [Measures].[ParameterValue], [Measures].[ParameterLevel]} ON COLUMNS ,
[City].[City Business].Children ON ROWS
FROM (
SELECT ( STRTOSET(@State, CONSTRAINED) ) ON COLUMNS FROM [Model])
WHERE ( IIF( STRTOSET(@State).Count= 1,
STRTOTUPLE(@State, CONSTRAINED),
STRTOSET("{
("+
[Location].[Code 1].CURRENTMEMBER.UNIQUENAME +","+
[Location].[Code 2].CURRENTMEMBER.UNIQUENAME +","+
[Location].[Descr].CURRENTMEMBER.UNIQUENAME
+ ")
}",CONSTRAINED )) ) CELL PROPERTIES VALUE
Thanks, Ankit Shah
Inkey Solutions, India.
Microsoft Certified Business Management Solutions Professionals
http://www.inkeysolutions.com/MicrosoftDynamicsCRM.htmlHi,
I used following dynamic query in expression of dataset of parameter and it works like a charm.
"WITH MEMBER [Measures].[ParameterCaption] AS [City].[City Business].CURRENTMEMBER.MEMBER_CAPTION "&
"MEMBER [Measures].[ParameterValue] AS [City].[City Business].CURRENTMEMBER.UNIQUENAME "&
"MEMBER [Measures].[ParameterLevel] AS [City].[City Business].CURRENTMEMBER.LEVEL.ORDINAL "&
"SELECT {[Measures].[ParameterCaption], [Measures].[ParameterValue], [Measures].[ParameterLevel]} ON COLUMNS , " &
"[City].[City Business].Children ON ROWS " &
" FROM [Model] WHERE ({"& join(Parameters!Location.Value,",") &"}) CELL PROPERTIES VALUE"
Thanks, Ankit Shah
Inkey Solutions, India.
Microsoft Certified Business Management Solutions Professionals
http://www.inkeysolutions.com/MicrosoftDynamicsCRM.html -
Issues with Bex query structures and Crystal Reports/Webi
Hi experts,
I'm having an issue with Bex Query structures and nulls. I've built a Crystal Report against a Bex query that uses a Bex Query structure. The structure looks like the following
Budget $
Budget %
Actual $
Actual %
Budget YTD
etc
if I drag the structure into the Crystal Report detail section with a key figure it displays like this
Budget $ <null>
Budget % <null>
Actual $ 300
Actual % 85
Budget YTD 250
the null values are displayed (and this is what is required). However if I filter using a Record selection or group on a profit centre then the nulls along with the associated structure component are not displayed.
Actual $ 300
Actual % 85
Budget YTD 250
Webi is also behaving similarly. Can anyone explain why the above is happening and suggest a solution either on the Bex side of things or on the Crystal Reports side of things? I'm confused as to why nulls are displayed in the first example and not the second.
Business Objects Edge 3.1 SP2
SAP Int Kit SP2
OS: Linux
BW 701 Level 6
Crystal Reports 2008 V1
Thanks
KeithHi,
Crystal Reports and Web Intelligence will only show data which is in the cube. You could have an actual 0 or Null entry whithout grouping but by changing the selection / grouping in the report the data does not include such entry anymore.
ingo -
CANT execute query with parameter on user defined tables using query genera
Dear All,
I have problem when executing query with parameter on user defined tables using query generator.
It seems SBO cannot accept parameter to query user defined tables.
I've tried these:
SELECT T0.U_Status FROM [@ST_PR_H] T0 WHERE T0.U_Status = [%0] --- this FAIL
I try to pass the value directly without using parameter and It works
SELECT T0.U_Status FROM [@ST_PR_H] T0 WHERE T0.U_Status = 2 --- this SUCCESS
This one works
SELECT * FROM RDOC T0 WHERE T0.width =[%0] --- this SUCCESS
and this one works too
SELECT * FROM RDOC T0 WHERE T0.width = 595 --- this SUCCESS
Is there anyone can help me ....???
Thanks,
AlfaI generated this code using query wizard ....
SELECT T0.[U_Status] AS 'Document Status' FROM [dbo].[@ST_PR_H] T0 WHERE T0.[U_Status] = (N'2' )
and replaced the (N'2' ) with [%0]
SELECT T0.[U_Status] AS 'Document Status' FROM [dbo].[@ST_PR_H] T0 WHERE T0.[U_Status] = [%0]
and It worked ......
Thanks 4 all ..... -
Send values to IN query with parameter
Subject: send values to IN query with parameter
Hello. Hope I'll explain my problem well enough:
I have a query:
-- select id from table where id in ('100')
Now I used parameter for the IN part:
-- select id from table where id in (:param)
and I gave the parameter the value 100.
now I want to have the query with two values:
-- select id from table where id in ('100','200')
I tried to use the parameter and give him the value of: '100','200'.
It didn't worked :(
Is there a syntax to give the parameter more then one value for the IN query (with out using another table or function etc')?
Thanks in advance,Roy.This is the best solution I have for it.
variable parameter varchar2(4000);
exec :parameter := 'SYSTEM,SYS';
select username
from dba_users
where username in ( select COLUMN_VALUE from table (split_string(:parameter,',')))It uses this function
CREATE OR REPLACE
type string_table as table of varchar2(4000)
CREATE OR REPLACE
FUNCTION split_string (
string IN varchar2,
delimiter IN varchar2
) RETURN string_table IS
tab string_table;
pre integer;
post integer;
step integer;
i integer;
BEGIN
pre := 1;
step := length(delimiter);
i := 0;
tab := string_table();
loop
tab.extend;
i := i + 1;
post := instr(string,delimiter,pre);
if ( post = 0 ) then
tab(i) := substr(string,pre);
return tab;
end if;
tab(i) := substr(string,pre,post-pre);
pre := post + step;
end loop;
END;
/Bye Alessandro -
How to work with sap bw bex query structure
Dear Friends,
How can we use SAP BW bex query structure in crystal reports.
Thanks with regards.
Maliki have two structure in my query.
and structure is comming in my Crystal report.
i have 10 memebers in that structure and i make display off for some of members .
but in crystal all of members are comming either its property is hidden or not.
any help higly appricated.
Regards
Malik -
Structure with a string field as parameter in FM
Hi,
I have a requirement wherein based on some id which is the import paramter (table) i have to fetch some text of type string n pass as an export paramater. it has to be a table since for each id there wil a text associated with it.
For this i have declared a structure with two fields, one client and the other, the text type string.
While trying to activate my fm, it says that italicsthe structure should be a flat type. You cannot use internal tables. string, references etcitalics
Please provide a solution.
Regards,
herwin.Hi Vikranth,
ya using char or lchar would be one option and the other would be the use of the table type in the the import/export parameters. That worked without giving me that warning message and was able to execute my code properly with the desired output.
Regards,
Herwin.
Edited by: Herwin Wilmet Dsouza on May 11, 2010 12:18 PM -
ORDS Template with parameter does not work
Hello everybody,
I can not get working a RESTful Service using the ORDS_SERVICES -API (ORDS version 3.0.0.343.07.58), same Query without parameter (hardcoded product_id) works fine.
declare
l_module_id number;
l_template_id number;
l_handler_id number;
l_parameter_id number;
begin
ORDS_SERVICES.delete_module(p_name => 'test_parameter');
l_module_id := ORDS_SERVICES.create_module(p_name => 'test_parameter',
p_uri_prefix => '/test_parameter',
p_items_per_page => 10,
p_status => 'PUBLISHED',
p_comments => null);
l_template_id := ORDS_SERVICES.add_template(p_module_id => l_module_id,
p_uri_template => '/demo_product_info_10/',
p_priority => 0,
p_etag_type => 'HASH',
p_etag_query => null,
p_comments => null);
l_handler_id := ORDS_SERVICES.add_handler(p_template_id => l_template_id,
p_source_type => 'MEDIA', -- source_type IN ('COLLECTION_FEED', 'COLLECTION_ITEM', 'FEED', 'MEDIA', 'PLSQL', 'QUERY', 'QUERY_1_ROW')
p_source => 'select mimetype, product_image from demo_product_info where product_id = 2',
p_format => 'DEFAULT',
p_method => 'GET',
p_items_per_page => null,
p_mimes_allowed => null,
p_comments => null);
/* now same result but with parameter */
l_template_id := ORDS_SERVICES.add_template(p_module_id => l_module_id,
p_uri_template => '/demo_product_info/{product_id}',
p_priority => 0,
p_etag_type => 'HASH',
p_etag_query => null,
p_comments => null);
l_handler_id := ORDS_SERVICES.add_handler(p_template_id => l_template_id,
p_source_type => 'MEDIA', -- source_type IN ('COLLECTION_FEED', 'COLLECTION_ITEM', 'FEED', 'MEDIA', 'PLSQL', 'QUERY', 'QUERY_1_ROW')
p_source => 'select mimetype, product_image from demo_product_info where product_id = :product_id',
p_format => 'DEFAULT',
p_method => 'GET',
p_items_per_page => null,
p_mimes_allowed => null,
p_comments => null);
l_parameter_id := ORDS_SERVICES.add_parameter(p_handler_id => l_handler_id,
p_name => 'product_id',
p_bind_variable_name => 'product_id',
p_source_type => 'URI',
p_param_type => 'INT',
p_access_method => 'IN',
p_comments => null);
commit;
end;
The first template works fine:
http://localhost:8080/ords/xxx/test_parameter/demo_product_info_10/
shows a jpeg image of a wallet.
The second template does not work:
http://localhost:8080/ords/xxx/test_parameter/demo_product_info/10/
fails with error:
mapped request using: BasePathMapper [basePath=/xxx/] to: SCHEMA:apex|XXX
Choosing: oracle.dbtools.http.dispatch.DispatchMetaData as current candidate with score: MetaDataScore [score=0, matchedMethod= GET: {10299, false}
common: CommonMetaData [accepts=[], cors=null, documentation=null, frameOptions=null, pageSize=10, pagination=NONE, requiresPrivilege=null, transport=null]
, matchedPattern= /test_parameter/demo_product_info/{product_id}
common: CommonMetaData [accepts=[], cors=null, documentation=null, frameOptions=null, pageSize=null, pagination=null, requiresPrivilege=null, transport=null]
methods:
GET: {10299, false}
common: CommonMetaData [accepts=[], cors=null, documentation=null, frameOptions=null, pageSize=10, pagination=NONE, requiresPrivilege=null, transport=null]
stack trace:
oracle.dbtools.http.errors.InternalServerException: java.lang.IllegalArgumentException: INT
at oracle.dbtools.http.errors.ErrorPageFilter.internalError(ErrorPageFilter.java:165)
at oracle.dbtools.http.errors.ErrorPageFilter.doFilter(ErrorPageFilter.java:113)
at oracle.dbtools.http.filters.HttpFilter.doFilter(HttpFilter.java:44)
at oracle.dbtools.http.filters.FilterChainImpl.doFilter(FilterChainImpl.java:51)
at oracle.dbtools.http.cors.CORSFilter.doFilter(CORSFilter.java:35)
at oracle.dbtools.http.filters.HttpFilter.doFilter(HttpFilter.java:44)
I changed the add_parameter-call p_param_type => 'INT' to be p_param_type => 'STRING'
then error remains the same and strack trace says
oracle.dbtools.http.errors.InternalServerException: java.lang.IllegalArgumentException: STRING
at oracle.dbtools.http.errors.ErrorPageFilter.internalError(ErrorPageFilter.java:165)
at oracle.dbtools.http.errors.ErrorPageFilter.doFilter(ErrorPageFilter.java:113)
Could you please confirm and fix,
kind regards,
TomThis is a guess, but I suspect that ords_services.add_parameter() is not required at all.
Also, your URL /demo_product_info/10/ should not have the trailing slash (according to your template URI).
For more information, I suggest you look here:
ords.3.0.0.343.07.58.zip\ords.war\scripts\migrate\core\ords_migrate.plb
The migration package will show what is usually done for templates that already exist within APEX 4.2. I checked my templates and the ones with URI variables {in-curly-brackets} contain no records in apex_040200.wwv_flow_rt$parameters.
-Kris -
Is it possible to create a spatial view with paramete?
Is it possible to create a view with parameter like following:
SELECT GEOM FROM INTERSTATES WHERE MDSYS.SDO_FILTER(GEOM, MDSYS.SDO_GEOMETRY(2003, 8307, NULL, MDSYS.SDO_ELEM_INFO_ARRAY(1, 1003, 3), MDSYS.SDO_ORDINATE_ARRAY(?, ?, ?, ?)), 'querytype=WINDOW') = 'TRUE'
so that I can specify ???? at run time.
If not, is there a way to create a view that perform variable window query?You may want to look at application contexts, that way you may have code something like this:
create or replace context gis_ctx using gis_params ;
create or replace package gis_params
as
procedure set_bounds( minx in number, miny in number, maxx in number,maxy in number );
end;
create or replace package body gis_params
as
procedure set_bounds( minx in number, miny in number, maxx in number,maxy in number )
is
begin
dbms_session.set_context( 'gis_ctx', 'minx', minx);
dbms_session.set_context( 'gis_ctx', 'miny', miny);
dbms_session.set_context( 'gis_ctx', 'maxx', maxx);
dbms_session.set_context( 'gis_ctx', 'maxy', maxy);
end ;
end ;
To use this method you´ll have to execute
gis_params.set_bounds(-3,40,-2.9,40.1) ;
before doing the select.
SELECT GEOM
FROM INTERSTATES
WHERE MDSYS.SDO_FILTER(GEOM,
MDSYS.SDO_GEOMETRY(2003,
8307,
NULL,
MDSYS.SDO_ELEM_INFO_ARRAY(1, 1003, 3),
MDSYS.SDO_ORDINATE_ARRAY(sys_context ('gis_ctx', 'minx'),
sys_context ('gis_ctx', 'miny'),
sys_context ('gis_ctx', 'maxx'),
sys_context ('gis_ctx', 'maxy'))),
'querytype=WINDOW') = 'TRUE' ;
I f you are in a web environment, read about GLOBAL CONTEXT ACCESSED GLOBALLY .
Regards, Nico. -
Pass query result as parameter to javascript
Hello,
I'm a beginner with javascript, so (maybe) sorry for this
question.
Is it possible to use a query result as parameter in a
javascript function
for example like this?
<cfquery name="select_data">
select name from user_table
</cfquery>
<script language="javascript">
function(#select_data.name#)
</script>
Background is: I have to validate an input field with some
values which are saved in a database table.
This values can be dynamic , so I don't want to put this
values into the cfm-file.
Any ideas?
ClaudiaEach column in a cf query is effectively a 1D array. You can
use the toscript function to send this array to js. -
Hi,
I am using OLE DB Source to fetch the records with Data Access Mode as SQL COMMAND which is using the below query with a parameter,
SELECT CON.Title,CON.FirstName,EMP.MaritalStatus,EMP.Gender,EMP.Title AS Designation, EMP.HireDate, EMP.BirthDate,CON.EmailAddress, CON.Phone
from HumanResources.Employee EMP INNER JOIN Person.Contact CON ON EMP.ContactID=CON.ContactID WHERE EMP.Title in (?)
In this query for the parameter I am passing the value from a variable and which is configured (XML Configuration). While passing value
Buyer it works correctly. But while passing values Accountant,Buyer
it is not working as expected.
How to handle while passing such multiple values Or is it possible to pass such values or not in SSIS 2012 ?
Kindly help me to find a solution.
NOTE: I placed the whole query in a variable as a expression as below it is working fine.
"select CON.Title,CON.FirstName,EMP.MaritalStatus,EMP.Gender,EMP.Title AS Designation,EMP.HireDate,EMP.BirthDate,CON.EmailAddress,CON.Phone from HumanResources.Employee EMP
INNER JOIN Person.Contact CON ON EMP.ContactID=CON.ContactID WHERE EMP.Title in ('" + REPLACE(@[User::temp],",","','") +"')"
Any other solution is there ? without placing the query in a variable. May be a variable can have some limitations for no. of characters stored not sure just a thought.
SridharPutting the whole thing into a variable is certainly a valid solution. The other involves putting the comma delimited list into a table valued variable.
http://gallery.technet.microsoft.com/scriptcenter/T-SQL-Script-to-Split-a-308206f3
For an odd ball approach:
http://www.sqlmovers.com/shredding_multiline_column_using_xml/ .
Russel Loski, MCT, MCSE Data Platform/Business Intelligence. Twitter: @sqlmovers; blog: www.sqlmovers.com -
Does BOXI support crystal reports with parameter references in formulas?
I am designing a report in Crystal Reports XI Developer that contains parameters, which are passed to a stored procedure and are also used within formulas ( in Crystal Syntax ie. {?FORMAT_ID} ) in the report itself.
I can run the report successfully in CRXI Developer. The formulas use the correct values from the parameters entered during execution and everything looks good.
I then deploy the report to Business Objects Enterprise XI. I do all of the things necessary to manage the report including setting up the proper database connection information and default parameter values.
When I run the report using the Crystal Report Viewer, I get the following error message:
Error in File Forecasting.rpt:
Error in formula <Report Format>.
'if (not isNull({?FORMAT_ID} ) ) then
This field name is not known.
Details: errorKind
This happens when I press the "Preview" button in the Manage Object dialog from Crystal or when I run the report using InfoView.
I have changed the formulas and it doesn't seem to matter what the specific content of the formula is; other than the existence of a parameter reference in the formula. If I comment out the parameter and replace it with a hard-coded value, it gets through the formula fine.
Does Business Objects Enterprise XI support crystal reports with parameter references in the formulas?
Thanks,
Tim H.Hi,
In Crystal Reports under File -> Report Options >check convert Null Values to default > Verify on first refresh > Verify stored procedures on first refresh.
This corrected the issue by allowing the query engine time to locate those columns and map them to the query being sent by the report.
The convert null values was added because those field were being used in the record selection and grouping.
Regards,
Vinay -
Problems with Parameter Mapping
Hi All,
I have problems with parameter-mapping. For me its a black box, sometimes it works sometimes not.
Lots of times my mappings doesnt work, and I dont know the reason.
For example: I want to map my Execution-CO to the Display-CO. For that I map the in the affected Action.
But it doesnt work, although I do have the same Context Structures, because its the same CO. The technical Name is also the same.
What could it be?
Thanks for answering me
Bye SteveHi Andre,
sorry for my late answer, but I'm writing my diploma thesis and wasnt at work since wednesday and so I dont have a access to our GP-System.
Hope I understood you right.
The Use Case of parameter mapping is that Users of further steps has the possibility to see the Input of previous steps.
When I dont map the parameter inside one action, it isnt possible. I tried it out with the SAP example "Time-off-process". I took the CO "Create Request" and add it in one Action (as Display & Execution). When I understand you right mapping inside an action is not necessary, to see the Inputs from further Actions --> But this way I cannot see the Inputs.
The mapping of my application works before I changed it.
I know never touch a running system, but It was necessary, we need a new Input and Output Parameter.
Cause I have 20 parameter the mapping was very time-consuming, to map every single parameter. I read a method to reduce the time: Adding a structure requires only mapping of the two structures. But now the Mapping doesnt work.
Hope you can help me
Bye Steve
Maybe you are looking for
-
Printing multiple envelopes from address book with Lion
I am having trouble getting envelopes to print properly from Address Book in Lion. I have specified size #10 envelopes. When I print them, the text printed on successive envelopes moves further and further down the page until the address drops off
-
Picture Button Border Stay on in first Tab in Infopath
Hi Guys, I have created the Tab Navigation using Picture Button and View combination in InfoPath for the SharePoint List. Has anyone come across an issue Border stays on the First Picture Button when another button is selected. For example, When I se
-
Tcode SM52 shows Runtime error.
Hi, This is newly installed CRM server on windows 2003, oracle 10i, basis rel 701, kernel patch level 55 Runtime error shows once executing SM52 FOR VIRTUAL MACHINE CONTAINer. Please check the below runtime error. Runtime Errors COMPUTE_FLOAT
-
hey i got my new mac today, macbook 2.2ghz the wifi is working great im using a dg834n router. im glad to be on a mac from a pc :P i was not sure if to install 10.5.1 incase it killed my wifi as i see loads of over people losing it. is this 10.5.1 re
-
Preview Changes File to 72 dpi upon opening
Hi, I have a file that's 3300x4200 pixels at 300 dpi (so it would print as an 11"x14" print on a 300 dpi printer). The file size is too large to upload to the print on demand website that I'm trying to upload it too. My plan was to open it in Preview