OUTPUT variable from dynamic query with openquery

I am working on a dynamic sql statement that uses openquery to retrieve some columns from an Oracle source.  My goal is to take the variables from the select openquery statement and store them, so they can be passed to an insert statement.  I am
having no problem getting the emplid but the first_name and last_name are NULL
Any help would be appreciated.
DECLARE @sql nvarchar(max)
declare @emplid varchar(11)
declare @first_name varchar(50)
set @emplid = '1234'
BEGIN
SET NOCOUNT ON;
SET @sql = 'select distinct emplid,
First_name ,
Last_name
from openquery(DWHCRPT, ''select p.emplid, p.First_nAME, p.last_nAME
FROM PS_OCC_BIODEMO_S P
where P.emplid = ''''' + @emplid + ''''''') A';
EXEC SP_executesql @SQL, N'@emplid VARCHAR (11), @first_name varchar(50) OUTPUT', @emplid, @first_name = first_name;
select @emplid, @first_name --currently returning NULL
END

Patrick's query would work, but it would drag the entire table over to SQL Server, which could be expensive.
The code you posted have several flaws. You are not assigning @first_name, and you have failed to provide OUTPUT for the actual parameter. Also, the DISTINCT looks out of place. Isn't emplid a key?
This should work better:
SET @sql = 'select @first_name = First_name 
        from openquery(DWHCRPT, ''select p.First_nAME, p.last_nAME
                                      FROM PS_OCC_BIODEMO_S P
                   where P.emplid = ''''' + @emplid + ''''''') A'; 
   EXEC SP_executesql @SQL, N'@emplid VARCHAR (11), @first_name varchar(50) OUTPUT', @emplid, @first_name = @first_name OUTPUT;
select @emplid, @first_name --currently returning NULL
Also, look at this link for some tips how to write queries with OPENQUERY without going insane over all nested quotes:
http://www.sommarskog.se/dynamic_sql.html#OPENQUERY
Erland Sommarskog, SQL Server MVP, [email protected]

Similar Messages

  • Running a SQL Stored Procedure from Power Query with Dynamic Parameters

    Hi,
    I want to execute a stored procedure from Power Query with dynamic parameters.
    In normal process, query will look like below in Power Query. Here the value 'Dileep' is passed as a parameter value to SP.
        Source = Sql.Database("ABC-PC", "SAMPLEDB", [Query="EXEC DBO.spGetData 'Dileep'"]
    Now I want to pass the value dynamically taking from excel sheet. I can get the required excel cell value in a variable but unable to pass it to query.
        Name_Parameter = Excel.CurrentWorkbook(){[Name="Table3"]}[Content],
        Name_Value = Name_Parameter{0}[Value],
    I have tried like below but it is not working.
    Source = Sql.Database("ABC-PC", "SAMPLEDB", [Query="EXEC DBO.spGetData Name_Value"]
    Can anyone please help me with this issue.
    Thanks
    Dileep

    Hi,
    I got it. Below is the correct syntax.
    Source = Sql.Database("ABC-PC", "SAMPLEDB", [Query="EXEC DBO.spGetData '" & Name_Value & "'"]
    Thanks
    Dileep

  • From Clause query with form variables

    forms 9.0.4 rdbms 9.2
    Is it possible to create a From Clause query with form variables generated from another block (but in the same form)? I am not having any success.
    I searched Metalink. It appears that according to DOC ID # 69884.1, in Forms 6i, this is not possible. Metalink suggest in DOC ID 104771.1 implementating a dynamic From Clause, but when I duplicate the example on my system, I receive an Oracle error. Further investigation from the web form (DISPLAY ERROR) indicates that the system does not see the dynamic value.
    Has anyone else run into this error? Has this been fixed in forms 9.0.4 and I am just missing something? Does a dynamic from clause query work? Can anyone point me to an example or post an example or offer any advise.
    thanks in advance

    As far as I know it is not possible to use block items in a from clause query in forms 9.0.4. Here is my solution for a From-Clause-Query via the 'Query-Data-Source-Name-Property':
    To use the values of the block items in my from clause query I implemented a database package with getter and setter routines for the block item values I needed for the query.
    In the Key-Exeqry-Trigger of the From-Clause-Query-Block I set the global package variables with values of the block-items I am interested in. In the From-Clause-Query I used the values in the where-clause via package functions which return the global package variables.
    Hope my solution will work for your problem.

  • How to compare result from sql query with data writen in html input tag?

    how to compare result
    from sql query with data
    writen in html input tag?
    I need to compare
    user and password in html form
    with all user and password in database
    how to do this?
    or put the resulr from sql query
    in array
    please help me?

    Hi dejani
    first get the user name and password enter by the user
    using
    String sUsername=request.getParameter("name of the textfield");
    String sPassword=request.getParameter("name of the textfield");
    after executeQuery() statement
    int exist=0;
    while(rs.next())
    String sUserId= rs.getString("username");
    String sPass_wd= rs.getString("password");
    if(sUserId.equals(sUsername) && sPass_wd.equals(sPassword))
    exist=1;
    if(exist==1)
    out.println("user exist");
    else
    out.println("not exist");

  • Dynamic query with x.recordcount output

    I have a query that gets Distinct States listed in a Sponsor table
    <cfquery name="statecount" datasource="#db#">
    SELECT DISTINCT STATE FROM tbl_sponsors
    WHERE SalesRep = "#form.user#" or Manager = "#form.user#"
    </cfquery>
    I then loop through the results with this:
    <cfloop from="1" to="#statecount.RecordCount#" index="i">
    The results are: WA and OR
    Inside the loop I create an array for:
    <cfset getTotals = ArrayNew(1)>
    <cfset ArrayAppend(getTotals, "getTotals#statecount.State[i]#")> This sets "getTotalsWA" and "getTotalsOR" correlating to each loop.
    I use the "getTotals" variable to name my query:
    <cfquery name="#getTotals[1]#" datasource="#mydatasource#>
    I run into a problem when trying to call the RecordCount of the "getTotals[1]" result - #getTotals[1].RecordCount#.
    I get the error:
    You have attempted to dereference a scalar variable of type class java.lang.String as a structure with members
    My logic makes sense to me, but obviously is wrong.  How can I adjust it to work?

    So I see where yur logic is failing you.
    So let's say that getTotals[1] = "getTotalsWA"
    That means that getTotals[1] is a string
    Now you create a query with that value
    <cfquery name="#getTotals[1]#" ... >
    You now have a query object names "getTotalsWA"
    But what you are trying to output is: #getTotals[1].RecordCount#
    getTotals[1] is still just the string "getTotalsWA" and therefore does not have the attribute RECORDCOUNT. You are still referencing the string in the array get totals, you are not referencing the newly created variable named "getTotalsWA"
    To access that value you need to go at it a little differently. 
    Try this:  #variables[getTotals[1]].RecordCount#
    I think this will work. Here, I am telling CF to get the variable named #getTotals[1]# (which translates to "getTotalsWA" from the VARIABLES scope.

  • Display results from dynamic query created and executed inside procedure

    Hi;
    I have created this code:
    CREATE OR REPLACE PROCEDURE RunDynamicQuery(Var1 IN VARCHAR2, Var2 IN VARCHAR2, VAR3 IN VARCHAR2) AS
    -- Do something
    -- That ends up with a variable holding a query.... (just an example)
    MainQuery :='select sysdate from dual';
    end RunDynamicQuery;
    How can I run this procedure and see the result on the dymanic query generated inside it?
    BEGIN
    compare_tables_content('VAR1','VAR2','VAR3');
    END;
    Expected Output for this given example:
    20-05-2009 11:04:44 ( the result of the dymanic query inside the procedure variable MainQuery :='select sysdate from dual';)
    I tested with 'execute immediate':
    CREATE OR REPLACE PROCEDURE RunDynamicQuery(Var1 IN VARCHAR2, Var2 IN VARCHAR2, filter IN VARCHAR2) AS
    -- Do something
    -- That ends up with a variable holding a query.... (just an example)
    MainQuery :='select sysdate from dual';
    execute immediate (MainQuery );
    end RunDynamicQuery;
    BEGIN
    compare_tables_content('VAR1','VAR2','VAR3');
    END;
    Output:"Statement processed'' (no sysdate displayed ! )
    Please consider that the collums in the query are always dynamic... PIPELINE Table would not work because I would need to define a container, example:
    CREATE OR REPLACE TYPE emp_tabtype AS TABLE OF emp_type;
    FUNCTION RunDynamicQuery (p_cursor IN sys_refcursor)
    RETURN emp_tabtype PIPELINED
    IS
    emp_in emp%ROWTYPE;
    BEGIN
    LOOP
    FETCH p_cursor
    INTO emp_in;
    EXIT WHEN p_cursor%NOTFOUND;
    PIPE ROW (...)

    That would be a nice solution, thanks :)
    ''For now'' I implemented like this:
    My dynamic query now returns a single string ( select col1 || col2 || col3 from bla)
    This way I don't have dynamic collumns issue, and from business side, this ''string'' format works for them.
    This way I can use the pipelines to get the result out...
    OPEN myCursor FOR MainQuery;
    FETCH myCursor
    INTO myRow;
    WHILE (NOT myCursor%notFound) LOOP
    PIPE ROW(myRow);
    FETCH myCursor
    INTO myRow;
    END LOOP;
    CLOSE myCursor;

  • Create a dynamic query with or/and

    Hello!
    Please help to accomplish the following:
    User needs to create a dynamic query.
    There are few select lists: sex, race, state …
    User selects whatever he needs from select lists, which would become the first part of the “where clause” – i.e. (sex = ‘M’ AND state = ‘NY’).
    Then the user wants to add an additional condition using “OR/AND” – i.e. i.e. (sex = ‘M’ AND state = ‘NY’) OR (sex = ‘F’).
    I have been able to build the first clause and pass to a variable. I need to be able to clear the values in the select lists, but keep the value stored in the variable, and then append each new clause to the variable. This needs to be event driven by an item on the page.
    Any help is appreciated.
    Thank you in advance.

    Hi,
    At that point my application works fine.
    But I need to add ability to clear select lists and enter a new condition with 'OR'
    operator.
    The final SQL statement should look:
    select employee_id, name from employee_v where (sex = ‘M’ AND state = ‘NY’) OR (sex = ‘F’)
    Thank you.

  • Problem returning variables from dynamic SQL/PLSQL

    Hi, I have a problem I am trying to solve using a very short piece of dynamic SQL or PLSQL but I am having problems getting the variable values out of the dynamic block.
    I have 16 counters whose names are made up of three variable parts - 'scheme', 'contributory category' and 'employment category'
    The 'scheme' can be either 'no1', 'no2', 'off', 'cg' or 'amc'
    The 'contributory category' can be either 'cont' or 'noncont'
    The 'employment category' can be either 'ft' or 'pt'
    (There are only 16 because only 16 combinations are possible)
    For example the total counter name could be 'v_cg_noncont_ft_count'
    I have created a variable by concatenating the various elements called v_incr_count_name which holds the name of the counter I want to increment.
    I am running this whole thing within an anonymous PLSQL block so I cannot use global variables meaning that my variables are not visible within a dynamic PLSQL block.
    I believe this means that either I need to bind the variables within a PLSQL block or use a SELECT FROM INTO SQL block.
    I have tried a few solutions with no luck such as the following PLSQL:
    v_incr_count := 'v_'||v_scheme||'_'||v_cont_cat||'_'||v_emp_cat||'_count';
    sql_stmt := 'BEGIN :a := :a + 1; END;';
    EXECUTE IMMEDIATE sql_stmt USING v_incr_count_name;
    Unfortunately I am getting the 'IN bind variable bound to an OUT position' error which I believe is because it is trying to return a value into v_incr_count_name which has been defined by default as an IN variable. The problem is that I need to store the returned value into the variable whose name is stored in v_incr_count_name.
    Another solution I tried is:
    v_incr_count_name := 'v_'||v_scheme||'_'||v_cont_cat||'_'||v_emp_cat||'_count';
    sql_stmt := 'SELECT '||v_incr_count_name||' + 1 FROM DUAL';
    EXECUTE IMMEDIATE sql_stmt INTO v_return;
    This solution gives me an 'Invalid colum error'
    Any help would be greatly appreciated
    Cheers, Dan

    Repost:
    Problem with variables in dynamic SQL/PLSQL

  • Populating variable from another query..

    Hi,
    I have a requirement whereby I have a variable (for eg. on the Accounting Document Number) in query Q2.The values of this variable have to be derived by executing another query eg. - Q1
    So I defined a variable on the infoobject, defined it as based on Q1 and am using that in Q2.
    However the issue is I don't want to restrict query Q2 with that variable.. but just want to read the values and then be able to further processing on that variable. However hard as I try it seems that I can only use that variable as Filter in Q2. Any other options I can use.
    I tried to use that variable in a structure but it system does not accept it.
    Any ideas would be appreciated.
    thx

    Hi ATW,
    Looks to me, this is a RRI (Report-To-Report Interface) requirement.
    Try following options ->
    1.  RRI
    Consider - Q1 is a 'Sender Query' - This will a 'summary level' query and Q2 would be 'Receiving Query' - This will be 'Detailed level' query.
    Do Sedning / Receiving  setting in the Tcode RSBBS
    Execute Q1 -> Right click on any row -> GOTO -> Q2, it will execute second query with the details on for the row you have selected.
    2.  Pre-Query & Main Query
    Here Q1 will be your 'pre-query' which will run for a given date range.  (or any other selection criteria), and it will have 'Accounting Document Number' in the 'ROWS'. The output of Q1 will work as a filter to Q2 (the output of the query Q1 will NOT be visible.)
    This output then will work as a filter for the second query Q2.
    Let me know if this helps.
    Regards,
    Rashmi

  • Dynamic query with drop down lists

    I have two select queries in my program.
    The first query is to obtain and then display the list of
    clients.
    The second query I want to display only projects which are
    linked to a specific client.
    <cfquery name="getClient" datasource="#request.DSN#">
    Select tblClients.ClientID, tblClients.ClientName
    From tblClients
    Order by tblClients.ClientName</cfquery>
    <cfquery name="getProjects" datasource="#Request.DSN#">
    Select tblprojects.ProjectID, tblProject.Project,
    tblProject.ProjectID
    From tblProject, tblClients
    WHERE tblClients.ClientID = tblProject.ClientID AND
    tblClients.ClientID = #getClient.ClientID# </cfquery>
    I am displaying the first select box ok and it is populated
    with the correct information.
    The second select box is ot quite correct. It is only
    displaying one record - the first record in the file.
    <select name="Client">
    <cfoutput query="getclient">
    <option
    value="#getclient.ClientID#">#getclient.ClientName#</option>
    </cfoutput>
    </select>
    <select name="Project">
    <cfoutput query="getProject">
    <option
    value="#getProject.ProjectID#">#getProject.Project#</option>
    </cfoutput>
    </select>
    Any ideas on how to correct this would be greatly
    appreciated.
    Kind regards

    In your second query you are using the variable
    #getClient.ClientID#
    Outside of a <cfloop query=""> or a <cfoutput
    query=""> CF assumes you meant
    : #getClient.ClientID[1]# (which is the first record of the
    getClient Query.
    If you are trying to pull up a list of projects that are for
    the getClient list, then try this instead
    <cfquery name="getProjects" datasource="#Request.DSN#">
    Select tblprojects.ProjectID, tblProject.Project,
    tblProject.ProjectID
    From tblProject, tblClients
    WHERE tblClients.ClientID = tblProject.ClientID AND
    tblClients.ClientID IN (#valuelist(getClient.ClientID)#)
    </cfquery>
    Valuelist changes any 'column' from a query into a list.
    Hope this helps

  • Dynamic query with wild card

    Hi,
    I have a table1 like below
    Id (NUMBER) , Keyword (VARCHAR2)
    1,A
    2,B
    3,C
    another table2
    name(VARCHAR2)
    Alice
    Bob
    Jack
    I need to write a stored procedure to check whether name of table 2 mactched any of the keyword char of table1. How to I write dynamic query in my PL/SQL stored procedure so that i can generate query similar to
    SELECT * from table2 where name like '%X%' where i need to replace X with the char in table1
    Please help.
    Thanks in advance,
    Marutha

    I need to write a stored procedure to check whether name of table 2 mactched any of the keyword char of table1You might simply join the tables:
    SQL> with table1  as
    select 1 id, 'A' keyword from dual union all
    select 2 id, 'B' keyword from dual union all
    select 3 id, 'C' keyword from dual
    table2 as (
    select 'Alice' name from dual union all
    select 'Bob' name from dual union all
    select 'Jack' name from dual
    select * from table1, table2 where name like '%' || keyword  || '%'
            ID KEYWORD NAME
             1 A       Alice
             2 B       Bob 
    2 rows selected.

  • Pass variables from dialogue query to batch planning functions

    The requirement.
    The user will open an u2018open-for-inputu2019 query (Web Template) using a number of variables (some are type exit). After entering data, the user will close the process by saving the data. The u2018Saveu2019 button will start a Planning Sequence which includes open data slice, distribution, copy,  repost function and close data slice. The user will not wait for any feedback from these processes so they should be done as back-ground processes (in any case the dialogue process will time out).
    The problem.
    The background process will be started from the query u2018Saveu2019 button. This is easy enough to do.
    However it is absolutely vital that the variables are passed from the query (which may or may not still be active) to the same variables that will need to be filled in the Planning Functions in the background process. I imagine that the background process will be a Process Chain .
    Help needed.
    1. Can anyone give me the way in which this is done?
    2. It could be critical that the user does get feedback in some form or other if the back-ground processes fail for whatever reason. Any ideas how this can be achieved at the user interface level. The users will not have 'SAP Savy' and the log in the Process Chain will not be transparent to them.

    One approach..
    Have diff variables for query and planning seq.
    Say V1, V2 etc for query and VF1, VF2 etc for data slices and planning functions.
    Maintain one Z-table which contains variables V1, V2 etc along with their values.
    So when the users select query variables, on save, one exit function will write these variable values to the z-table. The variables used in planning seq and data slices (VF1, VF2..) will be exit variables which read corresponding entries from Z-table (V1, V2...). So background process will run based on what the user has selected.

  • How do I create a folder or report from a query with a union and parameters

    I have created folders with unions but I am having difficulty coverting a query with a union and parameters.
    The following works great in SQL*Developer without parameters, but I want to change to use parameters for the year and quarter and use it in Discoverer:
    SELECT TO_CHAR(NVL(AV.TAX_ID,999999999),'000000000') FEID,
      AV.FIRM_NAME VENDOR_NAME,
      AV.BIDCLASS CONTRACT_CODES,
      AV.AWAMT AWARD_AMOUNT,
      AV.SOL_MODE FORMAL_INFORMAL,
      AV.CERT BUSINESS_ENTITY,
      AV.ETHNICITY ETHNICTY,
      AV.PO_NUMBER_FORMAT CONTRACT,
      SUM(VP.INVOICE_AMOUNT) AMOUNT_PAID_$
    FROM CONFIRM.VSTATE_PAID_AWARD_VENDORS AV,
      CONFIRM.VSTATE_VENDOR_PAYMENTS VP
    WHERE ( ( AV.PO_NUMBER = VP.PO_NUMBER
    AND AV.VENDOR_ID       = VP.VENDOR_ID ) )
    AND (TO_CHAR(VP.PAYMENT_DATE,'Q') = '4')
    AND ( TO_CHAR(VP.PAYMENT_DATE,'YYYY') = '2009' )
    GROUP BY TO_CHAR(NVL(AV.TAX_ID,999999999),'000000000'),
      AV.FIRM_NAME,
      AV.BIDCLASS,
      AV.AWAMT,
      AV.SOL_MODE,
      AV.CERT,
      AV.ETHNICITY,
      AV.PO_NUMBER_FORMAT
      union
    SELECT TO_CHAR(NVL(AV2.TAX_ID,999999999),'000000000') FEID,
      AV2.FIRM_NAME VENDOR_NAME,
      AV2.BIDCLASS CONTRACT_CODES,
      AV2.AWAMT AWARD_AMOUNT,
      AV2.SOL_MODE FORMAL_INFORMAL,
      AV2.CERT BUSINESS_ENTITY,
      AV2.ETHNICITY ETHNICTY,
      AV2.PO_NUMBER_FORMAT CONTRACT,
      0 AMOUNT_PAID_$
    FROM CONFIRM.VSTATE_PAID_AWARD_VENDORS AV2
    WHERE
    not exists (SELECT 'X'
                  FROM CONFIRM.VSTATE_VENDOR_PAYMENTS VP2
                 WHERE av2.po_number = vp2.po_number
                       AND (TO_CHAR(VP2.PAYMENT_DATE,'Q') = '4')
                       AND ( TO_CHAR(VP2.PAYMENT_DATE,'YYYY') = '2009' ))
    AND (TO_CHAR(AV2.AWDATE,'Q') = '4')
    AND (to_CHAR(AV2.AWDATE,'YYYY') = '2009')
    GROUP BY TO_CHAR(NVL(AV2.TAX_ID,999999999),'000000000'),
      AV2.FIRM_NAME,
      AV2.BIDCLASS,
      AV2.AWAMT,
      AV2.SOL_MODE,
      AV2.CERT,
      AV2.ETHNICITY,
      AV2.PO_NUMBER_FORMAT Can someone provide a solution?
    Thank you,
    Robert

    Hi,
    You can take the parameters to the select so that you will be able to create conditions over them.
    Try to use this SQL instead of your and in the discoverer workbook create the conditions and parameters:
    SELECT TO_CHAR(NVL(AV.TAX_ID,999999999),'000000000') FEID,
    AV.FIRM_NAME VENDOR_NAME,
    AV.BIDCLASS CONTRACT_CODES,
    AV.AWAMT AWARD_AMOUNT,
    AV.SOL_MODE FORMAL_INFORMAL,
    AV.CERT BUSINESS_ENTITY,
    AV.ETHNICITY ETHNICTY,
    AV.PO_NUMBER_FORMAT CONTRACT,
    TO_CHAR(VP.PAYMENT_DATE,'YYYY') P_YEAR,
    TO_CHAR(VP.PAYMENT_DATE,'Q') P_QTR
    SUM(VP.INVOICE_AMOUNT) AMOUNT_PAID_$
    FROM CONFIRM.VSTATE_PAID_AWARD_VENDORS AV,
    CONFIRM.VSTATE_VENDOR_PAYMENTS VP
    WHERE ( ( AV.PO_NUMBER = VP.PO_NUMBER
    AND AV.VENDOR_ID = VP.VENDOR_ID ) )
    --AND (TO_CHAR(VP.PAYMENT_DATE,'Q') = '4')*
    --AND ( TO_CHAR(VP.PAYMENT_DATE,'YYYY') = '2009' )*
    GROUP BY TO_CHAR(NVL(AV.TAX_ID,999999999),'000000000'),
    AV.FIRM_NAME,
    AV.BIDCLASS,
    AV.AWAMT,
    AV.SOL_MODE,
    AV.CERT,
    AV.ETHNICITY,
    AV.PO_NUMBER_FORMAT ,
    TO_CHAR(VP.PAYMENT_DATE,'YYYY') P_YEAR,
    TO_CHAR(VP.PAYMENT_DATE,'Q') P_QTR
    union
    SELECT TO_CHAR(NVL(AV2.TAX_ID,999999999),'000000000') FEID,
    AV2.FIRM_NAME VENDOR_NAME,
    AV2.BIDCLASS CONTRACT_CODES,
    AV2.AWAMT AWARD_AMOUNT,
    AV2.SOL_MODE FORMAL_INFORMAL,
    AV2.CERT BUSINESS_ENTITY,
    AV2.ETHNICITY ETHNICTY,
    AV2.PO_NUMBER_FORMAT CONTRACT,
    TO_CHAR(VP.PAYMENT_DATE,'YYYY') P_YEAR,
    TO_CHAR(VP.PAYMENT_DATE,'Q') P_QTR
    0 AMOUNT_PAID_$
    FROM CONFIRM.VSTATE_PAID_AWARD_VENDORS AV2
    WHERE
    not exists (SELECT 'X'
    FROM CONFIRM.VSTATE_VENDOR_PAYMENTS VP2
    WHERE av2.po_number = vp2.po_number
    AND (TO_CHAR(VP2.PAYMENT_DATE,'Q') = TO_CHAR(VP.PAYMENT_DATE,'Q') )
    AND ( TO_CHAR(VP2.PAYMENT_DATE,'YYYY') = TO_CHAR(VP.PAYMENT_DATE,'YYYY') ))
    --AND (TO_CHAR(AV2.AWDATE,'Q') = '4')*
    --AND (to_CHAR(AV2.AWDATE,'YYYY') = '2009')*
    GROUP BY TO_CHAR(NVL(AV2.TAX_ID,999999999),'000000000'),
    AV2.FIRM_NAME,
    AV2.BIDCLASS,
    AV2.AWAMT,
    AV2.SOL_MODE,
    AV2.CERT,
    AV2.ETHNICITY,
    AV2.PO_NUMBER_FORMAT,
    TO_CHAR(VP.PAYMENT_DATE,'YYYY') P_YEAR,
    TO_CHAR(VP.PAYMENT_DATE,'Q') P_QTR
    Tamir

  • Output Variable - Type: Date - Problem with WSDL in Designer

    Greetings,
    We are seeking some information about the following:
    We have a process in Process Designer that has and output variable of the type: Date. When the process is activated and we connect to a WSDL in LC ES Designer we get both a DATE and CALENDAR in the Data View.
    Hope that is at least somewhat clear. Please respond with any help or questions.
    Thanks,
    Rick Kuhlmann
    Tech-Pro

    This is to distinguish between java.util.Date and java.util.Calendar types. If the date is returned as java.util.Date, it will be in the DATE.date field. If the date is returned as java.util.Calendar, it will be in the DATE.calendar field.
    There are a bunch of xPath dates function in the xPath builder you can use.
    Jasmin

  • How to get 100 latest hits from dynamic query?

    Hello,
    using a dynamic query like BTQAct returns the 100 first results.
    I know how to change the number of results by setting parameter MAX_HITS, but is there a possibility to get the latest 100 results without getting all results and delete the oldest till 100 remains?
    In GENIL_BOL_BROWSER I see additional parameters MATCH_TYPE, DROP_SEL_PARAMS_ALLOWED and SELECTION_HINTS, but I don't know, how to use them and what they are doing.
    regards
    Martin

    Hi Martin,
    All the bol parameters that you have mentione dwill not help you unfortunately.
    The only facility provided in the wb ui as of now is to automatically customise the no of results (ie max hits),but not the order in which they are displayed.
    Though there is a sort option in the table view,which can be enabled throguh html and you can sort the same on any of the date fields tha you have.BUt if you want to do any kind of xtra processing of the search results then you have to do it in eh_onsearch().Here after getting the results collection,you can filtre them on the basis that you want.If you do thsi,you will also be able to delete all the older from the result collection xcept for the 1st 100 like you said.This will ensure that the results are filetred only on the Ui level and no harm is done to the database entires as such.

Maybe you are looking for