Can I pass a table function parameter like this?

This works. Notice I am passing the required table function parameter using the declared variable.
DECLARE @Date DATE = '2014-02-21'
SELECT
h.*, i.SomeColumn
FROM SomeTable h
LEFT OUTER JOIN SomeTableFunction(@Date) I ON i.ID = h.ID
WHERE h.SomeDate = @Date
But I guess you can't do this?... because I'm getting an error saying h.SomeDate cannot be bound. Notice in this one, I am attempting to pass in the table function parameter from the SomeTable it is joined to by ID.
DECLARE @Date DATE = '2014-02-21'
SELECT
h.*, i.SomeColumn
FROM SomeTable h
LEFT OUTER JOIN SomeTableFunction(h.SomeDate) I ON i.ID = h.ID
WHERE h.SomeDate = @Date

Hi
NO you cant pass a table function parameter like this?
As When you declare @date assign value to it and pass as a parameter it will return table which you can use for join as you did it in first code 
But when you pass date from some other table for generating table from your funtion it doesnt have date as it is not available there
Ref :
http://www.codeproject.com/Articles/167399/Using-Table-Valued-Functions-in-SQL-Server
http://technet.microsoft.com/en-us/library/aa214485(v=sql.80).aspx
http://msdn.microsoft.com/en-us/library/ms186755.aspx
https://www.simple-talk.com/sql/t-sql-programming/sql-server-functions-the-basics/
http://www.sqlteam.com/article/intro-to-user-defined-functions-updated
Mark
as answer if you find it useful
Shridhar J Joshi Thanks a lot

Similar Messages

  • Can i pass plsql table as parameter in a report and display the values

    Hi.I have a form with five text items.
    Also inside the form I have a button and when I push the button the trigger fires(WHEN BUTTON PRESSED) and the values of the form passed and display in the report.Is it possible to have in the form a detail for example with three rows and three columns and with some way(mayby as plsql table) pass all the parameters from the form to report and then display in the report?I asume the report is a tabular report.
    Thanks in advance Panagiotis.

    Hi Nigel,
    By default, SharePoint will display folder icon for document sets in the search results.
    If you need to change this icon in search results, then you can modify the display template for document sets.
    http://blogs.technet.com/b/tothesharepoint/archive/2013/09/04/understand-how-search-results-are-displayed-in-sharepoint-server-2013.aspx
    How did you set query in the Result Source?
    I tested the query below in the result source in my environment, and it worked fine.
    {searchTerms}ContentTypeID:0x0120D520*
    I recommend to check if the document sets have been crawled in crawl log.
    If not, please run a full crawl in Search Service Application and then check the results.
    Best regards.
    Victoria
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • Pass temporary table as parameter to a procedure from Java

    Hi,
    I have a PL/SQL procedure that has as input parameter a temporary table. For calling this procedure from PL/SQL there is no problem: I declare a variable having the type temporary table%ROWTYPE, I fill the table with data and then call the procedure. Now I have to call this procedure form Java and I do not know how can I declare a variable of type temporary table, fill it with data and then pass it to the procedure. I have seen and implemented passing arrays of strings or numbers to stored procedures but I have no clue how can I pass the temporary table. Anyone any clues?
    Thank you,
    Florin

    Hi Avi,
    the table is defined like this:
    CREATE GLOBAL TEMPORARY TABLE ticket_api (
    ticket VARCHAR2(16),
    party_id NUMBER,
    date_from DATE,
    date_to DATE )
    ON COMMIT PRESERVE ROWS;
    there is defined a type like this:
    TYPE ticket_tabletype IS
    TABLE OF ticket_api%ROWTYPE;
    the procedure definition is like this:
    PROCEDURE get_ticket_data (
    p_tickets IN ticket_tabletype ,
    x_action_plan OUT NOCOPY action_plan_tabletype );
    the action_plan_tabletype is defined like this:
    TYPE action_plan_tabletype IS
    TABLE OF action_plan_cursor%ROWTYPE;
    When calling the procedure from PL/SQL I use the following code:
    DECLARE
    inTickets ticket_tabletype := ticket_tabletype ();
    outActionPlan action_plan_tabletype;
    BEGIN
    inTickets.EXTEND;
    inTickets(1).ticket := 'ABCDEFG';
    inTickets(1).party_id := 123456789;
    inTickets(1).date_from := TO_DATE('01-JAN-05', 'DD-MON-YY');
    inTickets(1).date_to := SYSDATE;
    get_ticket_data(
    p_tickets => inTickets,
    x_action_plan => outActionPlan);
    DBMS_OUTPUT.PUT_LINE('Actions: '||outActionPlan.COUNT);
    END;
    Thanks for your quick feedback,
    Florin

  • Can we pass epuser as a parameter?

    Hi,
    Can we pass epuser as a parameter to the Transactio iview or filed in the R3?
    While we creating an iview, application parameters or when we create in webdynpro ivew how can we pass? if how can and what can we write there?
    any help please.
    regards
    Kumar.

    Hi Kumar
    If you intend to send static parameter only, you can just pass it using the Application Parameter property of the iview.
    However, if you need to send dynamic parameters like user-id or something, you have to add and register a service to your existing appintegrator par file.
    Kindly follow this URL :
    The customer exit of the Application Integrator
    Regards,
    Nitin

  • Can we pass Internal tables to workflow container?

    workflow container has a size limitation, we need to pass any infotype to the workflow container, so can we pass internal tables to workflow container or is there any alternate solution?
    Thanks in Advance
    Hari

    Hi,
    Check the <a href="http://help.sap.com/saphelp_nw2004s/helpdata/en/a6/9bac935f2c11d194a40000e82dec10/frameset.htm">Multiline Container Element Definition.</a>
    Regards
    <i><b>Raja Sekhar</b></i>

  • How would I format my table to look like this?

    Hi, I need to learn how to use tables to format the table to look like this.
    http://img695.imageshack.us/i/screenshot20100206at945.png/
    I've tried messing around and watching some tutorials. but I don't really see examples of this particular type of style. Most examples I saw only has the first row and first column high lighted.
    Please explain to me how to get the "objective, weighing factor, parameter" separated without bars and making the stuff underneath that tile have a certain color.
    Thank you

    figured it out haha thanks

  • Pass rowtype as function parameter, as a Object like type. How?

    Hi.
    I have the following question.
    I have 3 tables:
    TAB1
    TAB2
    TAB3
    I declare 3 rowtypes variables, one for each table:
    v_tab1 TAB1%ROWTYPE;
    v_tab2 TAB2%ROWTYPE;
    v_tab3 TAB3%ROWTYPE;
    I want to pass a rowtype as a function parameter, but i want the function to allow any rowtype to be passed as parameter, and then inside the function convert that "object" to the correct rowtype.
    Is that possible?
    In another language like C# for example, i would pass the rowtype as a object type, and then cast it to the correct data type.
    I hope you can help me.
    Cheers.

    To do this they would have to be object types, and have a common supertype.Alternatively unrelated object types could be abstracted away with ANYDATA.
    There is no such functionality exposed / documented for records - although the signatures of several built-in packages suggest that a mechanism for passing ADTs as formal parameters does actually exist.

  • How can I pass Recordsets as input parameter to a Function ?

    Hi Gurus,
    I want to create a function that receive recordsets as input parameter also returns recordsets as output.
    I have a requirement to do stock taking for all order items of one Order number in one single query execution (to avoid row by row basis).
    From the post in the forum I know that a function can return recordsets / query result using REF CURSOR or pipelined table function.
    My question is : how to pass the recordsets as input parameter to that function ?
    (because I could have 75 rows item in one order number)
    Below is the DDL and the query :
    create table stocks (Product char(4), Warehouse char(5), expireddate date, qty_available number)
    insert into stocks values('P001', 'WH001', '01-dec-2006', 30)
    insert into stocks values('P001', 'WH002', '01-dec-2006', 50)
    insert into stocks values('P001', 'WH002', '01-jan-2007', 50 )
    insert into stocks values('P001', 'WH001', '01-Mar-2007', 150)
    insert into stocks values('P002', 'WH003', '01-dec-2006', 25)
    insert into stocks values('P002', 'WH003', '15-Jan-2007', 50)
    insert into stocks values('P002', 'WH003', '01-Mar-2007', 75)
    insert into stocks values('P003', 'WH001', '01-dec-2006', 30)
    insert into stocks values('P003', 'WH002', '15-Jan-2007', 40)
    insert into stocks values('P003', 'WH003', '01-Mar-2007', 50)
    CREATE TABLE Order_Detail (PRODUCT_ORD CHAR(4), QTY_ORD number, Priority_WH CHAR(5) )
    INSERT INTO Order_Detail VALUES ('P001', 75, 'WH003') // previously 'WH002'
    INSERT INTO Order_Detail VALUES ('P002', 45, 'WH002')
    INSERT INTO Order_Detail VALUES ('P003', 55, NULL)
    The query for stock taking :
    select product,warehouse,expireddate, least(qty_available-(sm - qty_ord),qty_available) qty
    from ( select product,warehouse,expireddate,qty_available,qty_ord, sum(qty_available) over(partition by product order by s.product,expireddate,decode(warehouse,priority_wh,0,1),warehouse ) sm
    from stocks s,order_detail o
    where s.product = o.product_ord order by s.product,expireddate,decode(warehouse,priority_wh,0,1) )
    where (sm - qty_ord) < qty_available

    Hi,
    This my requirement :
    I have (simplified)Order_Detail as below :
    CREATE TABLE Order_Detail (PRODUCT_ORD CHAR(4), QTY_ORD number, Priority_WH CHAR(5) )
    INSERT INTO Order_Detail VALUES ('P001', 75, 'WH003') // previously 'WH002'
    INSERT INTO Order_Detail VALUES ('P002', 45, 'WH002')
    INSERT INTO Order_Detail VALUES ('P003', 55, NULL)
    Then I want to do stock taking from my STOCK table (described on my first post on this thread)
    create table stocks (Product char(4), Warehouse char(5), expireddate date, qty_available number)
    The rule is : The stok taking is on First In First Out basis, on expireddate.
    And I want to do it in single query.
    I want to make this a Function / Stored Procedure so that other transaction can also make use of this query.
    That is why I need to pass the 3 rows oy mr Order_Detail above, do the query, and return the result.
    Then INSERT the result into ORDER_DETAIL_PER_EXPIRED_DATE table.
    I hope this clear my requirement, is this possible ?
    Thank you,
    xtanto

  • How to pass a table as parameter on a stored procedure

    Hello all,
    I want to pass the name of a table as parameter into a stored procedure, that will be used for cursors etc.
    But when i pass the parameter and i compile the S.P. it give me error (error: table not existing...)
    Any Help?
    Thanks in advance, Marco

    Marco wrote:
    As i've written above, i'm using stored procedures like 'batch' programs which will be executed with oracle scheduler (passing to s.p. the name of the 'input' tables)
    These input tables are 'external' tables which have got the same structure; for example i've got TABLEX_001, TABLEX_002, XXTAB etc. with the same structure.
    This is the the reason... what do you think?An external table definition can reference multiple files via the LOCATION definition or you can user "ALTER TABLE" to alter the location and change the file that the external table points to.
    Thus you only need one static External Table and use an alter table (via execute immediate) to change the file location it points to, or if you want all the data together, just specify all the files in the location.
    That would be clean design, using one fixed table, without the need to pass any table names, just dynamically altering the file names if necessary at run time.

  • Problem in Passing internal table Function module

    Hi experts,
    I am new to creating function module and needed certain suggestions.
    I have created a type inside the FM
    types: begin of T1
    field A
    field  B
    end of T1.
    Now, i have populated the internal table of this type but how to send it through the tables tab of my FM.
    IN the parameter, i can write my internal table name but what should be associated type ...
    Please give some suggestions

    Hi,
      Not required.
    Table parameter will behave like type table of Z_sturcture. So just define the structure and use it in the TABLE parameter.It will convert that into internal table..
    Example :
    Parameter name         Typing                Associated type
    T_RETURN                  LIKE                   your Z_structure
    If you want to give table in the import parameter, then you need to create the table type for the structure.....

  • Using Container operation step can i pass one table to another?

    hi
    i have 2 multiline container elements in the workflow.
    in one of my step i am sending email using the receipents from the table LT_RECLIST which is a multiline container. Now before this step i am using a container operation step to pass LT_RECLIST_FINAL to LT_RECLIST. But guess this is not working? is this possible?
    the condition in container operation step is like this
    Result Element   LT_RECLIST
    Assignment         =     Assign (contents of table are deleted first)
    Expression          &LT_RECLIST_FINAL&
    Operator
    any idea where i am going wrong?

    instead of
    =     Assign (contents of table are deleted first)
    try the followinng option.
    <-    Add only to table (contents are extended)
    or you can directly use the element LT_RECLIST_FINAL in your mail step instead of assigning it to LT_RECLIST and using this element. if both the elements are going to store the same values then there is no point in using a separate element.

  • Can I pass a table using field-symbols to a PERFORM

    Can I pass an internal table using a field-symbol via a PERFORM that is stored in another program.
    For example, I want to pass lt_data using a field-symbol.  If I can do this, please tell me how to define a field-symbol for a table and how I setup the parameters on the FORM.
       perform TEST_FIELD_SYMBOLS in program zadd_data
                      changing lt_data[]
                       if found.
    Thanks.
    Regards,
    Ryan

    Since in ABAP all FORM-paramters are passe call-by reference, it makes imho no difference if u pass a table directly or via a fieldsymbol.
    U can pass a REF TO DATA to a form and then assign it to an FS like shown in the following example.
    TYPES: BEGIN OF s_data,
             data TYPE c,
           END OF s_data,
           s_tab TYPE STANDARD TABLE OF s_data.
    TYPES: r_tab TYPE REF TO data.
    START-OF-SELECTION.
      DATA: t_foo TYPE s_tab.
      DATA: ref_foo TYPE r_tab.
      GET REFERENCE OF t_foo INTO ref_foo.
      PERFORM my_form_fs USING ref_foo.
    FORM my_form_fs USING u_ref TYPE r_tab.
      FIELD-SYMBOLS: <fs> TYPE s_tab.
      DATA: w_tab TYPE s_data.
      ASSIGN u_ref->* TO <fs>.
      w_tab-data = 'X'.
      APPEND w_tab TO <fs>.
    ENDFORM.
    This also works for external performs....
    Best regards,
        Sebastian
    Message was edited by:
            Sebastian Rötzel

  • Can I replace my table with divs, in this context?

    Hi,
    I'm trying to accomplish something without the use of tables. Maybe someone can tell me how.
    - The skeleton is basically made up of 3 newspaper-style columns.
    - Their widths aren't very likely to change -- their widths will be fixed -- so this eliminates one problem right off the bat, right?
    - The first column (left) is a sidebar menu, and it has its own distinct background image pattern.
    - The other two columns (mid and right) share a flat background. Right now, I'm just calling the same 1k JPG twice (once in each of those two columns/cells). I find this simpler than creating an unnecessary container just for the common background.
    - All 3 columns begin at the same line (0).
    So far so good, the fixed widths and the fact that they all begin at y=0 makes this easier than it otherwise could have been.
    Now here's the tricky part :
    - The amount of content is different from page to page (some pages are longer than others), and the amount of content per column will also vary individually (so the sidebar might be the longest column in one file, the mid column could be the longest element in the next, and so on...)
    - The layout is horizontally centered.
    - All 3 columns need to end at the same spot, which will be dynamic from page to page (in other words, the backgrounds of these columns need to stretch/repeat until the end of the column with the most content, whichever of the 3 columns that may be on any given page).
    - There is a page-end image to display that is as wide as the combined 3 column widths.
    As you can imagine, using a table with 3 columns makes this easy as pie. But I was told to avoid tables whenever possible, so if there's an easy way to justapose 3 divs and have them behave like 3 cells of the same table -- without too much markup -- I'd give it a try, and potentially leave tables behind for good.
    It would be easy enough to create a large container div, horizontally center it, and left-float 3 divs inside it... but this doesn't address the problem of having to have those backgrounds repeat all the way to the end of the site. The way I just described, the backgrounds would vertically end wherever the content of that individual column ends.
    And since we know divs don't like height=100%, well...
    Any help would be appreciated.
    Thanks!

    Have you tried using Faux Columns?
    http://www.alistapart.com/articles/fauxcolumns/
    or Project Seven's Equal Height Columns script?
    http://www.projectseven.com/tutorials/css/pvii_columns

  • Can't open up Itunes (its been like this for months, and no response.)

    I can not access itunes. Whenever I click on it it says:
    "iTunes has encountered a problem and needs to close. We are sorry for the inconvenience.
    If you were in the middle of something, the information you were working on might be lost."
    It has been like this for a while. One day itunes just stopped working. Help from Apple would be nice.
    E machine Windows XP
    E machine   Windows XP  

    we're still on track.
    Error Number: 0x80040707
    Description: DLL function call crash: QtinstallCode.QuicktimePostinstallProc
    that's a known complication of a broken QuickTime. in this context, it usually means the installation configuration information of the QuickTime has been compromised.
    here's what we'll try first.
    Download and install the Windows Installer CleanUp utility. then use it to clear any existing QuickTime installation configuration information from your PC:
    Description of the Windows Installer CleanUp Utility
    next use the QuickTime component of the complete uninstall instructions in the following document as a guide to a manual removal of leftover QuickTime program files and folders.
    Trouble installing iPod, iTunes, or QuickTime software in Windows
    once we've got all the existing QuickTime scraped away, let's try another careful standalone QT 7.0.4 reinstall.
    does it go through properly this time? if so, does your itunes launch properly again?
    love, b

  • How can i edit a photo to look like this?

    hey, i just started using photoshop and i recently took a lot of cute summer pictures. i would like to make them look a little more dreamy, abstrct, artsy... maybe a little vintage...
    what i'm aiming at is something like this:
    i know its probably really hard to make something like this, but what would be some basic tools and steps to take?
    thanks so much
    laila

    Could you post a lores of one of your unedited images?
    Anyway, I would assume a combination of Curves or Levels and Hue/Saturation Adjustment Layers to edit the contrast and color of an image combined with a vignetting effect (also achievable in many ways) may achieve some of the effect.
    A Layer with the Filter Clouds (black/white) applied, set to Blend Mode Linear Light and with reduced Opacity may help achieve a somewhat blotchy appearance.
    As for the »confetti«: like the previous poster pointed out Brushes may do that.
    Randomization in the Shape Dynamics, Scattering and Color Dynamics might help there.

Maybe you are looking for