CodeSmith Community
Your Code. Your Way. Faster!

Missing Sproc? *_Find_Dynamic

Latest post 06-20-2008 10:51 PM by SuperJeffe. 5 replies.
  • 01-30-2007 7:53 AM

    • Tyrven
    • Not Ranked
    • Joined on 01-30-2007
    • Redmond, WA
    • Posts 8
    • Points 160

    Missing Sproc? *_Find_Dynamic

    The file Sql[Entity]ProviderBase.generated.cs contains a reference to the stored procedure "dbo.[Table]_Find_Dynamic" under one of the Find() overloads.  This stored procedure, however, does not exist in the database (and yes, I set the "IncludeFind" property to true).  Is this a bug?  Does it intend to reference _GetPaged() (which is dynamic)?  I haven't noticed any errors associated with this, but found the reference and was confused by its purpose.
    • Post Points: 35
  • 01-30-2007 12:06 PM In reply to

    Re: Missing Sproc? *_Find_Dynamic

    No, Find uses dynamic parameterized SQL, so the header for the code is there, but the implementation is done at runtime.

    Robert Hinojosa
    -------------------------------------
    Member of the Codesmith Tools, .netTiers, teams
    http://www.nettiers.com
    -------------------------------------
    • Post Points: 65
  • 01-31-2007 3:32 AM In reply to

    • Tyrven
    • Not Ranked
    • Joined on 01-30-2007
    • Redmond, WA
    • Posts 8
    • Points 160

    Re: Missing Sproc? *_Find_Dynamic

    I'm not totally following.  So does it dynamically generate the stored procedure and then call it...?  (That seems peculiar).  Or, if it's just passing a parameterized SQL statement then why does it need a stored procedure name?  [Sorry if I'm being dense here]. 
    • Post Points: 35
  • 07-12-2007 1:58 PM In reply to

    • ToddMoon
    • Top 100 Contributor
    • Joined on 05-22-2007
    • Rochester, NY
    • Posts 44
    • Points 840

    Re: Missing Sproc? *_Find_Dynamic

    The procedure stub is located in Procedures.xml which is embedded into the Data assembly. At run time it extracts the procedures and loads them into memory. When you call certain overloads of Find, it takes the Find_Dynamic stub, replaces some placeholders (including ones for your where clause) and executes the command. (hence why it's called "dynamic"). 

    • Post Points: 5
  • 06-01-2008 5:10 AM In reply to

    Re: Missing Sproc? *_Find_Dynamic

     Hi Robert,

      If it is created at runtime then I can't see in the generated code.  I did note however that it does appear in the Procedures.xml file but unlike the other stored procedures (that are created) there is a "skip" attribute on the "procedure" element:

     <procedure owner="dbo" name="User_Find_Dynamic" grant="" skip="true">

     Is this a bug or is there a switch that needs to be ticked to automatically these stored procedures?

    PS  I have just done a quick review of the 2.2.0 code and noted that this functionality has _not_ been implemented. Might explain why it's not there :)

     ------------------------

    Additional:  I now understand how the dynamic creation is happening.  I have isolated my issue.  I was using AppendIn which allows you to do an SQL IN Statement.  My supplied values were strings so I supplied them as I would in an SQL Query (ie 'test1','test2','test3').  This failed because of the quotes.  If I removed the quotes (ie test1,test2,test3) then the code worked fine.

    I still think this is a bug that needs to be addressed in that netTiers should recognise the quotes.  For example, the following value list will cause netTiers to not funtion as expected: 'this, is my test','testing','tested, again'.  Note the commas inside the quotes.

    I'll post a bug report regarding this. 

     

    • Post Points: 35
  • 06-20-2008 10:51 PM In reply to

    • SuperJeffe
    • Top 25 Contributor
    • Joined on 05-05-2006
    • Tulsa, Ok
    • Posts 339
    • Points 8,535

    Re: Missing Sproc? *_Find_Dynamic

    ----------------------------------------------------------------------
     Member of the .NetTiers team | Visit http://www.nettiers.com
    ----------------------------------------------------------------------

    • Post Points: 5
Page 1 of 1 (6 items) | RSS
Copyright © 2008 CodeSmith Tools, LLC
Powered by Community Server (Commercial Edition), by Telligent Systems