Passing parameters to a Select Query

Hi,
I am going to add "send to" feild in the check in page, this field is a dropdown list filled by a Result set that retrieve users form User table according to the following query
SELECT dname FROM USERS WHERE Umanager =? OR Umanager IN (SELECT Umanager FROM USERS WHERE DNAME= ?) OR DNAME IN (SELECT Umanager FROM USERS WHERE DNAME= ?)
where ? represents the logged in user DNAME. the pomnit how can I pass this parameter from the check in page.

Hey Younis, looks like you don't have the tracker installed, that's ok.
A simpler way is to just write a service that calls the CHECKIN_NEW service and add that parameter you want to it; you can add this in the component you're already writing.
These are the steps to you create a service called MY_CHECKIN:
1. Open your custom component with component wizzard.
2. In the Resource Definitions tab, click Add.
3. Select Template and click Next.
4. Click Next.
5. Set the name to MY_CHECKIN.
6. Set the Class to Pages.
7. Set the Form Type to mycomponent.
8. Set the File Name to my_service_page.htm.
9. Click Finish.
10. In the Resource Definitions tab, click Add.
11. Select the Service button and click Next.
12. Click Next.
13. Name the service MY_CHECKIN and make it call CHECKIN_NEW and add the parameter you want.
14. Set the Service Class to Service.
15. Click Finish.
16. Restart the Content Server.
Hope that helps,

Similar Messages

  • Pass collections into to select query on IN caluse

    Hi friends,
    I wanted to pass collections in to select query IN caluse .
    Eg..
    Declare
    type tab is table of varchar2(25);
    v_tab tab:
    type tab1 is table of varchar2(25);
    v_tab1 tab:
    Begin
    select ename into v_tab from emp where deptno in (10,20,30);
    select location into v_tab1 emp_hist where ename in ( v_tab1 ); -- here where i wnt to pass the collections
    End;
    i dont want to write an loop to do this , i like to use only collections ? any idea how
    thanks in advance .
    Raj

    Hi Raj,
    In the examples above you will need to have a type declared in the database, however you can create a pipelined function to do what you want... something like this,
    SQL> Create OR Replace Package My_Types Is
      2 
      3     Type enames_tab Is Table Of Varchar2(50);
      4 
      5  End My_Types;
      6  /
    Package created
    SQL> Create OR Replace Function lookup_ename Return my_types.enames_tab
      2     Pipelined Is
      3     v_row   my_types.enames_tab;
      4     cur     Sys_Refcursor;
      5     v_ename Varchar2(50);
      6  Begin
      7     v_row := my_types.enames_tab();
      8     Open cur For
      9        SELECT ename
    10          FROM emp
    11         WHERE ename IN ('SMITH', 'JAMES', 'WARD');
    12     Loop
    13        Fetch cur
    14           INTO v_ename;
    15        Exit When cur%Notfound;
    16        v_row.Extend;
    17        v_row(v_row.Count) := v_ename;
    18        Pipe Row(v_row(v_row.Count));
    19     End Loop;
    20     Return;
    21  End;
    22  /
    Function created
    SQL> Set Serveroutput on;
    SQL> Declare
      2     v_tab my_types.enames_tab;
      3  Begin
      4     SELECT ename Bulk Collect
      5       INTO v_tab
      6       FROM emp
      7      WHERE ename IN (SELECT *
      8                        FROM Table(lookup_ename));
      9 
    10     For i IN v_tab.First .. v_tab.Last Loop
    11        dbms_output.put_line(v_tab(I));
    12     End Loop;
    13  End;
    14  /
    SMITH
    WARD
    JAMES
    PL/SQL procedure successfully completedRegards,
    Christian Balz

  • Passing Parameters to a report query

    I have built a report query, the query has 3 parameters.
    select * from EMP_DETAIL
    where
    emp=:EMPP
    and loc=:LOCP
    and seq=:SEQP
    When I test the query, enter the parameters manually, it renders and I get my report.
    When I add this layout to a standard on screen report region, I can not figure out how to pass the column values to those parameters.
    I'll try to explain. I have a report
    SELECT * FROM EMP
    The users can filter the report down, then when they find the emp they want, I have created a report link that is supposed to run the detail query and have the detail report come up in a PDF.
    So lets say they choose employee 0009, the columns have the :LOCP and the SEQP
    I want the report query for the PDF print to be filled in and the report rendered and printed. Like I said, I can test the report query/layout from the shared components section but I can not get the column values of say #EMP#,#LOC#,#SEQ# passed to the report.
    When I click the report, it appears to run forever. I do not know what is being passed to the report query.

    Starting to wonder if my question doesn't make sense.
    Does not seem to be something that hard.
    I have a APEX 3.0 stored report query and layout loaded via the shared components section. The stored report accepts 3 parameters.
    I have an employee report region (Select * from emp) and I have a derived link column that has a pretty picture in it. What I want to happen is when the users naturally migrate towards the bright colors on the screen in front of them and peck away at the mouse button, the values of the corresponding 3 columns are passed to the stored report and the report is ran and a PDF pops up and surprises the little buggers... sorry users that they actually managed to do something other than whine.
    Ideas, any takers?
    Maybe I will have to start a new thread with subject of
    "PLZ HELP MZ URGENT!!!!!! PLZ PLZ "
    or
    "ORACLE IS STUPIDO!!!"
    Those seems to get a lot of replies, some even helpful :)

  • Using parameters in a select query sometimes not working

    I use parameters throughout my code - usually without problem, but for some reason in one case it does not return a result. When I modify the querystring to contain the value instead of using parameters it works. Is it because I'm secting a clob? or is it because I'm using a 9i ODP.net dll against a 10g database? this is c# 2.0
    here's the source code that does not work for me - REQUEST_DATA is a clob:
        public String loadRequest(String PSRNumber)
            String returnVal = null;
            ConnectionStringSettings connectionInfo = System.Configuration.ConfigurationManager.ConnectionStrings["Scribe"];
            OracleConnection myConnection = new OracleConnection();
            String strSQL = "select PSR, REQUEST_DATA from stats.request where PSR = :PSR";
            try
                myConnection.ConnectionString = connectionInfo.ConnectionString;
                OracleCommand cmd = new OracleCommand(strSQL, myConnection);
                cmd.CommandType = CommandType.Text;
                cmd.Parameters.Add("PSR", OracleDbType.Varchar2).Value = PSRNumber;
                myConnection.Open();
                OracleDataReader dr = cmd.ExecuteReader();
                if (dr.Read())
                    returnVal = dr.GetOracleString(dr.GetOrdinal("REQUEST_DATA")).ToString();
                else
                    returnVal = null;
                dr.Dispose();
                cmd.Dispose();
            catch (OracleException ex)
                printError(ex.Message);
            finally
                myConnection.Close();
                myConnection.Dispose();
            return returnVal;
        }when I replace the line generating the sql, and remove the lines pertaining to parameters it works:
    String strSQL = String.Format("select PSR, REQUEST_DATA from stats.request where PSR = {0}", PSRNumber);
    I'm fine just using this as a workaround, but I need an explanation why the other does not work - I prefer to use parameters.
    Message was edited by:
    user633546

    I figured it out. thank you for your help in pointing me in the right direction.
    the problem was there was a trailing space in the data.
    when the data for that table is numeric for every record, the query allows me to leave out the single quotes. Trailing spaces do not seem to cause the database to see it as non-numeric - leaving out the quote still finds the record even if there is a trailing space.
    but when I put in the quote, it is not an exact string match, so it could not find the record. sometimes this flexibility gets me into trouble :\

  • How to pass parameters to a SQL query or Data template

    Hi,
    The requirement is that my final report will take 'date' as input from the user and print only those records which have date later than the user-supplied 'date'. ('Date' is a field in the database).
    I know the way to achieve this is to use user-defined parameters.
    I have read the user guide, and have created user parameters. From the user guide: "The Report Editor allows you to define your query, define
    the parameters that you want users to pass to the query,..."
    However there is no example given. (I could not find).
    Any guidance?

    Are you using Enterprise Server environment ? If so, you can find a sample report in the Shared Folders under HR Manager - Employee Salary Report. Please revert if you still have confusion.

  • Passing parameters to oracle query

    Hi Everyone,
    I'm a newbie to oracle and need help passing parameters to an oracle query. For example, I need to show all the employees in a certain department.So a list of "DEPT_CODE"'s will be displayed on a webpage and then the selected value will be passed to the query. I currently have this query in MS Access and use the bracket for user input ("[Dept]"). But how can this be done in oracle?
    I am using ASP.NET 2.0 and Crystal Reports XI. Basically I have a webform where users can select the date range and department from a listbox. When the submit button is clicked, the values are passed to the query in crystal reports. For example, I have a query with "DEPT" as a parameter. So I pass the value of the selected listbox item from the webform to the crystal report. But now I have to select data from an oracle database and provide parameters. This is where I need help.
    Thanks in advance
    -Sam

    Duplicate post.
    Refer to this thread
    Passing parameters to oracle query

  • How to compare dates in a select query in open sql

    Hi
                       How can I retrieve data pertaining to a specified date using a select query.
    I have inserted date using the following code:
    String dateString = "2009-03-11";
    java.sql.Date date = java.sql.Date.valueOf(dateString);
    PreparedStatement stmt =con.prepareStatement("insert into DATEACCESS"
                                                                            + "(DATETEST)"
                                                                            + "values (?)");
    stmt.setDate(1,date);
    stmt.executeUpdate();
    How can I pass this in a select query,the below mentioned query did not fetch me any results.
    Select * from  DATEACCESS where DATETEST='2009-03-11'

    Hi
    Has ur date  problem resolved  ?
    If not resolved u can do the following
    As u already have sql date today declared . You want to get the data depending on that date
    As ur query is
    if( today != null)
    String query2 = select * from DATEACCESS where DATETEST<= ?
    PreparedStatement ps = conn.prepareStatement(query2);
    ps.setDate(1,today)
    ResultSet rs = ps.executeQuery();
    While(rs.next)
        ////// Here u will get data from query u needed ///
    If this also does not work just print the date and check in which format is it returning u .
    Regards
    Anuradha Rao
    Edited by: Anuradha Rao on Mar 20, 2009 10:16 AM

  • How to ignore zero in select query

    select * from EINA where  EINAMATNR = <b>yyyy</b> and EINALIFNR = <b>zzzz</b>
    In select query, how to ignore zero? for example, EINAMATNR = 0000000yyyy, EINALIFNR=000zzz
    Maybe I can use LIKE keyword in sql query. Any other way?
    Thanks.

    Use the following conversion routines to convert yyyy & zzzz  to remove the leading zeros and then pass it to your select query.
    For Matnr -> CONVERSION_EXIT_MATN1_INPUT
    For LIFNR ->CONVERSION_EXIT_alpha_input.
       CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
            EXPORTING
              input  = yyyy
            IMPORTING
              output = t_lifnr.
          CALL FUNCTION 'CONVERSION_EXIT_MATN1_INPUT'
            EXPORTING
              input  = zzzz
            IMPORTING
              output = t_matnr.
    select * from EINA where EINA~MATNR = t_matnr  and EINA~LIFNR = t_lifnr .

  • Using buffering option in select query

    Hi All,
           Can anybody give me a brief idea on , where we will use the buffering and how we will write it in coding part.Similarly please tell me what will happen if we use  by passing buffering  addition in select query. Please explain  it with steps of sample code if possible.
    Thanks in advance.
    Regards,
    Rakesh.

    Hi Sharma,
    Buffer is used to hold large amount of data.
    if internla table is unable to hold data.. Buffer is used..this is mainly used in copy data from PRD to Quality as a part testung.
    see the sample code how the buffer is used..
    FUNCTION zzrfc_get_zcpeg_fg_related.
    *"*"Local Interface:
    *"  IMPORTING
    *"     VALUE(PL_VERSION) LIKE  ZCPEG_FG_RELATED-PL_VERSION OPTIONAL
    *"     VALUE(BYPASS_BUFFER) LIKE  SY-FTYPE DEFAULT SPACE
    *"     VALUE(FROM_KEY) LIKE  SY-ENTRY DEFAULT SPACE
    *"     VALUE(GEN_KEY) LIKE  SY-ENTRY DEFAULT SPACE
    *"     VALUE(MAX_ENTRIES) LIKE  SY-TABIX DEFAULT 0
    *"     VALUE(TABLE_NAME) LIKE  X030L-TABNAME
    *"     VALUE(TO_KEY) LIKE  SY-ENTRY DEFAULT SPACE
    *"  EXPORTING
    *"     VALUE(NUMBER_OF_ENTRIES) LIKE  SY-INDEX
    *"  TABLES
    *"      ENTRIES STRUCTURE  ZCPEG_FG_RELATED
    *"  EXCEPTIONS
    *"      INTERNAL_ERROR
    *"      TABLE_EMPTY
    *"      TABLE_NOT_FOUND
      TABLES dd02l.
      DATA: BEGIN OF buf OCCURS 100,
                line(4100),
            END OF buf.
      DATA keyln TYPE i.
      DATA: l_tabname LIKE dd25v-viewname.
      DATA: l_len     TYPE i.
      DATA : w_plversion TYPE /sapapo/vrsioex.   "PJONNALA
      w_plversion =  pl_version.                 "PJONNALA
      l_tabname = table_name.
      CALL FUNCTION 'VIEW_AUTHORITY_CHECK'
        EXPORTING
          view_action                = 'S'
          view_name                  = l_tabname
          no_warning_for_clientindep = 'X'
        EXCEPTIONS
          OTHERS                     = 6.
      IF sy-subrc <> 0.
        RAISE internal_error.
      ENDIF.
      IF bypass_buffer NE ' ' AND bypass_buffer NE 'N'.
        bypass_buffer = 'Y'.
      ENDIF.
      IF gen_key CA ' '. ENDIF.
      keyln = sy-fdpos.
    * read client dependant tables always with client
      SELECT SINGLE * FROM dd02l WHERE tabname = table_name
                                  AND as4local =  'A'.
      IF dd02l-clidep = 'X'.
    *l_len = strlen( sy-mandt ) * cl_abap_char_utilities=>charsize.
    *  " ecwg. unicode
    *    move gen_key to gen_key+l_len.
    *    move sy-mandt to gen_key(l_len).
    *    add l_len to keyln.
        CONCATENATE sy-mandt gen_key INTO gen_key.
        keyln = STRLEN( gen_key ) * cl_abap_char_utilities=>charsize.
      ENDIF.
    *  endselect.
      IF keyln NE 0 OR from_key = space.
        CALL 'C_GET_TABLE' ID 'TABLNAME'  FIELD table_name
                           ID 'INTTAB'    FIELD buf-*sys*
                           ID 'GENKEY'    FIELD gen_key
                           ID 'GENKEY_LN' FIELD keyln
                           ID 'DBCNT'     FIELD number_of_entries
                           ID 'BYPASS'    FIELD bypass_buffer.
      ELSE.
        CALL 'C_GET_TABLE' ID 'TABLNAME'  FIELD table_name
                           ID 'INTTAB'    FIELD buf-*sys*
                           ID 'FROM_KEY'  FIELD from_key
                           ID 'TO_KEY'    FIELD to_key
                           ID 'DBCNT'     FIELD number_of_entries
                           ID 'BYPASS'    FIELD bypass_buffer.
      ENDIF.
      CASE sy-subrc.
        WHEN 4.  RAISE table_empty.
        WHEN 8.  RAISE table_not_found.
        WHEN 12. RAISE internal_error.
      ENDCASE.
      DESCRIBE TABLE buf LINES number_of_entries.
    ENDFUNCTION.
    Regards,
    Prabhudas

  • Select query using variable

    Hi all,
    If I have a variable with multiple value (returned from bulk collect), how can I pass it into a select query as a condition?
    Eg.
    set serveroutput on
    declare
    type v_LockSessInfo is table of integer;
    empdata v_LockSessInfo;
    begin
    select unique sid bulk collect into empdata from v$lock;
    [select sid,serial#,username from v$session where sid in (empdata)]
    end;
    I hope to be able to pass in the variable collected, into the next select statement. How can I achieve it?
    Thanks in advance.
    Eugene

    Sorry for any confusion caused, I have almost 0 knowledge on pl/sql, only can survie on normal sql query.
    Further elaboration, the intention of my query is to query out any locking that exists in my DB. It meant to serve as a report to management, so I have to break it down into couple of sections for easier reference (minimising the complication that may arise from others who view the report).
    Couple of steps/procedures I am thinking of:
    1) query out the unique sid that exists in v$lock (blocking and blocked sessions) <<< this set of returned record (SIDs) should be stored in a variable.
    Eg. achived by the select statement "select unique sid from v$lock into [variable]"
    2) query v$sessions for the lock details from step 1's output. Username, sid, serial#, machine etc.
    Eg. To be achieved by "select sid,serial#...... from v$session where sid in [variable]; Same condition applies to 2 and 3.
    3) query v$locked_object to identify which are the blocking/blocked sessions, and who's blocking who from step 1's output.
    4) query the locked object and locked record (based on rowid locked) from step 1's output.
    This is all that I can think of at the moment. Any opinions that can perform the above activity will be appreciated alot. Hope I'm able to clear up any confusion triggered.
    PS: I can't re-query the SID as the SID may change or be lost upon the re-query therefore losing any evident. Thus I was thinking of putting it into a variable for consistent querying for step 2,3 and 4. All 4 steps will be performed within a single script.
    Regards
    Eugene
    Edited by: eteo78 on May 28, 2009 8:40 AM

  • Passing parameters to select query in DB link from invoke...

    I am having a DB partner link which executes the select query based on user specified parameter.
    Now i have created an invoke activity and specified input[this needs to be passed to query] and output parameters[this is query result]. This invoke activity calls DB partner link in which one parameter has been created to be used in select query. So my doubt is , will DB partner link take up the input parameter of invoke activity automatically or do we need to specify any mapping for this?

    When you create a db partnerlink the parameter you create for your select is the input and when you create the input variable in the invoke for this partnerlink it is created with the right type for the parameter.
    Create an Assign before your invoke and assign a value to the input variable you created in the invoke. That value will be passed and used as the parameter in the select.
    Heidi.

  • SSRS,MDX- Passed parameters are not hitting the main query in Dataset

    I have created a SSRS report which has to accept two parameters i.e., store name, Date(to show sales on particular date) in report. which are working fine for me. but, those passed parameters are not hitting the main query in main Dataset. what ever i
    pass in parameters, it is displaying all the rows(every city values). i think i am not correct in creating the statement in  Main dataset query, to receive those 2 parameters into the main query. can anybody please help me how to create the statement
    in main date set to display the results for the exact parameter i am passing(which has to be in MDX).
    ram

    Hi ramprasad74,
    According to your description, you want to use parameter in the report, then after parameter values are selected, corresponding data will be displayed in the report. But the parameters do not work and all the rows are displayed.
    To pass parameter to main report dataset, we need to define parameter for MDX query and assign parameter name same as SSRS report parameter. For detail information, please refer to the following steps:
    Create a Dataset to retrieve data for Store name parameter.
    Create Store name parameter, type name and prompt, set Date type to Text, check Allow multiple values check box, then select get values from the dataset.
    Create a Dataset for Date parameter.
    Create Date parameter, type name and prompt, set Date type to Date/Time, then select get values from the dataset.
    Create a new dataset used to retrieve data for the report, add statement like below to the mdx query: {STRTOMEMBER(@Date)} * {STRTOSET (@Store_name)}.
    In Query Designer pane, click Query Parameters and assign parameter name same as SSRS report parameter.
    For more information about SSRS Report with Single and Multi Selection Parameter using MDX Query, please refer to the following blog:
    http://www.codeproject.com/Articles/799265/SSRS-Report-with-Single-and-Multi-Selection-Parame
    If you have any more questions, please feel free to ask.
    Thanks,
    Wendy Fu
    If you have any feedback on our support, please click
    here.

  • How to pass the feild names of a select query dynamically?

    Hi
    How can we pass the feilds names in select query dynamically?
    For example in my selection screen i wil be giving the table name, and feilds in that table.....
    those feilds should be taken in my select query...
    instead of
    PARAMETERS : tab_name TYPE ddobjname .
      SELECT *
        FROM (tab_name)
        INTO TABLE <newtab>
       UP TO 25 ROWS.
    parametrs : feild1 like-------
                     feild2----
    i need select feild1 feild2 feild3    FROM (tab_name)
        INTO TABLE <newtab>
       UP TO 25 ROWS.

    by the way, contrary to popular belief there is no performance problem when using
    SELECT * FROM dbtab INTO CORRESPONDING FIELDS OF TABLE itab WHERE ...
    as long as the structure of itab contains only the required fields.
    I ran some benchmarks against this and above construct is maybe 0.1% slower (Oracle 10g) than a
    SELECT f1 f2 f3 f4 ... FROM dbtab INTO TABLE itab WHERE ...
    but is saves you from maintaining a potentially very long field list in your code. So when you need additional fields later on, you just add them to the DDIC structure or type definition and that's it.
    Maybe something you want to factor in here.
    Cheers
    Thomas

  • Passing parameters to table valued functions and using parameters as column name on select

    I am creating a function where I want to pass it parameters and then use those parameters in a select statement. When I do that it selects the variable name as a literal not a column. How do I switch that context.
    Query:
    ALTER FUNCTION [dbo].[ufn_Banner_Orion_Employee_Comparison_parser_v2]
    @BANNER_COLUMN AS VARCHAR(MAX),
    @ORION_COLUMN AS VARCHAR(MAX)
    RETURNS @Banner_Orion_Employee_Comparison TABLE 
    LAST_NAME nvarchar(max),
    EMPNO int,
    BannerColumnName nvarchar(max),
    BANNER nvarchar(max),
    ORION nvarchar(max)
    AS
    BEGIN
    INSERT INTO @Banner_Orion_Employee_Comparison
    (LAST_NAME, BANNER, ORION)
    SELECT
    a.LAST_NAME, @BANNER_COLUMN, @ORION_COLUMN
    FROM OPENQUERY(ORCLPROD_APDORACLE, 'select LAST_NAME, BANNER_RANK, BADGE, EMP_STATUS from XTRACT_VIEW') AS a
    inner join IWM_Stage.dbo.ViewPersonnel AS b
    on a.BADGE = b.badge
    WHERE a.EMP_STATUS = 'A'
    and a.BANNER_RANK <> b.[rank]
    RETURN;
    END;
    GO
    Output
    I execute this:
    select * from ufn_Banner_Orion_Employee_Comparison_parser_v2 ('a.BANNER_RANK' , 'b.[rank]')
    and get:
    Cerecerez NULL
    NULL a.BANNER_RANK
    b.[rank]
          

    George,
    You could go for using a CASE statement as earlier mentioned by Erland. This would look like below: (Downside is that you need to be mentioning all possible values in the CASE)
    ALTER FUNCTION [dbo].[ufn_Banner_Orion_Employee_Comparison_parser_v2]
    @BANNER_COLUMN AS VARCHAR(MAX),
    @ORION_COLUMN AS VARCHAR(MAX)
    RETURNS @Banner_Orion_Employee_Comparison TABLE
    LAST_NAME nvarchar(max),
    EMPNO int,
    BannerColumnName nvarchar(max),
    BANNER nvarchar(max),
    ORION nvarchar(max)
    AS
    BEGIN
    INSERT INTO @Banner_Orion_Employee_Comparison(LAST_NAME, BANNER, ORION)
    SELECT
    a.LAST_NAME
    , CASE @BANNER_COLUMN WHEN 'a.BANNER_RANK' THEN a.BANNER_RANK WHEN 'a.BADGE' THEN a.BADGE END --put values as required
    , CASE @ORION_COLUMN WHEN 'b.[rank]' THEN b.[rank] END --put values as required
    FROM OPENQUERY(ORCLPROD_APDORACLE, 'select LAST_NAME, BANNER_RANK, BADGE, EMP_STATUS from XTRACT_VIEW') AS a
    inner join IWM_Stage.dbo.ViewPersonnel AS b
    on a.BADGE = b.badge
    WHERE a.EMP_STATUS = 'A'
    and a.BANNER_RANK <> b.[rank]
    RETURN;
    END;
    GO
    Another method that I would suggest is to get all values from the function, then build a dynamic query to obtain results from it .. Something like:
    ALTER FUNCTION [dbo].[ufn_Banner_Orion_Employee_Comparison_parser_v2]()
    RETURNS @Banner_Orion_Employee_Comparison TABLE
    LAST_NAME nvarchar(max),
    EMPNO int,
    BannerColumnName nvarchar(max),
    BANNER nvarchar(max),
    ORION nvarchar(max)
    AS
    BEGIN
    INSERT INTO @Banner_Orion_Employee_Comparison(LAST_NAME, BANNER, ORION)
    SELECT
    * --Returns all the columns
    FROM OPENQUERY(ORCLPROD_APDORACLE, 'select LAST_NAME, BANNER_RANK, BADGE, EMP_STATUS from XTRACT_VIEW') AS a
    inner join IWM_Stage.dbo.ViewPersonnel AS b
    on a.BADGE = b.badge
    WHERE a.EMP_STATUS = 'A'
    and a.BANNER_RANK <> b.[rank]
    RETURN;
    END;
    GO
    --Execution
    DECLARE @BANNER_COLUMN AS VARCHAR(MAX), @ORION_COLUMN AS VARCHAR(MAX),@SQL NVARCHAR(MAX)
    SET @BANNER_COLUMN='BANNER_RANK'
    SET @ORION_COLUMN='[rank]'
    SET @SQL='
    select LAST_NAME,'+@BANNER_COLUMN+','+@ORION_COLUMN+' from ufn_Banner_Orion_Employee_Comparison_parser_v2 ()'
    PRINT @SQL
    EXEC @SQL
    You just need to make sure that the column names returned by the function are UNIQUE (Using proper alias names) so that you don't have a problem referring to them from the outside..
    Thanks,
    Jay
    <If the post was helpful mark as 'Helpful' and if the post answered your query, mark as 'Answered'>

  • Select query as input in PARAMETERS.

    Hi Expert,
    We need to give input as Select query. Like below are examples.
    1) Select * from ekko into table it_data where bukrs = 3000. or
    2) select fld1 fld2 fld3 from tablename into it_data up to 10 rows where fld4 = XXXXX.
    We want to pass only such query as input and want result according to them. User can put any table name, can chose any table fields, also he can use inner join group by statements also.
    Remember we want to pass only select query by user in PARAMETERS as below.
    parameters: option type string.
    In Option we need to wright that select query.
    Please provide some coding samples.
    Thanks And Regards
    Ranjeet Singh

    I think you should stay in strong oposition to customer requirement like that. This is like dynamic SQL, which if not authenticated properly would give a user to insight very sensitive data (like salaries, payments etc). Actually in SAP there is some sophisticated tool like that, called SAP Query. The user who have proper authorization can create any query he likes with no ABAP knowledge at all. I would really stick to what SAP provides by standard.
    If your custmer, is however persistent in his decision (he pays, he decides), you should developed such tool with dynamic program generation, which as mentioned above can be achieved with [GENERATE SUBROUTINE POOL|http://help.sap.com/abapdocu_70/en/ABAPGENERATE_SHORTREF.htm]. RTTS will not help here as they can be used only for dynamic structure/tables generation, not queries themselves.
    Regards
    Marcin

Maybe you are looking for

  • Can't get photo gallery slide show to work

    Hello, If anyone could help, I'd appreciate it. This is for a non-profit I work for. After getting the gallery to work, I can't get the slide show to work. from my gallery.html: <title>Photo Gallery</title> <link href="../css/screen.css" rel="stylesh

  • Tidal vs Powershell

    Hi, Visited this one before with limited success but now its time to try again. Platform is TES 6.1.0.212 running on Solaris x86, CM is on RH linux, agent on windows server 2003. I'm attempting to automate some MS excel work via powershell. I have a

  • Changing a field type in OBIEE 11g

    Hello. I am new here, and new to OBIEE. I have read some of the tutorials and created a repository, but will not get formal training through Oracle until next week. I have a simple request from a user that I need to do, and I am not sure how to do it

  • New Search Bar

    Hi People, I'm sure most of you have noticed the new tab buttons on the top of the page. And chances are you've also seen the new search bar and how it works much like "Spotlight" does. I'm trying to understand how it actually works but unfortunately

  • Updated to iOS 5.0 / restore Backup from iOS 4.3.3 not possible!!!

    Hi everybody! On Saturday I changed my iPhone 4 on the new operating system iOS 5.0, here the steps as I proceeded: Usind iTunes 10.5.0.142 1) I'm beginning to create a full backup (as the backup was still iOS 4.3.3). 2) Then I wanted to select the p