Query Template restricted to 32 Params

Hi All,
I have more than 50 Params on Screen to be inserted into database through MII
Solution 1: I can send this as one param by selecting all the variables in one variable (through dynamic SQL Query)
but this is not good practice as it is is not secured due to SQL injection
Solution2 : I can have two tables and distribute the variables from the screen in these two tables (as Query templates restrict me to have 32 Params)
Can anyone suggest me a better solution keeping in mind security and Best Practices
Thanks in advance
Regards
Namita

Hi Namitha,
1) If you are using MSSQL server then you can still go for Dynamic SQL but instead of using your Dynamic SQL statement directly in Query Template Write a Stored procedure and inside procedure write the Dynamic SQL statement passing this as string parameter. And call this stored procedure from Query template.
Since Stored Procedure is stored at server and hence not visible or in-accessible to anyone or end user
So chances of SQL injection is minimal or no chance.
2) But If you are using Oracle then you can do something like this:-
Assuming that you are not sure of how many rows you need to insert. It comes on fly from front-end.
Say for example, you need to insert two rows, each row having 50 or more fields(columns).
In JavaScript write a small routine in which you append each field separated by comma( , ) or any character you feel convenient and then prepare the second row in same way and then append it with first row separated by semicolon( ; ) or any character you feel convenient.
follow same approach for any number of rows using loops.
So you will get just one Parameter string carrying all the rows and fields.
Pass this to a stored procedure thru query template.
and perform this logic
char_position := instr(STR,',');
field_value :=to_number(substr(STR,1,char_position-1));
STR := substr(STR,char_position+length(','));
Use the above code for un-stringing or to get the rows appended.
then use the above same code within each row and loop untill you finish un-stringing all the rows.
where STR is your appended string passed from front-end.
Hope this helps!!
Regards,
Adarsh S P

Similar Messages

  • Calling Oracle stored procedure from xMII Query Templates.

    Hi All,
    We have a requirement to call a Oracle stored procedure from xMII, the SP expects some inputs and then it returns multiple rows.
    I tried different approches with no results, I remember some posts on the same topic but I could not get in search results.
    Looking for some help in this regards
    Rupesh.

    Hi Rupesh Bajaj,
    In oracle stored procedure we have to use Packages..if you used packages the u have to assign to some variable.
    To calling Stored procedure  in Query Template is CALL Testing('[Param.1]','[Param.2]',,:X)
    In above line Testing is Stored procedure name and Param.1 is parameters and X is Package.
    Thanks
    Ravilla Ramesh

  • Query template transform

    hi all,
    it is possible to set Param.1, Param.2...... at transform of query template
    -murali

    hi alin,
    i try to retrieving certain range of values from xml file.i used following ways each of them have certain restrictions.
    1)i set source url in xml query it gives data's, now i want to filter the data's by setting limits for example my column"A" have 10 rows values are 1,2,3,4..10. inthis i want to retrieve data's like  "4<=A(column)<=7". so my output only 4,5,6,7.
    so give idea to achieve this one in XML query.
    2)i used BLS, in this  reteriving  a datas  like "columns<=4"  so my output is 1,2,3,,4 not able setting starting and ending ranges.
    3)i used  transform at xml query template, i set Inline Transform=http://localhost/Illuminator/StyleSheets/GenericSortFilter.xsl,
    Parameter Name=FilterExpr,Parameter Valu -columnname(A)=4,columnname(A)=5,columnname(A)=6,columnname(A)=7. i got the out puts 4,5,6,7. so i want to dynamicaly pass the values thats why i am asking how to set param.
    4) till i am not clear how to set Param in source url
    please expaline me
    thanks and regards,
    Muralli

  • Problem Calling MaxDB stored procedure with output from MII Query template

    Hi,
    I am using Max DB Database studio to write stored procedure, I am calling stored procedure from MII Query using CALL statement.
    Can anyone guide me how to pass output values of stored procedure.
    Examlpe::
    call ProcName('[Param.1]','[Param.2]','[Param.3]','[Param.4]','[Param.5]', :isSuccess, :Trace)
    In the above line of code I am not able to get the output values of stored procedure that is isSuccess and Trace values in Query template when executed. But same thing I get when executed in Database studio.
    How do I call with outputs for any stored procedure in MII.
    Any help would be appriciated.
    Thanks,
    Padma

    My call statement is like this
    call RESULTDATA_INSERT('[Param.1]','[Param.2]','[Param.3]', :isSuccess, :Trace)
    I am able to insert record in DB, But I am not getting output values in Query template.I have done this in Fixed Query, when I execute it throws me "Fatal error as Loaded content empty".
    I tried giving select below call but it dont work.
    Regards,
    Rao

  • How to use ColumnList MOde in Query Template

    Hi,
    I am working on SAP MII 11.5 and having trouble with SQL Query Template with Column List mode.
    It is throughing an error "Enter a table Name.
    Please help me in this regard

    You will need to use the Group parameter with the table name.
    <PARAM NAME="Group" VALUE="Employees">
    You can also set it with javascript for interactive use that would emulate the Template Editor:
    document.APPLET.getQueryObject().setGroup("Employees");

  • Problem of using Parameters in Query templates

    Hi,
      how do use parameter values in SQL query in query templates? i have 2 field database no1, no2. i want to filter it by no2 by using param. i gave in filter field of query template as order1.no2 like '[Param.1]' and in parameters as % and clicked set. when i test it, it is showing error..
    help me.
    - senthil

    Hi,
       I tried that mode is query, filter expr is order1.no2 like '[Param.1]'  and  in parameters % . It is showing all the cols.
    -vijaya

  • Error : Query Templates

    hi all,
    In Query Templates(SQL and TAG), while selecting server name, its not displaying "modes" for it.
    In Java console it is showing error as
    <b>ERROR - Server is currently disabled (IDBC).
    ERROR - The execution mode (CurrentWrite) is not supported with this Server or Content-Type.</b>
    The connection is enabled in xMII. And i have also checked the connection status and it is showing success.
    Where can i check the status for IDBC server?
    Please help me
    Thanks in advance
    Muzammil

    Hi Jamie,
    Below given the log details from Java console . I have tried opening SQL Query Template. I cant understand why it is showing error in mode CurrentWrite even i am trying to  open SQL Query Template...
    ConsoleLogger::Creating NEW instance...
    ConsoleLogger::Creating NEW instance...
    ConsoleLogger::Debug is true
    ConsoleLogger::Debug is true
    Attempting to read localization information
    execute(http://locolhost/Lighthammer/Illuminator,null,Language=&FileName=Messages&Service=Localization&Content-Type=raw/binary) called
    Localization information has been loaded.
    execute(http://locolhost/Lighthammer/Illuminator,application/x-www-form-urlencoded,Service=PropertyAccessService&Mode=Retrieve&Content-Type=raw/binary&PropName=IllumLoginName) called
    Username is muzammil
    execute(http://locolhost/Lighthammer/Illuminator,application/x-www-form-urlencoded,Content-Type=raw/binary&Service=PingToken&Token=TemplateEditor&ObjectName=SystemPermissionMaps) called
    Attempting to read localization information
    execute(http://locolhost/Lighthammer/Illuminator,null,Language=&FileName=Applet&Service=Localization&Content-Type=raw/binary) called
    Localization information has been loaded.
    execute(http://locolhost/Lighthammer/Illuminator,null,Service=TemplateService&Mode=Load&Content-Type=raw/binary&IncludeDocType=true&TemplateName=Predefined/ServerListQuery) called
    execute(http://locolhost/Lighthammer/Illuminator,null,Service=TemplateService&Mode=Load&Content-Type=raw/binary&IncludeDocType=true&TemplateName=Predefined/ServerBrowser) called
    execute(http://locolhost/Lighthammer/Illuminator,null,Service=TemplateService&Mode=Load&Content-Type=raw/binary&IncludeDocType=true&TemplateName=Predefined/ModeListQuery) called
    execute(http://locolhost/Lighthammer/Illuminator,null,Service=TemplateService&Mode=Load&Content-Type=raw/binary&IncludeDocType=true&TemplateName=Predefined/ModeBrowser) called
    execute(http://locolhost/Lighthammer/Illuminator,null,Service=TemplateService&Mode=Load&Content-Type=raw/binary&IncludeDocType=true&TemplateName=Predefined/TimePeriodListQuery) called
    execute(http://locolhost/Lighthammer/Illuminator,null,Service=TemplateService&Mode=Load&Content-Type=raw/binary&IncludeDocType=true&TemplateName=Predefined/TimePeriodBrowser) called
    execute(http://locolhost/Lighthammer/Illuminator,null,Service=TemplateService&Mode=Load&Content-Type=raw/binary&IncludeDocType=true&TemplateName=Predefined/ScheduleListQuery) called
    execute(http://locolhost/Lighthammer/Illuminator,null,Service=TemplateService&Mode=Load&Content-Type=raw/binary&IncludeDocType=true&TemplateName=Predefined/ScheduleListBrowser) called
    execute(http://locolhost/Lighthammer/Illuminator,null,Service=TemplateService&Mode=Load&Content-Type=raw/binary&IncludeDocType=true&TemplateName=Predefined/GroupListQuery) called
    execute(http://locolhost/Lighthammer/Illuminator,null,Service=TemplateService&Mode=Load&Content-Type=raw/binary&IncludeDocType=true&TemplateName=Predefined/GroupBrowser) called
    execute(http://locolhost/Lighthammer/Illuminator,null,Service=TemplateService&Mode=Load&Content-Type=raw/binary&IncludeDocType=true&TemplateName=Predefined/TagListQuery) called
    execute(http://locolhost/Lighthammer/Illuminator,null,Service=TemplateService&Mode=Load&Content-Type=raw/binary&IncludeDocType=true&TemplateName=Predefined/TagBrowser) called
    execute(http://locolhost/Lighthammer/Illuminator,null,Service=TemplateService&Mode=Load&Content-Type=raw/binary&IncludeDocType=true&TemplateName=Predefined/TableListQuery) called
    execute(http://locolhost/Lighthammer/Illuminator,null,Service=TemplateService&Mode=Load&Content-Type=raw/binary&IncludeDocType=true&TemplateName=Predefined/TableBrowser) called
    execute(http://locolhost/Lighthammer/Illuminator,null,Service=TemplateService&Mode=Load&Content-Type=raw/binary&IncludeDocType=true&TemplateName=Predefined/ColumnListQuery) called
    execute(http://locolhost/Lighthammer/Illuminator,null,Service=TemplateService&Mode=Load&Content-Type=raw/binary&IncludeDocType=true&TemplateName=Predefined/ColumnBrowser) called
    execute(http://locolhost/Lighthammer/Illuminator,null,Service=TemplateService&Mode=Load&Content-Type=raw/binary&IncludeDocType=true&TemplateName=Predefined/AlarmColumnListQuery) called
    execute(http://locolhost/Lighthammer/Illuminator,null,Service=TemplateService&Mode=Load&Content-Type=raw/binary&IncludeDocType=true&TemplateName=Predefined/AlarmColumnBrowser) called
    execute(http://locolhost/Lighthammer/Illuminator,null,Service=TemplateService&Mode=Load&Content-Type=raw/binary&IncludeDocType=true&TemplateName=Predefined/TransactionFolderListQuery) called
    execute(http://locolhost/Lighthammer/Illuminator,null,Service=TemplateService&Mode=Load&Content-Type=raw/binary&IncludeDocType=true&TemplateName=Predefined/TransactionFolderBrowser) called
    execute(http://locolhost/Lighthammer/Illuminator,null,Service=TemplateService&Mode=Load&Content-Type=raw/binary&IncludeDocType=true&TemplateName=Predefined/TransactionListQuery) called
    execute(http://locolhost/Lighthammer/Illuminator,null,Service=TemplateService&Mode=Load&Content-Type=raw/binary&IncludeDocType=true&TemplateName=Predefined/TransactionBrowser) called
    execute(http://locolhost/Lighthammer/Illuminator,null,Service=TemplateService&Mode=Load&Content-Type=raw/binary&IncludeDocType=true&TemplateName=Predefined/TransactionOutputListQuery) called
    execute(http://locolhost/Lighthammer/Illuminator,null,Service=TemplateService&Mode=Load&Content-Type=raw/binary&IncludeDocType=true&TemplateName=Predefined/TransactionOutputBrowser) called
    execute(http://locolhost/Lighthammer/Illuminator,null,Service=TemplateService&Mode=Load&Content-Type=raw/binary&IncludeDocType=true&TemplateName=Predefined/TransactionInputListQuery) called
    execute(http://locolhost/Lighthammer/Illuminator,null,Service=TemplateService&Mode=Load&Content-Type=raw/binary&IncludeDocType=true&TemplateName=Predefined/TransactionInputBrowser) called
    execute(http://locolhost/Lighthammer/Illuminator,null,Service=TemplateService&Mode=Load&Content-Type=raw/binary&IncludeDocType=true&TemplateName=Predefined/FolderListQuery) called
    execute(http://locolhost/Lighthammer/Illuminator,null,Service=TemplateService&Mode=Load&Content-Type=raw/binary&IncludeDocType=true&TemplateName=Predefined/FolderBrowser) called
    execute(http://locolhost/Lighthammer/Illuminator,null,Service=TemplateService&Mode=Load&Content-Type=raw/binary&IncludeDocType=true&TemplateName=Predefined/TemplateListQuery) called
    execute(http://locolhost/Lighthammer/Illuminator,null,Service=TemplateService&Mode=Load&Content-Type=raw/binary&IncludeDocType=true&TemplateName=Predefined/TemplateBrowser) called
    execute(http://locolhost/Lighthammer/Illuminator,application/x-www-form-urlencoded,&Service=TemplateService&Mode=FolderList&RowCount=250&Content-Type=raw/binary&ApplyTZOffset=true) called
    SuccessCode = 0
    execute(http://locolhost/Lighthammer/Illuminator,application/x-www-form-urlencoded,&Service=TemplateService&Mode=TemplateList&Folder=&DocType=Query&RowCount=250&Content-Type=raw/binary&ApplyTZOffset=true) called
    SuccessCode = 0
    execute(http://locolhost/Lighthammer/Illuminator,null,Service=TemplateService&Mode=Load&Content-Type=raw/binary&TemplateName=Defaults/AggregateQuery) called
    execute(http://locolhost/Lighthammer/Illuminator,null,Service=TemplateService&Mode=Load&Content-Type=raw/binary&IncludeDocType=true&TemplateName=Predefined/CubeListQuery) called
    execute(http://locolhost/Lighthammer/Illuminator,null,Service=TemplateService&Mode=Load&Content-Type=raw/binary&IncludeDocType=true&TemplateName=Predefined/CubeBrowser) called
    execute(http://locolhost/Lighthammer/Illuminator,null,Service=TemplateService&Mode=Load&Content-Type=raw/binary&IncludeDocType=true&TemplateName=Predefined/SAPVariableListQuery) called
    execute(http://locolhost/Lighthammer/Illuminator,null,Service=TemplateService&Mode=Load&Content-Type=raw/binary&IncludeDocType=true&TemplateName=Predefined/SAPVariableBrowser) called
    execute(http://locolhost/Lighthammer/Illuminator,null,Service=TemplateService&Mode=Load&Content-Type=raw/binary&IncludeDocType=true&TemplateName=Predefined/DimensionListQuery) called
    execute(http://locolhost/Lighthammer/Illuminator,null,Service=TemplateService&Mode=Load&Content-Type=raw/binary&IncludeDocType=true&TemplateName=Predefined/DimensionBrowser) called
    execute(http://locolhost/Lighthammer/Illuminator,null,Service=TemplateService&Mode=Load&Content-Type=raw/binary&IncludeDocType=true&TemplateName=Predefined/MeasureListQuery) called
    execute(http://locolhost/Lighthammer/Illuminator,null,Service=TemplateService&Mode=Load&Content-Type=raw/binary&IncludeDocType=true&TemplateName=Predefined/MeasureBrowser) called
    execute(http://locolhost/Lighthammer/Illuminator,null,Service=TemplateService&Mode=Load&Content-Type=raw/binary&IncludeDocType=true&TemplateName=Defaults/SQLQuery) called
    execute(http://locolhost/Lighthammer/Illuminator,null,Service=TemplateService&Mode=Load&Content-Type=raw/binary&IncludeDocType=true&TemplateName=Defaults/TagQuery) called
    execute(http://locolhost/Lighthammer/Illuminator,application/x-www-form-urlencoded,Connector=&Server=&Service=Admin&Mode=RoleList&Method=&CacheDurationUnits=M&CacheDuration=0&IsCachable=false&Param.1=&Param.2=&Param.3=&Param.4=&Param.5=&Param.6=&Param.7=&Param.8=&Param.9=&Param.10=&Param.11=&Param.12=&Param.13=&Param.14=&Param.15=&Param.16=&Param.17=&Param.18=&Param.19=&Param.20=&Param.21=&Param.22=&Param.23=&Param.24=&Param.25=&Param.26=&Param.27=&Param.28=&Param.29=&Param.30=&Param.31=&Param.32=&Group=muzammil&Mask=&RowCount=60&Content-Type=raw/binary&ApplyTZOffset=true) called
    SuccessCode = 0
    User role: Administrators
    User role: Developers
    User role: Everyone
    User role: Security
    execute(http://locolhost/Lighthammer/Illuminator,application/x-www-form-urlencoded,Connector=Illuminator&Server=&Service=SystemInfo&Mode=ServerList&Method=SQL&CacheDurationUnits=M&CacheDuration=0&IsCachable=false&Param.1=&Param.2=&Param.3=&Param.4=&Param.5=&Param.6=&Param.7=&Param.8=&Param.9=&Param.10=&Param.11=&Param.12=&Param.13=&Param.14=&Param.15=&Param.16=&Param.17=&Param.18=&Param.19=&Param.20=&Param.21=&Param.22=&Param.23=&Param.24=&Param.25=&Param.26=&Param.27=&Param.28=&Param.29=&Param.30=&Param.31=&Param.32=&Group=&Mask=&RowCount=250&Content-Type=raw/binary&ApplyTZOffset=true) called
    SuccessCode = 0
    execute(http://locolhost/Lighthammer/Illuminator,application/x-www-form-urlencoded,Connector=&Server=IDBC&Service=&Mode=CurrentWrite&Method=&CacheDurationUnits=M&CacheDuration=0&IsCachable=false&Param.1=&Param.2=&Param.3=&Param.4=&Param.5=&Param.6=&Param.7=&Param.8=&Param.9=&Param.10=&Param.11=&Param.12=&Param.13=&Param.14=&Param.15=&Param.16=&Param.17=&Param.18=&Param.19=&Param.20=&Param.21=&Param.22=&Param.23=&Param.24=&Param.25=&Param.26=&Param.27=&Param.28=&Param.29=&Param.30=&Param.31=&Param.32=&Group=&Mask=&StartDate=&EndDate=&Time=&TimePeriod=&Schedule=&AllowFuture=true&Duration=60&DurationUnits=M&IntervalCount=1&NumberFormat=0.00&DateFormat=MM%2Fdd%2Fyyyy+HH%3Amm%3***&RowCount=250&Content-Type=raw/binary&ApplyTZOffset=true) called
    SuccessCode = -100
    ERROR - Server is currently disabled (IDBC).
    execute(http://locolhost/Lighthammer/Illuminator,application/x-www-form-urlencoded,Connector=Illuminator&Server=&Service=SystemInfo&Mode=TimePeriodList&Method=&CacheDurationUnits=M&CacheDuration=0&IsCachable=false&Param.1=&Param.2=&Param.3=&Param.4=&Param.5=&Param.6=&Param.7=&Param.8=&Param.9=&Param.10=&Param.11=&Param.12=&Param.13=&Param.14=&Param.15=&Param.16=&Param.17=&Param.18=&Param.19=&Param.20=&Param.21=&Param.22=&Param.23=&Param.24=&Param.25=&Param.26=&Param.27=&Param.28=&Param.29=&Param.30=&Param.31=&Param.32=&Group=&Mask=&RowCount=250&Content-Type=raw/binary&ApplyTZOffset=true) called
    SuccessCode = 0
    execute(http://locolhost/Lighthammer/Illuminator,application/x-www-form-urlencoded,Connector=Illuminator&Server=&Service=SystemInfo&Mode=ScheduleList&Method=&CacheDurationUnits=M&CacheDuration=0&IsCachable=false&Param.1=&Param.2=&Param.3=&Param.4=&Param.5=&Param.6=&Param.7=&Param.8=&Param.9=&Param.10=&Param.11=&Param.12=&Param.13=&Param.14=&Param.15=&Param.16=&Param.17=&Param.18=&Param.19=&Param.20=&Param.21=&Param.22=&Param.23=&Param.24=&Param.25=&Param.26=&Param.27=&Param.28=&Param.29=&Param.30=&Param.31=&Param.32=&Group=&Mask=&RowCount=250&Content-Type=raw/binary&ApplyTZOffset=true) called
    SuccessCode = 0
    execute(http://locolhost/Lighthammer/Illuminator,application/x-www-form-urlencoded,Connector=&Server=&Service=Admin&Mode=RoleList&Method=&CacheDurationUnits=M&CacheDuration=0&IsCachable=false&Param.1=&Param.2=&Param.3=&Param.4=&Param.5=&Param.6=&Param.7=&Param.8=&Param.9=&Param.10=&Param.11=&Param.12=&Param.13=&Param.14=&Param.15=&Param.16=&Param.17=&Param.18=&Param.19=&Param.20=&Param.21=&Param.22=&Param.23=&Param.24=&Param.25=&Param.26=&Param.27=&Param.28=&Param.29=&Param.30=&Param.31=&Param.32=&Group=&Mask=&RowCount=60&Content-Type=raw/binary&ApplyTZOffset=true) called
    SuccessCode = 0
    execute(http://locolhost/Lighthammer/Illuminator,application/x-www-form-urlencoded,Connector=&Server=Local_Oracle&Service=&Mode=CurrentWrite&Method=&CacheDurationUnits=M&CacheDuration=0&IsCachable=false&Param.1=&Param.2=&Param.3=&Param.4=&Param.5=&Param.6=&Param.7=&Param.8=&Param.9=&Param.10=&Param.11=&Param.12=&Param.13=&Param.14=&Param.15=&Param.16=&Param.17=&Param.18=&Param.19=&Param.20=&Param.21=&Param.22=&Param.23=&Param.24=&Param.25=&Param.26=&Param.27=&Param.28=&Param.29=&Param.30=&Param.31=&Param.32=&Group=&Mask=&StartDate=&EndDate=&Time=&TimePeriod=&Schedule=&AllowFuture=true&Duration=60&DurationUnits=M&IntervalCount=1&NumberFormat=0.00&DateFormat=MM%2Fdd%2Fyyyy+HH%3Amm%3***&RowCount=250&Content-Type=raw/binary&ApplyTZOffset=true) called
    SuccessCode = -100
    ERROR - The execution mode (CurrentWrite) is not supported with this Server or Content-Type.
    Regards
    Muzammil

  • Sending Query to query template

    Hi,
    is it possible to send query from Html page to query template. for example, i create query template as IDBC server and in fixed query mode without giving any query. just blank. in page generator i mapped with iCommand. Now i want to send query from javascript by using getQueryObject. how to send it?
    -senthil

    Senthil,
    As John indicated, using the built-in query parameter [Param.x] allows you to be very dynamic in your approach, but document.APPLET.getQueryObject().setQuery('SELECT....'); would be the same thing if you just wanted to pass in the whole fixed query statement.
    I may be getting ahead of things, but I can't help but think you are heading down a bad development path by burying all of your queries in the client side script.  You can use iCommand applets as recordset objects, but they will always be client sided, not server sided like ado recordsets in asp.  I've seen far too many system integrator botched applications where the the body onload was used to trigger javascript that attempts to force queries into applets when they have not been initialized by the JRE.  By nature Query Templates themselves can be filled with [Param.x]'s but trying to develop large amounts of application content where the select statements are assembled in client side javascript can lead to all sorts of supportability issues for the customer.  Imagine a customer going to training, and understanding the basics of query templates, and then trying to reverse engineer your page with one query template called "SQLGeneric" and all of the logic buried in javascript.  He/she opens the template and all they find is a FixedQuery with [Param.1] - can you envision their confusion?  Then they look at the 1000 - 2000 lines of javascript that I've seen at times?
    Can you provide the business case as to why you would not create a simpler query template minded approach, or would want to construct the queries this way?
    Regards,
    Jeremy

  • How to set the table input in Query template?

    Hi all.
    I need to call a Bapi_objcl_change, with import parameter and a table as an input. I have done this, in BLS. I have set the table input in the
    form of xml. In BLS, I get the output(the value gets change in SAP R3, what i have given in BLS).  But if i set the same xml structure  in
    query template, I didn't get the output. Table input parameter does not take that xml source.  How to set the table input in Query template?
    can anyone help me?
    Regards,
    Hemalatha

    Hema,
    You probably need to XML encode the data so that it will pass properly and then xmldecode() it to set the BAPI input value.
    Sam

  • Calling a Stored Procedure with output parameters from Query Templates

    This is same problem which Shalaka Khandekar logged earlier. This new thread gives the complete description about our problem. Please go through this problem and suggest us a feasible solution.
    We encountered a problem while calling a stored procedure from MII Query Template as follows-
    1. Stored Procedure is defined in a package. Procedure takes the below inputs and outputs.
    a) Input1 - CLOB
    b) Input2 - CLOB
    c) Input3 - CLOB
    d) Output1 - CLOB
    e) Output2 - CLOB
    f) Output3 - Varchar2
    2. There are two ways to get the output back.
    a) Using a Stored Procedure by declaring necessary OUT parameters.
    b) Using a Function which returns a single value.
    3. Consider we are using method 2-a. To call a Stored Procedure with OUT parameters from the Query Template we need to declare variables of
    corresponding types and pass them to the Stored Procedure along with the necessary input parameters.
    4. This method is not a solution to get output because we cannot declare variables of some type(CLOB, Varchar2) in Query Template.
    5. Even though we are successful (step 4) in declaring the OUT variables in Query Template and passed it successfully to the procedure, but our procedure contains outputs which are of type CLOB. It means we are going to get data which is more than VARCHAR2 length which query template cannot return(Limit is 32767
    characters)
    6. So the method 2-a is ruled out.
    7. Now consider method 2-b. Function returns only one value, but we have 3 different OUT values. Assume that we have appended them using a separator. This value is going to be more than 32767 characters which is again a problem with the query template(refer to point 5). So option 2-b is also ruled out.
    Apart from above mentioned methods there is a work around. It is to create a temporary table in the database with above 3 OUT parameters along with a session specific column. We insert the output which we got from the procedure to the temporary table and use it further. As soon the usage of the data is completed we delete the current session specific data. So indirectly we call the table as a Session Table. This solution increases unnecessary load on the database.
    Thanks in Advance.
    Rajesh

    Rajesh,
    please check if this following proposal could serve you.
    Define the Query with mode FixedQueryWithOutput. In the package define a ref cursor as IN OUT parameter. To get your 3 values back, open the cursor in your procedure like "Select val1, val2, val3 from dual". Then the values should get into your query.
    Here is an example how this could be defined.
    Package:
    type return_cur IS ref CURSOR;
    Procedure:
    PROCEDURE myProc(myReturnCur IN OUT return_cur) ...
    OPEN myReturnCur FOR SELECT val1, val2, val3  FROM dual;
    Query:
    DECLARE
      MYRETURNCUR myPackage.return_cur;
    BEGIN
      myPackage.myProc(
        MYRETURNCUR => ?
    END;
    Good luck.
    Michael

  • Passing query template name to BLS SQL action in the link editor

    I want to have one transaction that uses the SQL query action, but which query template it uses will be dependent on some user input. I am having trouble passing the query name. I'm using the full file path in xml format (i.e. "c://<folder1>//<folder2>//<folderN>//"&PassedFileName&".xml", but with backslashes instead of forward slashes). I got an error around the connector, so I set that too. Then I got an error around mode, so I set it to "FixedQuery". Now I'm getting, "The Query expression was not set with the Query parameter".
    There are only 3-5 possible queries that will be used, so I'd rather build SQL queries and just pass the transaction the name of the query, as opposed to passing the full text of the query each time.
    Thanks,
    Carrie
    Edited by: Carrie Schimizzi on May 9, 2008 6:38 PM
    Edited by: Carrie Schimizzi on May 9, 2008 6:39 PM
    Edited by: Carrie Schimizzi on May 9, 2008 6:40 PM

    Carrie,
    If you haven't already done so, configure your master BLS transaction with a proper representative runtime variation, which will make the whole process simpler to create and troubleshoot.  Quite often when people try to use the dynamic capabilities of MII, they end up getting confused because of user over-complication.  In your SQLQuery action block make sure you configure it to a valid template that would be one that the user would provide as an input (don't forget to allow the generation of sample results for making any subsequent trx efforts easier).  Then look in the link editor and you should see this string value for the query template link if you hover over the corresponding blue T icon.  This will show you the format you need to provide from your Transaction input property (which should also have a valid default value assigned so you can test the transaction by itself, without needing to initially rely on the Xacute Query template layer.
    Regards,
    Jeremy

  • Transaction demarcation in query templates and BLE?

    We have a business process which needs to insert N-many records into a table as a single transaction - if one insert fails, they all rollback.  The number of records and record values are, of course, variable.  How does xMII 11.5 support this or does it? 
    I could think of some very ugly hacks using a fixed query and creative use of query template parameters, but I'd rather not go there.
    Thanks,
    -tim

    XMII has no database transactional support.
    The last site I worked at rolled their own action block to handle this and support distributed transactions.  Basically, any number of data connections and SQL statements could be passed to the action block and then commiited in one pass.  It was quite a bit of work but it was a major requirement of the client.

  • Query Template Caching Properties

    I need to change the IsCachable on the fly in an IRPT page. It seems every property is exposed in the query object EXCEPT IsCachable. Am I missing something?
    Assuming I'm not, how can I simply tell the query template to NOT check the cache for this update AND not create a new cache. I know I can change the Rowcount, or anything really, so it won't match up with an existing cache. But IsCachable is true, and this will cause a new cache to be created, which I don't want.

    The problem is I need to change the IsCachable property in a web page in response to user input (back and forth at will), and then re-update the applet(s) on the page. So I really need to drive this from javascript, changing IsCachable to whatever the user has selected and then doing the applet update. QueryObject.IsCachable returns an error, no method or property exists. It's also not listed in the Script Assistant.
    The idea is I have a scheduled transaction that runs every few minutes and pre-caches BLS transactions that feed reports that are performance problems (Rajeev you should be able to relate to that one). When these reports are run, they now render in a few seconds. I display how old the data is, and have a checkbox they can tick to run the report again withouit using the cache if they have a problem with data that is 10 minutes, or whatever, old. They make the decision to wait for the absolute latest data. Doing this in Javascript is by far the easiest way to handle this. I just don't seem to have access to that IsCachable property.
    Rick - It's interesting that you consider it easier to do your own caching. We started down this road and decided it was all getting too messy. It took a while to get total control over xMII caching, but now I find using it much cleaner.

  • Max No. of columns returned in Query Template

    Hi All,
    Is there any limit to the max number of columns that can be returned for a sql query using the Query Template?
    Regards,
    Arijeet

    Hi Rick,
    I am basically querying a database table which has a large number of columns. Of which I need only a few. Unfortunately though some of the columns I need are not in those that are shown by default when I do a SELECT * or in the list of columns that show up in the Query Template. I am using UDS to connect to the other system and when I try to SELECT the columns which are of interest to me the connection is reset and the UDS Instance for that connection stops. I could access all the columns in the BLS so I am presently using a work around by running an xacute query to show me the data.
    Regards,
    Arijeet

  • Stored Procedure Output Issue in Query Template

    Hi,
    We have written a stored procedure which returns 3 outputs which are of type CLOB. Whenever we call the procedure from query template it gives an error Wrong number or type of parameters. It seems that we need to pass some variables which are of type clob to the procedure while calling which we cannot do as per my knowledge in query template.
    Even if we are able to get the output we will not be getting complete output since the out put values are of type CLOB.
    Can you guide me how to achive this
    Thanks,
    Shalaka

    Hi,
    Sometime back i faced the similar problem. But I used oracle pipelined functions to achieve this....
    The basic thing is it will break the chunk into records of length of 4000 chars and it will return in a table. And from other end you can loop and concatenate. Hope this helps....
    create or replace FUNCTION FN_GEN_XML RETURN dashb_xml pipelined IS v_xml CLOB := NULL;
    v_temp VARCHAR2(4000) := NULL;
    v_counter NUMBER := 1;
    BEGIN
      SELECT somefunction(0)
      INTO v_xml
      FROM dual;--v_xml here is clob type. here you might need to call your proc and get it into this variable.
      dbms_output.put_line ('length of v_xml is:' || length(v_xml));
      DBMS_OUTPUT.PUT_LINE('start of this function');
      LOOP
        v_temp := SUBSTR(v_xml,   v_counter,   4000);
        EXIT
      WHEN v_temp IS NULL;
      DBMS_OUTPUT.PUT_LINE(to_char(v_temp));
      pipe ROW(v_temp);
      v_counter := v_counter + 4000;
    END LOOP;
    RETURN;
    END;
    Regards,
    Ravi Kumar

Maybe you are looking for

  • Photo attachment issues

    I'm trying to send simple .jpg files to client. She's on a PC and this is what she tells me: "I use the insert picutre from file to get it into the document, on publisher it needs to be done this way to get the right text box to fit. The result is at

  • HTMLDB_tools, processing a very large csv file in a collection

    Hi Guys, I'm new to APEX and trying to load approx 1,000,000 rows into a table from a csv file, does anyone have a better way of doing it than htmldb_tools.parse_file (which is very slow) Cheers

  • Query with UNION option

    Hi , I have one partition table.The partitions are created datewise.Now when i have to fire select query on that talble i am firing below querry Select count(1) from table A where createdate between ('01-JAN-2012 00:00:00','DD-MON-YYYY HH24:MI:SS') A

  • Pricing type in copy control for billing documents

    Hi Experts, In copy control for billing documents, there is a pricing type M - copy pricing elements, turn value? What is the effect of this pricing type? thanks

  • Adobe Application Manager Stopped working

    I have had the same problem as in many discussions, in which there seems to be few solutions. My AAM stopped working no specific error, I followed the idea of uninstalling all my creative cloud apps and started again only to have the AAM do exactly t