• RELEVANCY SCORE 4.32

    DB:4.32:Where Clause In Entitydatasource Using In ac





    Hello,

    I am creating an EntityDataSource in an ASPx page. It works until I try to change the WHERE clause. I want to use an IN statement (to lookup results in a separate table). Does not work. Any assistance greatly appreciated.
    EnableFlattening=False EntitySetName=CustodianAccounts
    Select=it.[custodianAccount_ID], it.[custodianAccount_Name], it.[custodianAccount_AccountNumber], it.[custodianAccount_BRAccountNumber]
    Where=it.[custodianAccount_ID] IN (SELECT [custodianAccountCompositeMapping_PortfolioAccountID] FROM [CustodianAccountCompositeMapping])
    Thanks,
    Dan

    DB:4.32:Where Clause In Entitydatasource Using In ac

    You could also possibly use a join depending on your situation, like this:
    var query = from c in context.Collection
    join d in otherCollection on c.field equals d.field
    select c;
    This effectively either does a SQL join or passes the values in as a constant array. It's faster than Contains if you're using a small set. But like I said, it depends on your situation which one you should choose...

  • RELEVANCY SCORE 3.78

    DB:3.78:Entitydatasource Where Issue 8p





    Hi there,
    I am trying to add a where clause to an EntityDataSource. In code the where clause would look something like this:
    (it.DateFrom.Month == @Month || it.DateTo.Month
    == @Month) it.Member.ID == @MemberId
    I want to select value where the Month of the DateTo and DateFrom fields in the table is equal to a parameter that I would supply.
    When I add the clause to my EntityDateSource I get the following exception:
    'Month' is not a member of type 'Edm.DateTime'
    Any Ideas on how I can go about putting this where clause in?
    Thank you.

    DB:3.78:Entitydatasource Where Issue 8p

    Hi,

    When you use Entity SQL in the where clause you need to use the Entity SQL date and time canonical functions.
    You can read about them here:
    http://msdn.microsoft.com/en-us/library/bb738563.aspx
    The code you supplied should be something like:
    (Month(it.DateFrom)
    == @Month || Month(it.DateTo) == @Month) it.Member.ID == @MemberIdGil Fink

  • RELEVANCY SCORE 3.78

    DB:3.78:Entitydatasource Bound To Multiple Entities ma





    I am currently using an EntityDataSource control on my page and while going through the wizard, I noticed that the EntityDataSource only allows me to choose a single Entity from my EntityDataModel for binding to my ASP.Net GridView control. However,
    I would like to be able to select multiple Entities for data retrieval in a manner similar to the SQLDataSource control.
    Is there a way to accomplish this using the EntityDataSource control and if so, how?
    Thanks.

    DB:3.78:Entitydatasource Bound To Multiple Entities ma

    Hi vs2010junkie,
    Welcome!
    To tell you truth, I'm not familiar with this control, but I think you can use Include property to get the related Entities:

    http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.entitydatasource.include.aspx
    By the Way, you should repost your question here:
    http://forums.asp.net/54.aspx/1?DataSourceControlsSqlDataSourceObjectDataSourceetcfor better response, thanks for understanding.
    Have a nice day.Alan Chen[MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

  • RELEVANCY SCORE 3.68

    DB:3.68:Entitydatasource And Inheritance 8d


    Good day,I've got either a bug or a lack of functionality with the EntityDataSource (or an error on my part?). Here is the code I am trying to use:    asp:EntityDataSource ID=dsEvents runat=server         ConnectionString=name=On3GoEntities DefaultContainerName=On3GoEntities         EntitySetName=Entity EntityTypeFilter=Event        Where=it.[EventType] == 1 and it.[Competition].[EntityID] == @CompID        Select=it.[Name], it.[EntityID], it.[EventType]        WhereParameters            asp:QueryStringParameter Name=CompID QueryStringField=id Type=Int32 /        /WhereParameters    /asp:EntityDataSourceYou can see there is an EntityTypeFilter. Event is derived from Entity and defined many more properties. Each have their own table (table per class model). Now the problem here is with the where clause: it.[EventType] errors out. The property EventType is not defined on the Entity class but the Event class. So what is the probleme here? Are the EntityTypeFilters applied after the Where so that I'm prevented from using properties declared in the derived class in Where? Am I making a mistake somewhere?Thanks,Alain-Daniel

    DB:3.68:Entitydatasource And Inheritance 8d

    This was a known limitation in the SP1 Beta. Can you confirm that you are using SP1 RTM?
     
    Thanks,
    Akhil Karkera - DP Community Team

  • RELEVANCY SCORE 3.60

    DB:3.60:How To Set Smalldatetime Field To Null In Database Using Entitydatasource And Formview? fj


    I built an entity object from a table where one of the columns is a nullable smalldatetime. This column - among others - is exposed on a web page using a FormView with an EntityDataSource providing the plumbing. When the user is editing an existing record and deletes the date (that is, clears the TextBox), I need the column to be set to null in the database. Currently, the field is not included in the auto-generated UPDATE statement. (I used SQL Profiler to inspect it). It appears the SQL only includes fields that are mapped to non-empty textboxes.I tried intercepting the FormView's ItemUpdating event and manually setting the field to null, but no SQL is generated for that field. Here is an example SQL that is generated after clearing the date text box and clicking save. The database column that should be set to null is named [Anniversary], and notice it is not mentioned anywhere:
    exec sp_executesql N'update [dbo].[JOINELIST]
    set [Customer Number] = @0, [First Name] = @1, [Last Name] = @2, [Address] = @3, [City] = @4, [State] = @5, [Zip] = @6, [Phone] = @7, [Email] = @8, [Birthday] = @9, [Spouse First Name] = @10, [Spouses Last Name] = @11
    where ([JOINELISTID] = @12)
    ',N'@0 nvarchar(4000),@1 nvarchar(5),@2 nvarchar(7),@3 nvarchar(17),@4 nvarchar(8),@5 nvarchar(8),@6 nvarchar(5),@7 nvarchar(12),@8 nvarchar(17),@9 datetime,@10 nvarchar(4000),@11 nvarchar(4000),@12 int',@0=N'',@1=N'Molly',@2=N'Smith',@3=N'123 Market Street',@4=N'Springfield',@5=N'Illinois',@6=N'61107',@7=N'815-222-5599',@8=N'MollyR001@site.com',@9='1981-05-15 00:00:00',@10=N'',@11=N'',@12=5
    Here is the EntityDataSource definition:
    asp:EntityDataSource ID=edsProspect runat=server ConnectionString=name=FiresideDnnEntitiesCn DefaultContainerName=FiresideDnnEntities EnableInsert=True EnableUpdate=True EntitySetName=JOINELIST Where=it.JOINELISTID = @id
    WhereParameters
    asp:QueryStringParameter DbType=Int32 Name=id QueryStringField=id /
    /WhereParameters
    /asp:EntityDataSource

    How do I force the EntityDataSource to set nullable fields to null when the TextBox is empty?Roger

    DB:3.60:How To Set Smalldatetime Field To Null In Database Using Entitydatasource And Formview? fj

    I built an entity object from a table where one of the columns is a nullable smalldatetime. This column - among others - is exposed on a web page using a FormView with an EntityDataSource providing the plumbing. When the user is editing an existing record and deletes the date (that is, clears the TextBox), I need the column to be set to null in the database. Currently, the field is not included in the auto-generated UPDATE statement. (I used SQL Profiler to inspect it). It appears the SQL only includes fields that are mapped to non-empty textboxes.I tried intercepting the FormView's ItemUpdating event and manually setting the field to null, but no SQL is generated for that field. Here is an example SQL that is generated after clearing the date text box and clicking save. The database column that should be set to null is named [Anniversary], and notice it is not mentioned anywhere:
    exec sp_executesql N'update [dbo].[JOINELIST]
    set [Customer Number] = @0, [First Name] = @1, [Last Name] = @2, [Address] = @3, [City] = @4, [State] = @5, [Zip] = @6, [Phone] = @7, [Email] = @8, [Birthday] = @9, [Spouse First Name] = @10, [Spouses Last Name] = @11
    where ([JOINELISTID] = @12)
    ',N'@0 nvarchar(4000),@1 nvarchar(5),@2 nvarchar(7),@3 nvarchar(17),@4 nvarchar(8),@5 nvarchar(8),@6 nvarchar(5),@7 nvarchar(12),@8 nvarchar(17),@9 datetime,@10 nvarchar(4000),@11 nvarchar(4000),@12 int',@0=N'',@1=N'Molly',@2=N'Smith',@3=N'123 Market Street',@4=N'Springfield',@5=N'Illinois',@6=N'61107',@7=N'815-222-5599',@8=N'MollyR001@site.com',@9='1981-05-15 00:00:00',@10=N'',@11=N'',@12=5
    Here is the EntityDataSource definition:
    asp:EntityDataSource ID=edsProspect runat=server ConnectionString=name=FiresideDnnEntitiesCn DefaultContainerName=FiresideDnnEntities EnableInsert=True EnableUpdate=True EntitySetName=JOINELIST Where=it.JOINELISTID = @id
    WhereParameters
    asp:QueryStringParameter DbType=Int32 Name=id QueryStringField=id /
    /WhereParameters
    /asp:EntityDataSource

    How do I force the EntityDataSource to set nullable fields to null when the TextBox is empty?Roger

  • RELEVANCY SCORE 3.55

    DB:3.55:Entitydatasource - Appropriate Way To Specify Records To Load jk


    Problem 1: Filtering EntityDatasource
    I have various controls that load from an EntityDataSource. What I want to do is be able to display only certain records, depending on what has taken place in the application. Right now I just set the .Where statement to restrict the records returned to
    only those I want to display. However, I'm not sure how to specify multiple things (i.e. Where-In).
    For instance, say I have an array of IDs (1, 2, 3, ...) and I want to say Where IDs are in the array?
    // Something like this, but of course this isn't right.
    edsTblA.Where = @it.[ID]In CustIDs[];
    Problem 2: Timing of Events
    I havethe data sourcefilter based on what row in a GridView is selected. The problem is that the edsTblA.Load fires before GridView1.OnRowCommand. So, how am I supposed to tell the EntityDataSource what to filter on when I don't know yet?Nathon Dalton
    Software Developer
    Systems Administrator
    Network Administrator
    Blog: http://nathondalton.wordpress.com

    DB:3.55:Entitydatasource - Appropriate Way To Specify Records To Load jk

    Diego,
    Yes, I'm using the .NET Framework 4.0. So, the .Contains() will work against a List of items? That's great! I'm already using a List to contain the IDs of therelated records. This way I can just do a .Contains(MyListOfIDs).Nathon Dalton
    Software Developer
    Systems Administrator
    Network Administrator
    Blog: http://nathondalton.wordpress.com

  • RELEVANCY SCORE 3.45

    DB:3.45:Case Expression In Where Clause cs


    Hello All,
    I am using Oracle8i database.
    Is it possible to use CASE expression within WHERE clause?
    I am trying to use one or the other where clause condition based on value of a column value.
    If that is possible, please give me an example
    thanks
    Srinivas Mandadi

    DB:3.45:Case Expression In Where Clause cs

    SQL select * from dual where 1 = case when 1 0 then 1 else 0 end;

    D
    -
    X

  • RELEVANCY SCORE 3.45

    DB:3.45:In Clause In Case Statement 7k


    Hi,
    Can we use IN Clause in CASEStatement.
    If yes, Please give an example using both CASE and In clauses in WHERE condition.
    Thanks.

    DB:3.45:In Clause In Case Statement 7k

    Hi Sudeep !
    First of all i need to make it clear that we have CASE Expressions in MS SQL Server not CASE Statements unlike programming languages which means CASE Expression can either result to True or False;
    Now, lets see the example below in which i am using CASE Expression in WHERE Clause and for comparision in CASE Expression i am using IN Cluase inside it.
    Both query 1 and query 2 will result in same output but thats how we can use CASE and IN Cluase togther inside WHERE.

    USE AdventureWorks
    GO

    --1)
    SELECT * FROM HumanResources.Employee
    WHERE 1 = CASE WHEN EmployeeID IN (1,10,11) THEN 1
    WHEN ManagerID IN (6,21,109) THEN 1 END

    --2)
    SELECT * FROM HumanResources.Employee WHERE EmployeeID IN (1,10,11) OR ManagerID IN (6,21,109)

  • RELEVANCY SCORE 3.45

    DB:3.45:Entitydatasource Connecting To Bll 98


     
    Hi
     
    Is it possible for the EntityDataSource to connect to an EDM in another referenced project(Class Library) within the same solution?
     
    I haven't been able to locate any information on this but would assume it is a very common requirement as otherwise you are forced to restrict your application to 1 layer if you wish to use the EntityDataSource.
     
    Many Thanks
     
    Geoff

    DB:3.45:Entitydatasource Connecting To Bll 98

    Neozack,Yes, the EntityDataSource should be able to work with your entity classes wheter they are compiled in a separate assembly or not. It only needs to be able to locate the metadata (either embeded in the assembly or in separate csdl/msl/ssdl that is copied to the output directory) and the CLR types for your entities (that are Entity Framework compatible, like code-gen classes derived from Entity Object or hand-crafted classes that implement the necessary intefaces).If you are experiencing problems with this, in my experience the most likely point of failure is the connection string. Let me know if this information helps.DiegoThis posting is provided AS IS with no warranties, and confers no rights.

  • RELEVANCY SCORE 3.37

    DB:3.37:Order By Clause In Sub Query md


    Hi,

    Can we use order by clause in Sub query?

    While using the order by clause, I am getting the "missing expression error" . If I remove order by clause query executing fine.

    Here is my query:

    select *
    from emp_mstr
    where emp_no in(select
    emp_no
    from emp_mstr
    order by branch_no);

    Thanks Regards,
    Mahi

    DB:3.37:Order By Clause In Sub Query md

    user8504133 wrote:
    Thanks for the early replies...

    My requirement is "list the employees of the bank in the order of the branch names at which they are employed"

    Thanks,
    Mahiselect *
    from emp_mstr
    order by branch_no;And if you want to order by branch name, you will have to do a join to BRANCH_MASTER..

    Edited by: jeneesh on Mar 26, 2013 10:29 AM

  • RELEVANCY SCORE 3.31

    DB:3.31:Entitydatasource - Impossibile Determinare Lo Schema A Causa Del Seguente Errore Restituito Da Entitydatasource: Impossibile Trovare Il Tipo Clr Per ... mk


    Buonasera,
    quando cerco di aggiornare lo schema di un oggetto entitydatasource, mi viene restituito l'errore :
    Entitydatasource - Impossibile determinare lo schema a causa del seguente errore restituito da EntityDataSource: Impossibile trovare il tipo CLR per '...'
    per qualsiasi tabella io selezioni.
    Ho cercato in lungo e in largo ma non ho trovato soluzioni
    Connessione a mysql entity 5.0 .net 4
    Grazie anticipatamente
    David

    DB:3.31:Entitydatasource - Impossibile Determinare Lo Schema A Causa Del Seguente Errore Restituito Da Entitydatasource: Impossibile Trovare Il Tipo Clr Per ... mk

    Buonasera,
    quando cerco di aggiornare lo schema di un oggetto entitydatasource, mi viene restituito l'errore :
    Entitydatasource - Impossibile determinare lo schema a causa del seguente errore restituito da EntityDataSource: Impossibile trovare il tipo CLR per '...'
    per qualsiasi tabella io selezioni.
    Ho cercato in lungo e in largo ma non ho trovato soluzioni
    Connessione a mysql entity 5.0 .net 4
    Grazie anticipatamente
    David

  • RELEVANCY SCORE 3.22

    DB:3.22:Viewobject With Where Clause z3


    I am using JDev 9.03.
    I created a VO and in expert mode I added a where clause that accepts 1 parameter. I have a uiXML page that needs to pass a parameter to a second page and use that parameter in the VO where clause. I need to have the parameter set in the where clause before the page can be rendered. How do I do this?

    DB:3.22:Viewobject With Where Clause z3

    I have been watching another thread and received an answer as to how to do this within a servlet.

    Viktor wrote:
    You must get exactly the same object that bc4j has created.
    From bajacontext you can reach everything...
    like appmodule.. and even ViewObject..

    Add a null event, which runs before your page is rendered...
    event name="null"
    bc4j:findRootAppModule name="PenCmpAppModule"
    bc4j:findViewObject name="RdmsViewUsage"
    method class="FrmFilters" method="handleRdms"/
    /bc4j:findViewObject
    /bc4j:findRootAppModule
    /eventand create an event handler...

    public static EventResult handleRdos(BajaContext context, Page page, PageEvent event)
    { ViewObject vobj= ServletBindingUtils.getViewObject(context);
    HttpSession session = context.getServletRequest().getSession(false);
    String OrgId=(String)session.getAttribute("S_ORGID");
    vobj.setWhereClause("ORG_ID='"+OrgId+"'");
    vobj.executeQuery();
    return null; }

  • RELEVANCY SCORE 3.20

    DB:3.20:Entityframework Validation Bug af


    I'm using a ListView with an EntityDataSource mapped to a SQL database. Apparently, there is automatic data validation upon insert that fires before the EntityDataSource OnInserting event. This automatic validation works beautifully for integer
    fields, but crashes on string (varchar or nvarchar in the database) fields. In both cases nullable=false.
    Bug or feature?

    DB:3.20:Entityframework Validation Bug af

    Hi,
    Welcome to the MSDN forum.
    According to your description, your problem is not supported in this forum. You can post inDataSource Controls - SqlDataSource, ObjectDataSource,
    etcforum. There are experts in that forum so that you can get better response.
    Thank you for your posting and understanding.
    Have a nice day.Paul Zhou [MSFT]
    MSDN Community Support | Feedback to us

  • RELEVANCY SCORE 3.20

    DB:3.20:Queryextender Limitation? 3j


    Hi..I'm using EntityDataSource and QueryExtender to display records on my page in gridview. The problem is I'm getting error of
    'col1' is not a member of type 'System.Data.Common.DbDataRecord' everytime my page is AutoPostBack. This error can be solved by removing Select attribute in my EntityDataSource, but I cannot remove it as I need to use GroupBy for my records.
    Is anybody can help me pls? Thx..

    DB:3.20:Queryextender Limitation? 3j

    Hi Shahrizal,
    Thanks for posting in MSDN forums.
    EntityDataSource is an ASP.NET control, I will suggest you to try ASP.NET
    ADO.NET, Entity Framework, LINQ to SQL, NHibernateforum for better support.
    Thanks for your understanding.
    Best regards,Chester Hong
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help

  • RELEVANCY SCORE 3.20

    DB:3.20:Confused With Performance Using Apex Items In Where Clause Vs. Hard Coding m7


    I am rather confused as to why I am having a performance issue when using the APEX Item in my where clause versus just hard coding the values.

    I have a SQL that searches a list of invoices by date. When using APEX Items in my where clause, the report takes 15-20 seconds to run. However, if I hard code the same values straight into the where clause, the report runs in 1-2 seconds.

    When using the below where clause runs in 15-20 seconds
    and i.invoice_date between TO_DATE(:P19_INVOICE_DATE_FROM) and to_date(:P19_INVOICE_DATE_TO) + 1

    When using the below where clause runs in 1-2 seconds
    and i.invoice_date between TO_DATE('01-MAR-2009') and to_date('05-MAR-2009') + 1

    Confused,
    Brian

    DB:3.20:Confused With Performance Using Apex Items In Where Clause Vs. Hard Coding m7

    When you run it with the hard coded dates, do you also try running it with other dates as well? I mean, the apex items ar ethey the same values as the hard-coded items?

    Also, try running it in sql developer and determine the execution plan for your select, see if there are any indexes being used, maybe you need to optimize your select... (Explain Plan)

    Remember, sometimes a full-table scan is NOT a BAD thing...

    Thank you,

    Tony Miller
    Webster, TX

  • RELEVANCY SCORE 3.18

    DB:3.18:Re: Using Function In Where Clause? x7



    I need to use this function in where clause of select

    Go ahead - it's fine with me if you want to do that.

    DB:3.18:Re: Using Function In Where Clause? x7

    This way you can do but
    there will be context switching between SQL engine and PLSQL engine...better not to try this as this will take long time on huge data set.

    Try to use the IN condition in the select statement directly.

  • RELEVANCY SCORE 3.18

    DB:3.18:Need Clarification For Below Where Clause pk


    i have requirment to add below conditions in where clause not in select clause using case expression

    CANC_MO CANC_YR are not 0 then do not process rows where the CANC_MO CANC_YR is EFF_DATE how can i?

    i should include this condition in "Where " clause

    Help

    S

    DB:3.18:Need Clarification For Below Where Clause pk

    oraclehema wrote:
    i have requirment to add below conditions in where clause not in select clause using case expression

    CANC_MO CANC_YR are not 0 then do not process rows where the CANC_MO CANC_YR is EFF_DATE Manik had the rigth method, but I think there is a mistake on the "do not process rows"
    As you are comparing CANC_MO and CANC_YR with a Date, I suppose those 2 fields are Month and Year of a date
    So I'd say :
    where (CANC_MO!=0 and CANC_MO!=0 and CANC_YR||CANC_MO=to_char(EFF_DATE , 'YYYYMM'))

    I only process rows IF it's not 0 and YR||MO=Year-Month part of EFF_DATE

  • RELEVANCY SCORE 3.06

    DB:3.06:How Change The Where Clause In Block? fm


    Hi
    I want to change dynamically the "Where" clause in Block properyty.

    Im using like below is it correct?

    Set_block_property('statemaster',default_where,'statecode = :Statecode');

    kanish

  • RELEVANCY SCORE 3.05

    DB:3.05:Viewobject Where Clause 38


    Hi, i need to get the where clause from vo in a manage bean method when i'm using a query component.
    I have a button than execute one reports and I need to pass to reports a where clause generate in the page with the query component.
    thanks in advance

  • RELEVANCY SCORE 3.05

    DB:3.05:Where Clause da



    Hi all,

    I need to know how to use WHERE clause in expression.

    thanks in advance

    DB:3.05:Where Clause da


    Go for set analysis

    Sum({TYPE ={'A','B'}, ID ={'1','2'}} Sales)

    Means Provide Sum of sales where TYPE = A,B and ID=1,2

  • RELEVANCY SCORE 3.04

    DB:3.04:Concatenazione Where 8j


    ri-salve a tutti
    per popolare in datagrid con una entitydatasource ho effettuato delle istruzioni di questo tipo

    Dim s() As String = Split(testo, )
    EntityDataSource1.Select = it.[data], it.[titolo], it.[regione], it.[provincia], it.[CodiceArt]

    DB:3.04:Concatenazione Where 8j

    Di niente, sono sempre felice quando posso dare una mano!
    Ricordati di marcare le risposte :-)Marco Minerva [MCPD]
    Blog: http://blogs.ugidotnet.org/marcom
    Twitter: @marcominerva

  • RELEVANCY SCORE 3.04

    DB:3.04:How Do I Insert Data Into A Related Table When Oninserting Event Fires? pz


    I have two tables:
    AspnetUsers
    -------------------------
    Userid uniqueidentifier NOT Null PK
    UserName Nvarchar (256) NOT Null
    More column
    More Column
    UserProfiles
    ---------------------
    UserId uniqueidentifier Not null PK FK Default (newid())
    Username Nvarchar(256) Not Null
    More columns,
    More More columns
    There is a constraint between the 2 tables. When a user is insterted into the Aspnetusers table, I want the userName inserted into the UserProfiles Table.
    When a user logs in, I want them to be able to update their info. So I want the filter to load only their information so they can update it.
    I know I will have to set the Where Clause in Entity Datasource to userid = @UserId to filter by the username. So I did this in my Code behind Page
    CodeBehind
    --------------------
    Protected Sub EntityDataSource1_Selecting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.EntityDataSourceSelectingEventArgs) Handles EntityDataSource1.Selecting
    ' Get a reference to the currently logged on user
    Dim currentUser As MembershipUser = Membership.GetUser()
    ' Determine the currently logged on user's UserId value
    Dim currentUserId As Guid = CType(currentUser.ProviderUserKey, Guid)
    ' Assign the currently logged on user's UserId to the @UserId parameter

    I AM LOST FROM HERE. WHAT DO I DO HERE???
    End Sub
    I am using ENTITYDATASOURCE, ASP.NET and VB Visual Studio 2010 and ASP.NET membership.
    My Entity DS looks like this
    ----------------------------------------------
    asp:EntityDataSource ID=EntityDataSource1 runat=server
    ConnectionString=name=websellerEntities OnInserting=EntityDataSource1_Inserting

    DefaultContainerName=websellerEntities EnableFlattening=False

    EnableUpdate=True EntitySetName=userprofiles EntityTypeFilter=

    /asp:EntityDataSource

    DB:3.04:How Do I Insert Data Into A Related Table When Oninserting Event Fires? pz

    Greetings,
    Looks like I did not define my problem very well. Look at this
    http://social.msdn.microsoft.com/Forums/en-US/adodotnetentityframework/thread/2ea52e8b-d0c9-4f2a-903a-a5aa323cd5e9
    for a clearer definition of what I am trying to to.

    Essentially, what I want to do is add the username of the person making the insert into the other table.
    Thanks,
    yousaid

  • RELEVANCY SCORE 3.00

    DB:3.00:Entitydatasource Insert And Update In Formsview?? dm


    Hi All,Just wondering if it's possible to us EntityDataSource for insert and update in a formsview?Also, i have a number of related objects.. 1 to 1 in the particular entity i am trying to create formsview editing for. Some fields would require DropDownLists to show related objects.. is this possible to do? ie: have user select from DropDownList in edit and have the selected value carry over for an update using EntityDataSource?Hope i am being clear.. any tutorials doing this kind of thing? thanks,Rich

    DB:3.00:Entitydatasource Insert And Update In Formsview?? dm

    Hi All,Just wondering if it's possible to us EntityDataSource for insert and update in a formsview?Also, i have a number of related objects.. 1 to 1 in the particular entity i am trying to create formsview editing for. Some fields would require DropDownLists to show related objects.. is this possible to do? ie: have user select from DropDownList in edit and have the selected value carry over for an update using EntityDataSource?Hope i am being clear.. any tutorials doing this kind of thing? thanks,Rich

  • RELEVANCY SCORE 2.99

    DB:2.99:Execute Immediate mp


    Hi,

    I am using Execute Immediate in PLSQL. I can able to use Where clause value dynamically in the query with Using.
    Can I give the table name, column name in select statement and Column name in where clause Dynamically..?

    Select || "Dynamic Column" || from || "Dynamic table"|| where "Dynamic Column" = :1
    into t_temp
    using Value

    Is this possible..?

    DB:2.99:Execute Immediate mp

    user13024762 wrote:
    I have tables and columns like

    TBL_VAL1_FACT -- VAL1_ID, VAL1_KEY,
    TBL_VAL2_FACT -- VAL2_ID, VAL2_KEY,
    TBL_VAL3_FACT -- VAL3_ID, VAL3_KEY

    I want to write a query like

    Select VAL1_ID from TBL_VAL1_FACT where VAL1_KEY = 10
    Select VAL2_ID from TBL_VAL2_FACT where VAL2_KEY = 20
    Select VAL3_ID from TBL_VAL3_FACT where VAL3_KEY = 30

    I need a common query for these 3 statements.If each query returns the same result set datatypes then you could simply combine them as one query...

    Select VAL1_ID AS VAL_ID from TBL_VAL1_FACT where VAL1_KEY = 10
    UNION ALL
    Select VAL2_ID from TBL_VAL2_FACT where VAL2_KEY = 20
    UNION ALL
    Select VAL3_ID from TBL_VAL3_FACT where VAL3_KEY = 30

  • RELEVANCY SCORE 2.99

    DB:2.99:Entitydatasource: Nullable Column In Orderby Causes Paging Problems mm


    Hi,I have an EntityDataSource connected to an EDM entity set. The EDM entity has a nullable string property. The database column mapped to the entity's property is a nullable nvarchar. (I am using Table-per-Concrete-Class strategy in the EDM, so the EDM object has its own table in the database.) The actual table contains some rows with a NULL value for the property, and some rows with a NON-NULL (string) value.The EntityDataSource is bound to a GridView that has AllowPaging=true. When the EntityDataSource has OrderBy=it.[ExampleNullableProperty], all of the rows that show up on the first page of the GridView have a null value for the ExampleNullableProperty field. However, clicking the Next button (e.g. setting the GridView's PageIndex property to 1) causes the GridView to skip to the first page of data where the rows contain NON-NULL value for the ExampleNullableProperty field. For example, the GridView shows 10 rows per page. There are 100 rows in the database, 70 of which have MyExampleProperty set to NULL, and 30 of which have MyExamplePropety set to a NON-NULL value. When the GridView's PageIndex is set to 0, it shows rows 1-10. However, it shows rows 71-80 when the PageIndex is set to 1, 2, 3, 4, 5, or 6.
    When the EntityDataSource has OrderBy=it.[ExampleNullableProperty] DESC, there is a different problem. The first 3 pages of the GridView show the correct data, with the NON-NULL ExampleNullableProperty values correctly ordered. Clicking to the 4th page (or setting the GridView's PageIndex property to any number greater than 2) causes the GridView's EmptyDataTemplate content to be rendered.(How) can I sort by a nullable field using the OrderBy clause of the EntityDataSource?Thanks,Dan

    DB:2.99:Entitydatasource: Nullable Column In Orderby Causes Paging Problems mm

    Hi Kati,The database is SQL2k5, however in the EDMX file I have ProviderManifestToken explicitly set to 2000 (on the Schema element nested in the StorageModels element). I actually have a temporary secondary EDM file in the project to ease importing of data from a SQL2k database, and the web site will not run unless both EDMX files have the same ProviderManifestToken value. However, your suggestion of adding a second, NON-NULLABLE field to the OrderBy clause in the EntityDataSource has solved this issue. Thank you!OrderBy=it.[ExampleNullableProperty], it.[ExampleNonNullablePropertyOrPrimaryKey]

  • RELEVANCY SCORE 2.99

    DB:2.99:Where Filter And Contains Clause In Entitydatasource 9a


    When I try to get a users list matching a where clause with a contains restriction I get an error : The method call is not supported or something like that... asp:EntityDataSource ID=warriorSource runat=server ConnectionString=name=wwst8Entities DefaultContainerName=wwst8Entities EntitySetName=UserSet EnableUpdate=True EntityTypeFilter= Where=it.Name.Contains(@Name) WhereParameters asp:QueryStringParameter Name=Name QueryStringField=name Type=String/ /WhereParameters /asp:EntityDataSource Please Help.

    DB:2.99:Where Filter And Contains Clause In Entitydatasource 9a

    I found a solution what do you think about that ? asp:EntityDataSource ID=warriorSource runat=server ConnectionString=name=wwst8Entities DefaultContainerName=wwst8Entities EntitySetName=WarriorSet EnableUpdate=True Where=it.Name LIKE '%'+@Name+'%' EnableInsert=True WhereParameters asp:QueryStringParameter Name=Name QueryStringField=name Type=String DefaultValue=_/ /WhereParameters /asp:EntityDataSource

  • RELEVANCY SCORE 2.99

    DB:2.99:Empty Entitydatasource Does Not Render Gridview pz


    .net 4.5, ef5 beta, vs2011 beta, sql server 2012 express
    gridview does not display when entitydatasourceis empty. i assume thismay be by design, but then how doesone insert a new record using the declarative features of the controls?
    i added toa blank asp.net pagean entitydatasource configured for a table with a2 part key; hard coded the where clause to return the results for the foreign key rows.
    i added a gridview configured for the entitydatasource.
    browsing the page gives a cleaneggshell white page - no gridview. is there no way to force its rendering (without adding an empty row)so that a user could insert a new row? i know that i could write some code to do this, but i would like
    to know if the markup/declarative aspects of ef5 adn gridviewsupport an insert operation for an empty entitydatasource.
    the EmptyDataTemplate may provide a way out but the CommandField is not allowed so i am not clear how to toggle into an InsertItemTemplate.

    DB:2.99:Empty Entitydatasource Does Not Render Gridview pz

    Hi tonybonn,
    Welcome to MSDN Forum.
    I'm glad to hear that you have solved the issue, and thanks for your sharing.
    Best RegardsAllen Li [MSFT]
    MSDN Community Support | Feedback to us

  • RELEVANCY SCORE 2.96

    DB:2.96:Block Level How To Change Where Clause m3


    hi
    all
    i have to Change Where clause conditionally .
    in Block Level Where , Base Table is fix but Where Clause is Change Depend on Record .

    How Possible , help

    Thanks

  • RELEVANCY SCORE 2.95

    DB:2.95:Check For Using Where-Clause In Selects 83


    Hi,

    I have created a View and want to be used this only with a certain where-clause, e.g.:

    select ...
    from v_myview
    where mycolumn = ...;

    If there is no where-clause or in the where clause is no restriction to the column 'mycolumn', an exception should be thrown. The query is always executed by the same DB-User.

    Thanks for your answer.

    DB:2.95:Check For Using Where-Clause In Selects 83

    Closest is FGAC for you..
    http://download-west.oracle.com/docs/cd/B10501_01/appdev.920/a96590/adgsec02.htm#1006142

  • RELEVANCY SCORE 2.95

    DB:2.95:Re: How To Update A Record Without Using 'Where' Clause In 'Update' In Java c8


    hi,

    Ya.It sounds stupid for not using 'WHERE' clause, but is there any way to overcome this?

    thank you,
    Shreeram.

    DB:2.95:Re: How To Update A Record Without Using 'Where' Clause In 'Update' In Java c8

    I guess your teacher wants you to learn about
    updateable ResultSet's - which is fair enough
    (Although I never use them myself - does anyone?I never have.

  • RELEVANCY SCORE 2.94

    DB:2.94:How To Get The Enity Object I Rowdatabound Of A Entitydatasource Bound Gridview d8


    Hi,It's exciting with the new EntityDataSource!But for some reason I can't get to the entity object in the RowDataBound event, when the gridview is bound to the EntityDataSource. This was easy with the ObjectDataSouce, with a simple cast. Now however, the e.row.DataItem is of the type: EntityDataSourceWrapper which isn't a public member.Is there another way?

    DB:2.94:How To Get The Enity Object I Rowdatabound Of A Entitydatasource Bound Gridview d8

    Where is a Way to use somethink like that

    object

    result = e.Row.DataItem.GetType().GetProperty(columnName).GetValue(e.Row.DataItem,
    null);

    IT Works in LinqtoSQL but not in LinqtoEF!!

    matteo ghetti

  • RELEVANCY SCORE 2.92

    DB:2.92:Entitydatasource Where Clause dm


    Hi, I not sure about the syntax to a LIKE type statement in the Where clause:
    asp:EntityDataSource ID=LocateEntityDataSource runat=server ConnectionString=name=RecruitmentAndRetentionEntities DefaultContainerName=RecruitmentAndRetentionEntities EntitySetName=Applicant OrderBy=it.[LastName] Select=it.[FirstName], it.[LastName], it.[DateOfBirth], it.[ApplicantID], it.[NPI] AutoGenerateWhereClause=false Where=it.[LastName] like '@LastName%'
    WhereParameters asp:ControlParameter Name=LastName ControlID=locateLastNameTextBox ConvertEmptyStringToNull=true Type=String //WhereParameters/asp:EntityDataSource
    Any help would be appreciated.
    Thanks
    Stephane

    DB:2.92:Entitydatasource Where Clause dm

    Nevermind, I found the syntax:
    Where=it.[LastName] like @LastName + '%'
     
    Thanks

  • RELEVANCY SCORE 2.92

    DB:2.92:Re: Repository Variable &Amp; Org Based Security 3k


    You using 'Dynamic where clause' in your Logical Model or VPD on the database? 'Dynamic where clause' is usually executed on a row based level and VPD as a extra where clause to the SQL statement and therefor faster handling complex security rules or big amounts of data.

    M.

    DB:2.92:Re: Repository Variable &Amp; Org Based Security 3k

    mkooloos,as it is related to security we write the query for it in initilization block and it depends on the user who runs and those organizations will be tagged eg:- where org_id in ('x','y','z'.....)

    Any thoughts on these issues.

    UPDATED POST

    I know that multi-select and presentation variable cant be used in combination to retrieve more than 1 value.

    Is it same with repository variable and multi-select in the dashboard prompt that cant retrieve multiple values?Any expert can confirm on this ??

    kk.

    Edited by: Kranthi.K on May 16, 2011 10:05 PM

  • RELEVANCY SCORE 2.92

    DB:2.92:What Does For The Entitydatasource, Either Type Or Dbtype (But Not Both) Must Be Specified For Each Parameter Mean? fx


    Hello,
    I am trying to follow through the EntityDataSource Quickstart Example shown on
    http://msdn.microsoft.com/en-us/library/cc668221.aspx , but am getting an error when I run the project. The text of the error is:

    Server Error in '/' Application.

    For the EntityDataSource, either Type or DbType (but not both) must be specified for each Parameter.
    Description:
    An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.InvalidOperationException: For the EntityDataSource, either Type or DbType (but not both) must be specified for each Parameter.

    Source Error:

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

    Stack Trace:

    [InvalidOperationException: For the EntityDataSource, either Type or DbType (but not both) must be specified for each Parameter.]
    System.Web.UI.WebControls.WebControlParameterProxy.VerifyUniqueType(Parameter parameter) 128050
    System.Web.UI.WebControls.EntityDataSource.CreateObjectParametersFromParameterCollection(ParameterCollection paramColl) 264
    System.Web.UI.WebControls.EntityDataSourceView.GenerateWhereClause(String whereClause, ObjectParameter[] whereParameters) 142
    System.Web.UI.WebControls.EntityDataSourceView.ExecuteSelectTyped(DataSourceSelectArguments arguments, Creator qbConstructor) 201
    System.Web.UI.WebControls.EntityDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) 745
    System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) 28
    System.Web.UI.WebControls.DataBoundControl.PerformSelect() 274
    System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() 105
    System.Web.UI.WebControls.CompositeDataBoundControl.CreateChildControls() 183
    System.Web.UI.Control.EnsureChildControls() 182
    System.Web.UI.Control.PreRenderRecursiveInternal() 60
    System.Web.UI.Control.PreRenderRecursiveInternal() 222
    System.Web.UI.Control.PreRenderRecursiveInternal() 222
    System.Web.UI.Control.PreRenderRecursiveInternal() 222
    System.Web.UI.Control.PreRenderRecursiveInternal() 222
    System.Web.UI.Control.PreRenderRecursiveInternal() 222
    System.Web.UI.Control.PreRenderRecursiveInternal() 222
    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) 4185

    Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1

    and seems to be related to the GridView control. If I remove this, the page runs, but obviously very little happens. As soon as I add the GridView and wire it up, I get the error.
    I can't find anything about this error, nor do I understand it as I can't see either a Type or DbType property on anything.
    Anyone any ideas?
    Thanks

  • RELEVANCY SCORE 2.91

    DB:2.91:Re: Improve The Performance In Stored Procedure Using Sql Server 2008 - Esp In Where Clause In Big Table 71


    O_oHoly wall of text Batman!

    DB:2.91:Re: Improve The Performance In Stored Procedure Using Sql Server 2008 - Esp In Where Clause In Big Table 71

    Hi,I am looking for inputs in tuning stored procedure using sql server 2008. l am new to performance tuning in sql,plsql and oracle. currently facing issue in stored procedure - need to increase the performance by code optmization/filtering the records using where clause in larger table., the requirement is Stored procedure generate Audit Report which is accessed by approx. 10 Admin Users typically 2-3 times a day by each Admin users.It has got CTE ( common table expression ) which is referred 2 time within SP. This CTE is very big and fetches records from several tables without where clause. This causes several records to be fetched from DB and then needed processing. This stored procedure is running in pre prod server which has 6gb of memory and built on virtual server and the same proc ran good in prod server which has 64gb of ram with physical server (40sec). and the execution time in pre prod is 1min 9seconds which needs to be reduced upto 10secs or so will be the solution. and also the exec time differs from time to time. sometimes it is 50sec and sometimes 1min 9seconds..Pl provide what is the best option/practise to use where clause to filter the records and tool to be used to tune the procedure like execution plan, sql profiler?? I am using toad for sqlserver 5.7. Here I see execution plan tab available while running the SP. but when i run it throws an error. Pl help and provide inputs.Thanks,Viji

  • RELEVANCY SCORE 2.90

    DB:2.90:Making Parameters Optional In Entitydatasource Where Clause fx


    Is  this at all possible? I have  multiple parameters that the user may search on and I would like some of them to be optional. I would like to do as much declaratively as possible.Thanks.

    DB:2.90:Making Parameters Optional In Entitydatasource Where Clause fx

    Where=it.Customer.CustomerID=@CustomerID
    OR @CustomerID IS NULL cause an error, use
    Where=it.Customer.CustomerID=@CustomerID
    OR @CustomerID == NULL instead.

  • RELEVANCY SCORE 2.90

    DB:2.90:Using Listview With Entitydatasource In Asp.Net 7z



    I'm looking for a tutorial/article or any material that helps me to understand how ListView control in asp.net works with EntityDataSource. I'm using Entity Framework 4.1 in my project

    Thanks in advance.

    /Rizwan

    DB:2.90:Using Listview With Entitydatasource In Asp.Net 7z

    Hi Rizwan,
    Here aresome usefulmaterial from
    asp.net web site about using ListView.
    Since this is a ListView control question in ASP.NET, you can try
    ASP.NET forum to get more response.
    Thanks for your understanding and support.
    Best regards,Chester Hong
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

  • RELEVANCY SCORE 2.90

    DB:2.90:Does Vs Possible Error Checking In Design Time When The Database Scheme Change? j7


    One advantage of using L2S or EF are the strong-type of Data classes generate from SQL Server. When the database table schema is changed, visual studio can be make a compliation warning, and it is easy for trace what should i correct.
    But using EntityDataSource Select Command Text Property, Where Property Entity SQL , it doesn't.

    However, it really the only way to join table in EF4 right now.
    But i would to know is it possible via some configuration?
    My Blog : http://www.netatlantis.com

  • RELEVANCY SCORE 2.90

    DB:2.90:Dynamic Where Clause pf


    Need your help.
    I have to pass a where clause text to a procedure as an in parameter. This needs to be dynamically substituted as a where clause in a SQL statement .
    The where clause is dynamically formed in another application using different input combination and this logic is not available to be used in the procedure.
    Thanks
    Pradeep

    DB:2.90:Dynamic Where Clause pf

    but allowing an arbitrary string as a dynamic WHERE clause is notoriously prone to SQL Injection attacks. Well, of course, the SQL injection is only a risk if the application exposes the ability to write a WHERE clause directly; it maybe assembled behind the scenes by a program. But William is right that it is better not to run the risk.

    Try something like this instead:
    SQL CREATE OR REPLACE FUNCTION dyn1
    2 (p_name IN VARCHAR2 := NULL
    3 , p_deptno IN NUMBER := NULL
    4 , p_mgr IN VARCHAR2 := NULL
    5 , p_sal IN NUMBER := NULL)
    6 RETURN sys_refcursor
    7 IS
    8 return_value sys_refcursor;
    9 stmt varchar2(32767);
    10 BEGIN
    11 stmt := 'select * from emp where 1=1';
    12 IF p_name IS NOT NULL
    13 THEN
    14 stmt := stmt||' and ename = '''||upper(p_name)||'''';
    15 END IF;
    16 IF p_deptno IS NOT NULL
    17 THEN
    18 stmt := stmt||' and deptno = '||to_char(p_deptno);
    19 END IF;
    20 IF p_mgr IS NOT NULL
    21 THEN
    22 stmt := stmt||' and mgr = '''||upper(p_mgr)||'''';
    23 END IF;
    24 IF p_sal IS NOT NULL
    25 THEN
    26 stmt := stmt||' and sal = '||to_char(p_sal);
    27 END IF;
    28 OPEN return_value FOR stmt;
    29 RETURN return_value;
    30 END;
    31 /

    Function created.

    SQL VAR rc REFCURSOR
    SQL BEGIN
    2 :rc := dyn1 (p_deptno = 10);
    3 END;
    4 /

    PL/SQL procedure successfully completed.

    SQL PRINT rc

    EMPNO ENAME JOB MGR HIREDATE SAL COMM
    ---------- ---------- --------- ---------- --------- ---------- ----------
    DEPTNO
    ----------
    7782 CLARK MANAGER 7839 09-JUN-81 2450
    10

    7839 KING PRESIDENT 17-NOV-81 5000
    10

    7934 MILLER CLERK 7782 23-JAN-82 1300
    10

    SQL BEGIN
    2 :rc := dyn1 (p_deptno = 10, p_sal = 2000);
    3 END;
    4 /

    PL/SQL procedure successfully completed.

    SQL PRINT rc

    EMPNO ENAME JOB MGR HIREDATE SAL COMM
    ---------- ---------- --------- ---------- --------- ---------- ----------
    DEPTNO
    ----------
    7782 CLARK MANAGER 7839 09-JUN-81 2450
    10

    7839 KING PRESIDENT 17-NOV-81 5000
    10

    SQL Let's be careful out there.

    Cheers, APC

  • RELEVANCY SCORE 2.89

    DB:2.89:Problems With Entity Sql Syntax And Select Distinct aj


    I had an EntityDataSource configured with an EntitySetName and Include to include several related entities. In that configuration, the EntityDataSource OrderBy setting and all of my ListView bindings includes paths relative to the main EntitySetName. That
    was working except I was getting duplicate rows and realized I needed to select distinct values.
    So I reconfigured my EntityDataSource to specify Select =

    DISTINCT it.CM_PART.COMPANY.NAME, it.CM_PART.MFG_PART_NUM, it.SP_PART.MFG_PART_DESC, it.SP_PART.COMPANY.NAME, it.SP_PART.SUPPLIER_PART_NUM

    And I removed the EntityDataSource Include setting (because I got an error if I left it in place along with the Select setting). With that change, I needed to modify the OrderBy setting and all of my ListView bindings to eliminate the relative paths. I assume
    this because a temporary type is being generated on the fly and the last part of the path is a direct property of that temporary type. That's all fine now and is working in my UI.
    But I have an Export function that queries the database and generates a .csv file of the data displayed. It gets its Where and OrderBy information from the page, so the Where and Order information coming in do not have the relative path. I have tried different
    variations of modifying the Entity Sql in that Export function but haven't been able to produce Entity Sql that works with the Where and OrderBy clauses that lack the relative paths.
    This is the Entity Sql basically unchanged except with the addition of the DISTINCT.
    SELECT DISTINCT it.CM_PART.COMPANY.NAME, it.CM_PART.MFG_PART_NUM, it.SP_PART.MFG_PART_DESC, it.SP_PART.COMPANY.NAME, it.SP_PART.SUPPLIER_PART_NUM

    FROM (SELECT VALUE it FROM Entities.CM_SP_PART_INST AS it ) AS it
    ORDER BY it.MFG_PART_NUM
    The Order By clause, without the relative path, fails because MFG_PART_NUM is not a property of CM_SP_PART_INST. If I could see the Entity Sql that is behind my EntityDataSource, that would give me the syntax I need. But when, in Page_PreRenderComplete I
    examine the EntityDataSource CommandText, it is null. (I thought I read somewhere that you could examine this and see the generated Entity Sql.)
    Can anyone suggest how I can determine the Entity Sql syntax that results from my current configuration of the EntityDataSource? Or does anyone know what form the Entity Sql takes when a Select clause is used that results in all of the navigated properties
    being properties of some flattened, temporary type?
    Thanks,
    Zoe

    DB:2.89:Problems With Entity Sql Syntax And Select Distinct aj

    What I really needed was a way to determine the exact Entity Sql behind my configured EntityDataSource so that I could construct that same Entity Sql in codebehind to be used in a slightly different context. The two queries had to be the same or at least
    similar enought that the could share the exact same OrderBy and Where clauses, as I pass those back and forth between the front end and the code behind.
    I had thought I had read that you could query an EntityDataSource's CommandText property, but when I did it was always null. I don't know for sure, but I suspect that it might be populated if you can catch the EntityDataSource in codebehind at a point where
    it has executed the query, which it won't do until you actually start using the data. With the RAD approach, so much of the action is behind the scenes making it harder to examine in debug. I'm sure it can be done, but I found an easier approach.
    I read (in Julie Lerman's Programming Entity Framework) that the EntityDataSource properties are, behind the scenes, used to configure an ObjectQuery. So I temporarily added some code in my OnLoad event to create an ObjectQuery and configure it with the
    exact same properties as my EntityDataSource.

    var parts = context.CM_SP_PART_INST
    .Select(DISTINCT it.CM_PART.COMPANY.NAME as CM_COMPANY_NAME, it.CM_PART.MFG_PART_NUM, it.SP_PART.MFG_PART_DESC, it.SP_PART.COMPANY.NAME AS SP_COMPANY_NAME, it.SP_PART.SUPPLIER_PART_NUM)
    .OrderBy(it.MFG_PART_NUM);

  • RELEVANCY SCORE 2.89

    DB:2.89:Entity Data Source - Select Custom Entity Fields 1p


    Hi, I need to fetch just a few fields (not all of them) defined in the underlying entity data model using the EntityDataSource control. In the same time, EnableDelete, EnableInsert and EnableUpdate options should be enabled. When I try to implement this behavior, i get the following error:Select cannot be set if EnableDelete, EnableInsert, or EnableUpdate is enabled.What am I missing here? Is there a way I can use single EntityDataSource control for CRUD operations on individual entity fields?Regards,John

    DB:2.89:Entity Data Source - Select Custom Entity Fields 1p

    The Entity Framework does not perform CUD operations at the EntityClient (EntitySql) layer, but rather at the ObjectLayer, therefore to do CUD operations, you need a full EntityObject instead of a projection of some fields.  However, you can choose to display only a portion of the fields of your Entity when you bind your EntityDataSource to your grid, so you can get any display behavior that you would like.
     
    Thanks,jeff

  • RELEVANCY SCORE 2.88

    DB:2.88:How Can I Enter Multiple Values In Where Clause Using In Function At Runtim 1k


    Hi friends,

    I want to use where clause with IN function such as .

    Select Empno,Ename from EMP
    Where EMPNO IN (10, 22, 24)

    How can I enter these values in where clause using IN function at report run time from parameter form.

    please send me solution of this problem.

    best regards,

    Shahzad

    DB:2.88:How Can I Enter Multiple Values In Where Clause Using In Function At Runtim 1k

    Hi,

    Use a parameter variable P_Input for getting the values from user like E1,E2,E3...
    Now use this parameter as a lexical parameter in the query simply by refering the parameter with an ''

    i.e.,
    Select Empno,Ename from EMP
    Where EMPNO IN (P_Input)

    Note: You should provide a default value for the parameter variable. otherwise the query will not be parsed. this you can specify in the 'value if null' property

    i hope this might help you

    regards...

  • RELEVANCY SCORE 2.88

    DB:2.88:Lexical sx


    Hi,

    Using where clause in the lexical parameter.

    Thanks Regards
    vijayanand.

    DB:2.88:Lexical sx

    Hi,

    Using where clause in the lexical parameter.

    Thanks Regards
    vijayanand.

  • RELEVANCY SCORE 2.88

    DB:2.88:Multiple Relationship Binding With Entitydatasource dc


    I have an ADO .Net Entity Data Model for my database. In this Model I have three related tables: Users Table containing UserId and other details. Run Table that contains RunId, ApproverId and other details RunToUser that contains UserId and RunId columns
    The relationships are as follows: Users.UserId is a one to one relationship to Run.ApproverId User.UserId is many to many with RunToUser.UserId Run.RunId is many to many with RunToUser.RunId
    In the Entity Model this is expressed as two tables with 2 separate relationships. the one-to-one relationship and the many-to-many relationship between Users and Run.
    I have a ASP.net Formview where I want to edit the data in Run as well as the related data in Users.
    Databinding is working in most cases. However when I bind to the Users table as an entitydatasource it always is using the one-to-one relationship association.
    How can I force the entitydatasource to use a specific relationship association so that I can bind the data from the one-to-one mapping to a label and the many-to-many to a dataview?
    I tried the EXISTS in the where clause whichs limits the records but it still insists on always using the one-to-one and only displays the single user in all databound controls. Here is the entitydatasource for the users:   asp:EntityDataSource ID=edsUsers_DET runat=server         ConnectionString=name=MyEntities DefaultContainerName=MyEntities         EntitySetName=Users         Where=EXISTS(SELECT VALUE p FROM it.Run AS p WHERE p.RunID = @RunID)         WhereParameters           asp:ControlParameter ControlID=fvRun  Name=RunID Type=Int32 /        /WhereParameters            /asp:EntityDataSourceI assume I will need two entity data sources one for the label and a second for the gridview but until I know determine how to specifiy an association I don't know how to proceed further. Thx, -J

    DB:2.88:Multiple Relationship Binding With Entitydatasource dc

    I have an ADO .Net Entity Data Model for my database. In this Model I have three related tables: Users Table containing UserId and other details. Run Table that contains RunId, ApproverId and other details RunToUser that contains UserId and RunId columns
    The relationships are as follows: Users.UserId is a one to one relationship to Run.ApproverId User.UserId is many to many with RunToUser.UserId Run.RunId is many to many with RunToUser.RunId
    In the Entity Model this is expressed as two tables with 2 separate relationships. the one-to-one relationship and the many-to-many relationship between Users and Run.
    I have a ASP.net Formview where I want to edit the data in Run as well as the related data in Users.
    Databinding is working in most cases. However when I bind to the Users table as an entitydatasource it always is using the one-to-one relationship association.
    How can I force the entitydatasource to use a specific relationship association so that I can bind the data from the one-to-one mapping to a label and the many-to-many to a dataview?
    I tried the EXISTS in the where clause whichs limits the records but it still insists on always using the one-to-one and only displays the single user in all databound controls. Here is the entitydatasource for the users:   asp:EntityDataSource ID=edsUsers_DET runat=server         ConnectionString=name=MyEntities DefaultContainerName=MyEntities         EntitySetName=Users         Where=EXISTS(SELECT VALUE p FROM it.Run AS p WHERE p.RunID = @RunID)         WhereParameters           asp:ControlParameter ControlID=fvRun  Name=RunID Type=Int32 /        /WhereParameters            /asp:EntityDataSourceI assume I will need two entity data sources one for the label and a second for the gridview but until I know determine how to specifiy an association I don't know how to proceed further. Thx, -J

  • RELEVANCY SCORE 2.88

    DB:2.88:Dynamic Where Clause In A Procedure m1


    --
    Hi everyone!

    I would like to seek an assistance regarding a where clause that
    can be set dynamically during runtime in a procedure. Is it
    possible that a where clause of a procedure can be passed using
    a parameter?

    I would appreciate all responses.

    Thank you.

    Weng
    null

    DB:2.88:Dynamic Where Clause In A Procedure m1

    --
    Absolutely !

    You can do it using dynamic SQL.

    Cheer !

    TT

    Weng (guest) wrote:
    : Hi everyone!
    : I would like to seek an assistance regarding a where clause
    that
    : can be set dynamically during runtime in a procedure. Is it
    : possible that a where clause of a procedure can be passed using
    : a parameter?
    : I would appreciate all responses.
    : Thank you.
    : Weng
    null

  • RELEVANCY SCORE 2.88

    DB:2.88:Modifying Select Clause x9


    I want to add some predicate in select clause. Alike we can add some predicate in where close using FGAC. Is it possible in oracle ? I want to retrieve some more columns in result. It doesn't matter if those columns are there in select clause or not those should come when i query particular table.

    DB:2.88:Modifying Select Clause x9

    You could use a view to show different columns depending on the user (or on some user context).

  • RELEVANCY SCORE 2.88

    DB:2.88:Using Regular Expressions In Dql 38


    Does anyone know how to use regular expressions in a DQL where clause?

    DB:2.88:Using Regular Expressions In Dql 38

    You cant do this through DQL; I think you can do this through SQL depending on your database. The alternative is to write a small program and update the attribute for each object.

  • RELEVANCY SCORE 2.87

    DB:2.87:Optimisticconcurrencyexception Using Entitydatasource 1m


    Hello,
     
    I´m trying to implement a Master-Detail-Form using a GridView and a DetailsView. The GridView uses an EntityDataSource which returns all rows of a table. The DetailsView uses another EntityDataSource, with a SELECT-Parameter and a corresponding WHERE clause for the primary key of the same table. The Select Parameter is set by the GridViews SelectedIndexChange event, so that the details of the record is displayed in the DetailsView when I select a record in the GridView. So far, so good.
     
    The GridView has only Selecting enabled. Editing and Deleting is done in the DetailsView. And here is a strange behavior: If I select a record in the GridView (then it is displayed in the DetailsView, of course) and I try to delete the record using the Delete button in the DetailsView often get an OptimisticConcurrencyException.
    Error Message: Store update, insert, or delete statement affected an unexpected number of rows (0). Entities may have been modified or deleted since entities were loaded. Refresh ObjectStateManager entries.
     
    This error doesn't occur always, but very often. The record is always deleted, even when the Exception occurs. I have two different pages, both displaying Master-Detail-Records and both having the same problem.
     
    I think, this is cause because I have two EntityDataSource in my page, that use data from the same table. If I remove on of the EntityDataSource everything works fine.
     
    Any idea?
    Regards,Ronny

    DB:2.87:Optimisticconcurrencyexception Using Entitydatasource 1m

    If you add the System.Data.Entity namespace to your project, you also have the SaveChanges() and other methods available.
     

  • RELEVANCY SCORE 2.87

    DB:2.87:Case-Insensitive Where Clause In Dql. jf


    Is there a way to write a case-insensitive where clause in dql?

    DB:2.87:Case-Insensitive Where Clause In Dql. jf

    Can do the same thing using lower, instead of upper, if you're lazy and don't like hitting the shift when entering your value. Just say no to uppercase letters!

  • RELEVANCY SCORE 2.87

    DB:2.87:Variables In Where Clause Are Not Working - Help ! 3s



    How
    do you use Variables in the WHERE clause?

    DB:2.87:Variables In Where Clause Are Not Working - Help ! 3s

    Got it.
    Sometimes just asking the question helps the answer pop out :)
    txtSQL = SELECT [tableA].idProduct FROM [tableA] WHERE ((([tableA].idOrder)=OrderX) AND (([tableA].SeqNum)=SeqNumX));
    Should be
    txtSQL = SELECT [tableA].idProduct
    FROM [tableA] WHERE ((([tableA].idOrder)= OrderX ) AND (([tableA].SeqNum)= SeqNumX ));
    The variables can't be int he quotes... duh...
    Any how, maybe this will help some other poor soul... like me :)

  • RELEVANCY SCORE 2.87

    DB:2.87:Using Decode In Where Clause sa


    Hi all

    We can use decode function in the Select columns as well as Group by Columns as well as Having Clause

    Can we use decode function in the where clause also. If yes can u give small sample

    Suresh Bansal

    DB:2.87:Using Decode In Where Clause sa

    Yes you can: see http://psoug.org/reference/decode_case.html and search for "DECODE in the WHERE clause".

    Edited by: P. Forstmann on 1 juin 2011 09:12

    Edited by: P. Forstmann on 1 juin 2011 09:12

  • RELEVANCY SCORE 2.86

    DB:2.86:Entitydatasource, Commandtext And Sorting 78


    It seems that EntityDataSource removes the ORDER BY clause from an Entity SQL expression passed by the CommandText propery. Using the OrderBy property doesn't work when the data field is not part of the projection.In my case Entity SQL statement looks like:SELECT gradeFROM Grades AS gradeRIGHT OUTER JOIN Students AS student ON student.ID=grade.Student.IDORDER BY student.IndexThis code works well when used in an ObjectQuery but the order is lost when used as the CommandText of an EntityDataSource. OrderBy=it.Student.Index doesn't work since some grades might be NULL.Is there a work around?

    DB:2.86:Entitydatasource, Commandtext And Sorting 78

    Hello Anand,many thanks for your reply. The problem is the projection of the classe. UsingSELECT grade.LetterGrade FROM Grades AS grade RIGHT OUTER JOIN Students AS student ON student.ID=grade.Students.ID ORDER BY student.Indexyields A, C, B, D, ESELECT VALUE grade FROM Grades AS grade RIGHT OUTER JOIN Students AS student ON student.ID=grade.Students.ID ORDER BY student.Indexyields E, A, B, C, DMy issue is that there are studends with no grades. Deleting the grade of student 2 the following code
    asp:EntityDataSource   ID=EntityDataSource   ConnectionString=name=MyEntities   DefaultContainerName=MyEntities   CommandText=      SELECT VALUE grade      FROM Grades AS grade      RIGHT OUTER JOIN Students AS student ON student.ID=grade.Students.ID      ORDER BY student.Index   RunAt=server/asp:EntityDataSource
    asp:GridView   ID=GridView   AutoGenerateColumns=False   DataSourceID=EntityDataSource   RunAt=server   Columns      asp:TemplateField HeaderText=LetterGrade         ItemTemplate            asp:Label               ID=Label               Text='%# Container.DataItem == null ? No Grade : Eval(LetterGrade) %'               RunAt=server            /asp:Label         /ItemTemplate      /asp:TemplateField   /Columns/asp:GridViewreturnsNo Grade, E, A, C, DAs grades can be null I am not able to bind to columns as you proposed.Furthermore it must be an issue of EntityDataSource because eSqlBlast returnsA, C, NULL, D, Eas expected.Wolfgang

  • RELEVANCY SCORE 2.86

    DB:2.86:Database View Where Clause Condition j1



    Hi All.In database view How can I use the SQL syntax like IN LIKE NOT LIKE in where clause?

    DB:2.86:Database View Where Clause Condition j1


    Hi Saranya,According the wiki,The Where clause supports these JavaScript conditional operators: =, !=, , =, , =, , || So if the requirement is very urgent, I guess you should try to export the data to an internal database (using ODBC driver for example) and you should ask for an enhancement (if it still doesn't exist).https://wiki.servicenow.com/index.php?title=Database_Views#Task_2:_Add_Tables_to_the_Database_View Best regards,

  • RELEVANCY SCORE 2.86

    DB:2.86:Update Reference With Entitydatasource 39


    Hi,I use an EntityDataSource to update a table in my database. It works fine for values but I can't update references. Right now I use the AdventureWorks database where the Product table has a column called ProductModelID which is a FK to the ProductModel table, and I want to change the product model for an entity.I use this code to do the updating:

    Code Snippet

    DB:2.86:Update Reference With Entitydatasource 39

    Hi,I use an EntityDataSource to update a table in my database. It works fine for values but I can't update references. Right now I use the AdventureWorks database where the Product table has a column called ProductModelID which is a FK to the ProductModel table, and I want to change the product model for an entity.I use this code to do the updating:

    Code Snippet

  • RELEVANCY SCORE 2.86

    DB:2.86:Index Usage From Sql Query In Oracle Forms p8


    Hello:

    Using LIKE/OR in where clause (of an indexed column) will force the the query to NOT use INDEX? We have these where clause in Oracle Forms Records Group.

    Below are two examples...
    1. If we have a where clause with LIKE would that NOT use the index?
    Example: ColumnName like :block.Column||%

    2. How about having an OR clause?
    Example: and (ColumnName = :block.column or :block.column is null)

    Thanks

    DB:2.86:Index Usage From Sql Query In Oracle Forms p8

    Even Like should use index. But depends on how many characters you're giving before % sign. if it has only one or two chars e.g. ab%, then optimizer may scan entire table instead of checking this value...

  • RELEVANCY SCORE 2.86

    DB:2.86:Entitydatasource, Where And 2 Parameters ka


    Hello everyone,
     
    I am puzzled by a problem in the entitydatasource control.
    Consider the following situation: I have defined a search form on a grid. The search form contains a textbox and a dropdownlist. The textbox should contain the value to be searched, the dropdownlist should contain the attribute you make the search on.
     
    Whereas using an objectdatasource control, this problem has an easy solution (the grid is populated from a parametric query defined in a function of the type GetRecordsFilteredByFilteredOn), a solution using entitydatasource doesn't seem (to me) as much accesible.
     
    The entitydatasource is a declarative component, the properties and methods being exposed visually. I have tried to add the where atribute visually, but the customisation interface didn't help me too much.
    Then I have setted up the properties by code, this ended in a sql syntax error.
     
    My question is: how can I set up on the entitydatasource (by code or declaratively) a where condition of the type where it.@parameter1 = @parameter2?
     
    Has anyone experienced the same problem?
     
    Thank you,
    C.
     

    DB:2.86:Entitydatasource, Where And 2 Parameters ka

    Sorry C,
     
    I just looked more at what you are trying to do. I missed the fact that you are trying to use a parameter to select which property the filter is on. This is equivilent to the following eSQL query:
     

    Select P from AdventureWorks.Product as PWHERE P.@pPropertyName == @pFilterValue
     
    This isn't valid eSQL. When you set the value of the pPropertyName parameter to the property by which you are trying to filter, for example 'Name', the query is equivilent to:

    Select P.Name from AdventureWorks.Product as PWHERE P.'Name' == @pFilterValue
    Which is invalid.
     
    To do what you want, you could build the eSQL dynamically, like:
     

    string eSQL = String.Format(Select P from AdventureWorks.Product as P WHERE P.{0} == @pFilterValue, propertyList.SelectedItem);
     
    and then create a parameter whose value is the value selected in your text box.
     
    This is more work than it looks at first though, because you would need to create the pFilterValue parameter with the correct DbType. For example, if they select Name in the drop down list, your parameter should get created as:

    EntityParameter param = new EntityParameter(pFilterValue, System.Data.DbType.String);
    param.Value = filterValueTextBox.Text;
     
    But if they select ProductID from the list, you need to create a parameter whose type is int:

    EntityParameter param = new EntityParameter(pFilterValue, System.Data.DbType.Int32);
    param.Value = filterValueTextBox.Text;
     
    This isn't impossible - you can get the type of the property they've selected in the drop down, and write a helper function with a case switch that picks the correct DbType to use for the parameter.

  • RELEVANCY SCORE 2.86

    DB:2.86:Fragmentation Vs Where Clause Obiee 10g Rpd jm


    fragmentation vs where clause

    In obiee we can do fragmentation of table.
    for example if i have data from a to z. iam fragmenting data
    from a to m in on LTS and M to Z in another.
    this we can do with the where clause like in one LTS
    data from A to Z by using where clause .. what is difference.
    please help me.. any performance issues.
    thank you.

    DB:2.86:Fragmentation Vs Where Clause Obiee 10g Rpd jm

    In an enterprise world, data is often partitioned into multpile physical sources for a single logical table. This helps in organised data set with faster query results fetching. In such cases, BI server should know where to go for what type of data and under what conditions. Hence the fragmentation is defined to to handle efficient access by navigation to the appropriate physical source as per the request.
    e.g. there may be an aggregate table and a detailed table being accessed for different requests appropriately.

    This helps in performance improvement.

    Adding a where clause will still refer to the same table source hence no benefit of this feature is exhibited in this scenario.

  • RELEVANCY SCORE 2.86

    DB:2.86:Stored Procedure E Entitydatasource jj


    Ciao a tutti, come da titolo, è possibile utilizzare un entitydatasource sfruttando i risultati provenienti da una stored sql server ?

    ho già usato una stored in entityframework, e riesco a ciclare i risultati provenienti da essa via codice code behind, ma utilizzarli nel entitydatasource è possibile ?
    c'è qualche esempio on line che mostra questo ?

    ciao grazie

    DB:2.86:Stored Procedure E Entitydatasource jj

    si ho guardato function import, serve per connettersi alla stored. COn quello poi riesco a ciclare i risultati da code behind.
    L'entity data source però chiede subito l'entity che non la trovo.
    Si può anche creare una classe di destinazione facendosi aiutare da visual studio che guarda i risultati della stored e costruisce la classe di conseguenza.
    Però anche li non mi riesce di farlo funzionare, mi dice che la stored (o tabella) non mi ricordo devo guardare in ufficio, non è mappata.

  • RELEVANCY SCORE 2.86

    DB:2.86:Update Statement With From Clause With Multi Joins 11


    how the sql Update statement work , while using FROM Clause with multiple joins[also in this situation how the WHERE clause work] ?,

    also is it necessary that the table which is getting updated has to be in FROM clause ?

    kindly explain

    DB:2.86:Update Statement With From Clause With Multi Joins 11

    UPDATE with join is not in the ANSI SQL standard and it also has issues if a row in the target table is matched by several rows in the source table(s). I suggest you use the ANSI SQL compatible and much more powerful MERGE command instead; which was
    introduced in SQL Server 2008.Tibor Karaszi, SQL Server MVP |
    web | blog

  • RELEVANCY SCORE 2.85

    DB:2.85:Can We Give A Select Statement In Where Clause Of A Select Statement da



    can i give select statement in a select statement where clause

    DB:2.85:Can We Give A Select Statement In Where Clause Of A Select Statement da


    Hi Balaji,

    well, you can do first, the select of the "where" clause.

    Then, you put your results, in a "ranges" table.

    And finally, you do the main select, with this "ranges" in the where clause.

    Hope this help you!

  • RELEVANCY SCORE 2.85

    DB:2.85:# Of Parameters Allowed For In Clause aa


    Maximum how many number of parameters IN clause can have.

    e.g. SELECT * FROM TAB1 WHERE COL1 IN ('A','B',........)

    I am using Oracle 9i

    DB:2.85:# Of Parameters Allowed For In Clause aa

    As Papin points out, the limit is 1000 literals.

    Of course, if you have more than a handful of values,
    I would strongly suggest that you use a
    subquery, which can return an unlimited number of
    rows, i.e.

    SELECT *
    FROM tab1
    HERE col1 IN (SELECT col1 FROM tab2)works regardless of the number of rows in tab2

    JustinThanks Papin and Justin for the clarification. I was aware of using inner query in place of using actual parameter values. But the legacy code is designed in very bad way. So wanted to know the limit.

    Thanks
    Vijay

  • RELEVANCY SCORE 2.85

    DB:2.85:Entity Type From Entitydatasource zk


    Hello!I would like to ask if the following is the best way (probably not) to retrieve the Type and then metadata Type for an entity configured in an EntityDataSource:1public Type EntityType 2{ 3    get 4    { 5        DataSourceControl dataSource = /* ... */; 6 7        if (dataSource is EntityDataSource) 8        { 9            EntityDataSource entityDataSource = dataSource as EntityDataSource; 10            ObjectContext objectContext = new ObjectContext(entityDataSource.ConnectionString); 11            EntityContainer entityContainer = objectContext.MetadataWorkspace.GetItemEntityContainer(entityDataSource.DefaultContainerName, DataSpace.CSpace); 12            EntitySet entitySet = (EntitySet)entityContainer.BaseEntitySets[entityDataSource.EntitySetName]; 13 14            foreach (Assembly assembly in AppDomain.CurrentDomain.GetAssemblies()) 15            { 16                Type type = assembly.GetType(entitySet.ElementType.FullName); 17 18                if (type != null) 19                    return type; 20            } 21 22            throw new InvalidOperationException(); 23        } 24 25        throw new NotSupportedException(); 26    } 27} 28 29public Type EntityMetadataType 30{ 31    get 32    { 33        object[] attributes = EntityType.GetCustomAttributes(typeof(MetadataTypeAttribute), true); 34 35        if (attributes.Length == 0) 36            return EntityType; 37 38        return (attributes[0] as MetadataTypeAttribute).MetadataClassType; 39    } 40}

    DB:2.85:Entity Type From Entitydatasource zk

    Ok, here is a better implementation, that doesn't rely on entity types having unique FullNames:1ObjectContext objectContext = new ObjectContext(entityDataSource.ConnectionString); 2 3if (HostingEnvironment.IsHosted) 4    foreach (Assembly assembly in BuildManager.GetReferencedAssemblies()) 5        objectContext.MetadataWorkspace.LoadFromAssembly(assembly); 6 7EntityContainer entityContainer = objectContext.MetadataWorkspace.GetItemEntityContainer(entityDataSource.DefaultContainerName, DataSpace.CSpace); 8EntitySet entitySet = (EntitySet)entityContainer.BaseEntitySets[entityDataSource.EntitySetName]; 9StructuralType objectSpaceType = objectContext.MetadataWorkspace.GetObjectSpaceType(entitySet.ElementType); 10 11ObjectItemCollection objectItemCollection = (ObjectItemCollection)objectContext.MetadataWorkspace.GetItemCollection(DataSpace.OSpace); 12return objectItemCollection.GetClrType(objectSpaceType); 

  • RELEVANCY SCORE 2.85

    DB:2.85:Entitydatasource With Sub-Query In Where px



    Hello!
    I have a question about the where from the EntityDataSource.
    In SQL Server 2012 i created a working query.
    I want to translate this to the EntityDataSource (see code beneath) but this does not work. Does someone know if its possible to have a sub-query in the where of the EntityDataSource?? and does someone know how i can make this work?

    asp:EntityDataSource ID=dsCurrent9999 runat=server EnableInsert=true EnableUpdate=true EnableDelete=true
    ConnectionString=name=CJIBIBBConnection
    DefaultContainerName=CJIBIBBConnection EntitySetName=CJIB_STATUS
    OrderBy=it.[STA_ID]
    Include=CJIB_BESCHIKKING, CJIB_SOORT_STATUS, CJIB_GEBRUIKER, CJIB_STATUS
    Where=(it.STA_ID =
    EXISTS(SELECT MAX(it.STA_ID) AS Expr1
    FROM CJIB_STATUS
    AS B
    WHERE (it.STA_BES_ID = B.STA_BES_ID)))
    AND (it.STA_SST_ID = 9999)
    /asp:EntityDataSource

    Greetings Dennis.

    DB:2.85:Entitydatasource With Sub-Query In Where px

    Hello,
    Does someone know if its possible to have a sub-query in the where of the EntityDataSource?
    The answer is yes.
    and does someone know how i can make this work?
    For filtering Data in EntityDataSource, please have a look at the link below:
    http://msdn.microsoft.com/en-us/library/cc488531(v=vs.100).aspx
    It shows a detail sample to use where in EntityDataSource.
    Regards.We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.

    Click
    HERE to participate the survey.

  • RELEVANCY SCORE 2.84

    DB:2.84:How Should I Put Where Clause For Two Dimensional Array Using Linq? 8m


       How should I put where clause for two dimensional array using linq?
     
    For one dimensional array we can write :
    cmbData.DataSource = arr
                cmbData.DataSource = From n In arr _
                Where (n 5) _
                      Select
     
    I want to query two dimensional array using where clause
    What should I write in where clause ?
     

    DB:2.84:How Should I Put Where Clause For Two Dimensional Array Using Linq? 8m

    Two forms for selectmany
     
    from n in arr
    from i in n
    where i 5
    select i
     
     
    arr.SelectMany(n = n).Where(i = i 5)
     

  • RELEVANCY SCORE 2.84

    DB:2.84:Index Usage From Sql Query In Oracle Forms mk


    Hello:

    Using LIKE/OR in where clause (of an indexed column) will force the the query to NOT use INDEX? We have these where clause in Oracle Forms Records Group.

    Below are two examples...
    1. If we have a where clause with LIKE would that NOT use the index?
    Example: ColumnName like :block.Column||%

    2. How about having an OR clause?
    Example: and (ColumnName = :block.column or :block.column is null)

    Thanks

  • RELEVANCY SCORE 2.84

    DB:2.84:Re: Changes In From Cluase And Where Clause 89


    Hi

    from clause also it will impact.

    or only where clause..
    THnks for your fast response

    DB:2.84:Re: Changes In From Cluase And Where Clause 89

    Hi,

    No, it won't matter . The compiler will raise an error because "SELECT" is mis-spelled in any case.
    Whenever you post code, make sure it works (unless, of course, that's the problem). Format the code so that the people who want to help you can read it and understand it easily. Type these 6 characters:

    \(small letters only, inside curly brackets) before and after each section of formatted text, to preserve spacing on this site.

    Using the cost-based optimizer (and you should always use the cost-based optimizer) there is no performance difference betweenselect empno
    ,deptno
    ,acentno -- No , after last column
    from emp
    ,dept
    ,acent
    where dept.deptno = acent.deptno
    and emp.empno = dept.empno
    ;
    andselect empno
    ,deptno
    ,acentno -- No , after last column
    from emp
    ,acent
    ,dept
    where dept.deptno = acent.deptno
    and emp.empno = dept.empno
    ;
    orselect empno
    ,deptno
    ,acentno -- No , after last column
    from emp
    ,dept
    ,acent
    where emp.empno = dept.empno
    and dept.deptno = acent.deptno
    ;

  • RELEVANCY SCORE 2.84

    DB:2.84:Entitydatasource - Many To Many Insert Without Using The Code Behind xz


    This is my problem... I have two entities (let's call them A and B) in my entity model with many to many relation between them. Further on, I have a DropDownList control bound to entity A using the EntityDataSource control and I have a FormView control bound to entity B using another EntityDataSource control. I'm trying to insert an entity of type B to the database with a relation to the selected entity in a list of type A using the FormView control without using any code behind, just markup. Is this possible? I mean, I know how would I do this in a code behind but have no idea how to do it in a markup. Any help would be appreciated.

    DB:2.84:Entitydatasource - Many To Many Insert Without Using The Code Behind xz

    Hello Jason,Many-to-many relationships are represented in the object model by collections on both ends. For instance, As have  collections of Bs and Bs have collections of As. EntityDataSource doesn't really expose a way of manipulating collections on entities directly (it does allow manipulating references through flattened reference keys) and therefore I cannot think of any way you could access them from markup. All that said, David Ebbo, from the Dynamic Data team has created a field template for Dynamic Data (which uses EntityDataSource) that automatically binds to many to many relationships. You can learn more about it (and see if it fits your needs) here: http://blogs.msdn.com/davidebb/archive/2008/10/25/a-many-to-many-field-template-for-dynamic-data.aspxThanks,Diego

    This posting is provided AS IS with no warranties, and confers no rights.

  • RELEVANCY SCORE 2.84

    DB:2.84:Database Monitering Problem mm


    How i find bind value(where clause in sql query) in sys dictionary,v$sql show me query but in where clause bind value contain ":1",i want to know what value passed in where clause,i m using Oracle 10g?

    Thanks

    DB:2.84:Database Monitering Problem mm

    From 10g you can use

    select
    sql_id,
    b.name BIND_NAME,
    b.value_string BIND_STRING
    from
    v$sql t
    join v$sql_bind_capture b
    using (sql_id)
    where
    b.value_string is not null
    and sql_id='1'
    /

    Note: 1 is the sql_id of your query.

    HTH
    Antonio NAVARRO

  • RELEVANCY SCORE 2.84

    DB:2.84:Where Clause Condition zj


    How many conditions can will be applied in where clause and what is the maximum length for where condition?

    DB:2.84:Where Clause Condition zj

    Besides AskTom at http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:41742083561301you should also consider : PLSQL limits :http://docs.oracle.com/cd/E11882_01/appdev.112/e25519/limits.htm#CIHDFFHIHemant K Chitale

  • RELEVANCY SCORE 2.83

    DB:2.83:Entitydatasource And Default Values - Error While Setting Property ***: This Property Cannot Be Set To A Null Value.. kc


    I'd like to find a nice way to handle all my default values in my new EF sporting system. My preference would be to define them only once in the database and have my ORM be smart enough to (at least usually) know what do to but this doesn't seem to be possible with the EF. I have a couple of fields with static strings for default values. I entered my defaults into the EF designer in the Default Value field which works fine when programmatically creating new entities in a class but when using an EntityDataSource to add a new record from of a grid control I get the error:
    Error while setting property '****': 'This property cannot be set to a null value.'.

    [EntityDataSourceValidationException: Error while setting property '****': 'This property cannot be set to a null value.'.]

    System.Web.UI.WebControls.EntityDataSourceUtil.SetAllPropertiesWithVerification(EntityDataSourceWrapper entityWrapper, Dictionary`2 changedProperties, Boolean overwrite) +59885

    System.Web.UI.WebControls.EntityDataSourceView.CreateEntityForInsert(EntityDataSourceWrapper entityWrapper, IDictionary values, ParameterCollection insertParameters) +93

    System.Web.UI.WebControls.EntityDataSourceView.ExecuteInsert(IDictionary values) +341

    System.Web.UI.DataSourceView.Insert(IDictionary values, DataSourceViewOperationCallback callback) +86
    Is there a way to configure my EntityDataSource to recognize the default values I have configured my entities to use? If I can't get EntityDataSource to work with the Default Value fields on my entities what would be the least painful way to handle default values while using an EntityDataSource? Many thanks for listening, bd

    DB:2.83:Entitydatasource And Default Values - Error While Setting Property ***: This Property Cannot Be Set To A Null Value.. kc

    This is because EntityDataSource does NOT turn to your edmx to
    connect to data. it connects directly to the database with the same
    connection string. To cause youre EntityDataSource to use the entity
    context you created, with all it's properties and overrides, add the
    following method to your EntityDataSource OnContextCreating event:

    void YourDataSource_ContextCreating(object sender, EntityDataSourceContextCreatingEventArgs e)
    {
    e.Context = new YourEntities();
    }

  • RELEVANCY SCORE 2.83

    DB:2.83:Select Statements 18



    hi,

    if we hav 10000 records in a list.suppose we want to retrieve 6 records .,without using where clause in select statement.

    DB:2.83:Select Statements 18


    hi madhu,

    but the interviewer asked he want some records that r randomly placed in a list...how?

  • RELEVANCY SCORE 2.83

    DB:2.83:Entitydatasource And Type Safe Where Clauses 8f


    Under ASP.Net I am using an EntityDataSource and binding various controls to it. I want to restrict the entities retrieved at runtime via some ID. In SQL this would be via a where clause something like:
     
    SELECT * from Customer WHERE CustomerID = 1;
     
    Now I know in ASP.Net I can achieve this using something resembling:
     
    Where=it.CustomerID == @customerID
    WhereParameter Name=customerID Value=1
     
    However, this is not type safe at all. Also, any spelling error in my columnm names will not be caught until run time.
     
    So the question is how do I set the WHERE properties of an EntityDataSource with compile time typechecking etc? I would love to use something like:
     
    CustomerDataSource.CustomerID.Filter = 1;
     
    Andrew
     

    DB:2.83:Entitydatasource And Type Safe Where Clauses 8f

    I have an app on 3.5 that works by addingWhere=CustomerID == @CustomerID / to theasp:EntityDataSource.
    Why isn't working with a 4 ? and how do i add a Where clause to theQueryExtender? there should be a propperty likeDynamicFilterExpression or else to use a where clause, i think. thanks for the help.
    @l3nyl3ny

  • RELEVANCY SCORE 2.83

    DB:2.83:Entitydatasource How To Catch Exceptions In Context.Savingchanges 1d


    I am using EntityFramework 4 and a ASP.Net 4 Web Application in Visual Studio 2010. I have a page with a EntityDataSource control and have EnableInsert=True. I am also using custom business validation logic by using a partial class for the data context
    with a handler for the Context.SavingChanges event where I call custom validation logic depending on the entity type. This validator is implemented in a partial class for each entity. In this example, I simply make sure the EndUserName is not longer
    than 50 characters. If I write my own code to do an insert it would look like this:

    Dim dc As New desqEntities()

    Dim endUser As New EndUser()

    endUser.EndUserName = endUserName

    dc.AddToEndUsers(endUser)

    Try

    dc.SaveChanges()

    Catch ex As Exception

    Me.ErrorMessage.Text = ex.Message

    End Try

    DB:2.83:Entitydatasource How To Catch Exceptions In Context.Savingchanges 1d

    Hi Carl: Here's how you can catch the exceptions.... First, create an exception event handler for your EntityDataSource:

    protected void ExceptionEventHandler(object sender, DynamicValidatorEventArgs e)
    {
    // Your code here
    }
    Then you need to register this with your EntityDataSource (let's call it MyEntityDataSource). Unfortunately, you can't do this in the markup, only in the code-behind:

    protected void Page_Load(object sender, EventArgs e)
    {
    // Set the entity data source exception event handler
    ((IDynamicDataSource)MyEntityDataSource).Exception = ExceptionEventHandler;

    }
    Note that you'll have to add a using declaration for System.Web.DynamicData. You've probably already figured this out, but this might be of some assistance to others.

  • RELEVANCY SCORE 2.83

    DB:2.83:Returning Clause zs


    hi..

    sql_stmt := 'UPDATE my_student SET zip = 11105 WHERE student_id = :1 '||
    'RETURNING zip INTO :2';
    EXECUTE IMMEDIATE sql_stmt USING v_student_id RETURNING INTO v_new_zip;
    DBMS_OUTPUT.PUT_LINE ('New zip code: '||v_new_zip);

    in this returning clause in the both clause what for ?please tell me.

    DB:2.83:Returning Clause zs

    797525 wrote:
    hi..

    sql_stmt := 'UPDATE my_student SET zip = 11105 WHERE student_id = :1 '||
    'RETURNING zip INTO :2';
    EXECUTE IMMEDIATE sql_stmt USING v_student_id RETURNING INTO v_new_zip;
    DBMS_OUTPUT.PUT_LINE ('New zip code: '||v_new_zip);

    in this returning clause in the both clause what for ?please tell me.I think what you are asking is why you have to use two returning clauses, one in the sql statement and one in the execute immediate.

    The SQL statement needs one to instruct the update to obtain the resultant value of a column and pass it back into a variable. In this case, because you are using dynamic SQL (execute immediate) the variable is a bind variable, so you have to instruct the execute immediate pl/sql statement that it will be getting a returned variable and where to put it, hence the returning into clause in that statement too...

    e.g.

    SQL ed
    Wrote file afiedt.buf

    1 declare
    2 sql_stmt varchar2(4000);
    3 v_empno number := 7844;
    4 v_newcomm number;
    5 begin
    6 sql_stmt := 'update emp set comm = comm + 200 where empno = :1 returning comm into :2';
    7 execute immediate sql_stmt using v_empno returning into v_newcomm;
    8 dbms_output.put_line('New commission : '||v_newcomm);
    9* end;
    SQL /
    New commission : 200

    PL/SQL procedure successfully completed.

    SQLOf course the question should be why you feel the need to use dynamic SQL in the first place, as within PL/SQL you have the ability to use the SQL statement and the returning clause directly...

    SQL ed
    Wrote file afiedt.buf

    1 declare
    2 sql_stmt varchar2(4000);
    3 v_empno number := 7844;
    4 v_newcomm number;
    5 begin
    6 update emp set comm = comm + 200 where empno = v_empno returning comm into v_newcomm;
    7 dbms_output.put_line('New commission : '||v_newcomm);
    8* end;
    SQL /
    New commission : 200

    PL/SQL procedure successfully completed.and PL/SQL handles the binding of the variables for you automatically.

  • RELEVANCY SCORE 2.82

    DB:2.82:How To Delete A Specific Row From The Qvd Without The 'Where' Clause? xs



    Hi,

    I have a qvd file in which I want to delete some specific row without the using of 'where' clause. Because if I use the where clause that time I have to load the full data I did not want that.

    Thanking You

    Regards

    Anup

    DB:2.82:How To Delete A Specific Row From The Qvd Without The 'Where' Clause? xs


    Would incremental load help?

    http://www.quickintelligence.co.uk/qlikview-incremental-load/

  • RELEVANCY SCORE 2.82

    DB:2.82:Entitydatasource - Filtri Avanzati az


    in sqldatasource per una query di select avanzata mi bastava inserire t-sql in select command, ma con entityDatasource?
    immaginiamo di avere una tabella clienti con nome, cognome, partitiaiva, indirizzo, ecc ecc..
    nella webform poi l'utente ha la possibilita di filtare i dati con varia textBox tipo cerca per nome - cognome, ecc..
    come posso ottenere l'equivalente in entitydatasource? tipo: select * from client where nome = 'nome' or cognome = 'cognome' And indirizzo = 'indirizzo..

    DB:2.82:Entitydatasource - Filtri Avanzati az

    il post puo considerarsi chiuso grazie ad un altro post con domanda simile.

  • RELEVANCY SCORE 2.82

    DB:2.82:Where To Ask Questions About Retaining Entitydatasource Bound Grid Data Between Wizard Steps xp


    Hello,I am working on a 4 step wizard. Page 2 has a grid that is bound to an entitydatasource. If I update, add or delete rows in the grid and navigate to next or previou step and then come back to page 2 the grid doesn't reflect my changes.What forum should I use to post questions about this issue?Thanks.

    DB:2.82:Where To Ask Questions About Retaining Entitydatasource Bound Grid Data Between Wizard Steps xp

    Hi,Thank you for the post.  I would suggest posting your question in one of the Home › ASP.NET Forums » Data Access » ASP.NET Dynamic Data » Entity Datasource Multi-Level Views located here:
    http://forums.asp.net/p/1411850/3096884.aspxor you can also post in Data Platform Developer Center Data Platform Development Forums ADO.NET Entity Framework and LINQ to Entities located here:http://social.msdn.microsoft.com/forums/en-US/adodotnetentityframework/threads/
    Hope this helps you.
    Have a great day!Tier 2 Application Support
    Server and Tools Online Operations Team

  • RELEVANCY SCORE 2.82

    DB:2.82:Query Performance js


    Hello all,

    Two queries below return same result:
    --(a) query 1 uses from table2
    --(b) query 2 uses inner select in where clause
    Is there any difference in performance? What's the difference in performance between using a table in FROM clause or using inner select in WHERE clause?

    (a)
    SELECT
    S.NUM
    FROM
    SPELERS S,
    WEDSTRIJDEN W
    WHERE
    W.NUM=S.NUM
    (b)
    SELECT
    S.NUM
    FROM
    SPELERS S
    WHERE
    S.NUM in (SELECT NUM FROM WEDSTRIJDEN)

    many thanks,

    keizersoz

    DB:2.82:Query Performance js

    Your two queries are equivalent if the NUM column is unique in both tables, but potentially not otherwise . For example, if there are duplicate rows in WEDSTRIJDEN they will show in query (a), but not in (b).

  • RELEVANCY SCORE 2.81

    DB:2.81:Ado.Net Entity Framework - Entitydatasource And Data Transformation... + Asp.Net d3


    Hi all,Alright so I'm working with an EDM model in ASP.NET and trying to use the EntityDataSource with a GridView...first of all I have to say that just to perform a simple select on the EntityDataSource I have to use this special it syntax and I'm going back to using a string - I thought the whole point of these data service frameworks was to make everything type-safe/strongly-typed! I might as well just go back to writing SQL statements; frankly I'm a little puzzled by this - if someone can recommend a better way to use an ASP.NET Entity Framework model with a GridView that will allow me to sort, order by and filter, please let me know...because right now even the LinqDataSource seemed a lot better - at least I could transform data using .NET using the Selecting event...That's the first question...the second: If I do continue to use the EntityDataSource to access my data model, how can I transform the data? I know I can use different SQL functions in my EntityDataSource.Select statement but one of the things I loved so much about LinqToSql was that I could do something like this:

    var peopleUpperCaseNames = from person in tblPeople select new { PersonName = person.PersonName.ToUpper() };

    DB:2.81:Ado.Net Entity Framework - Entitydatasource And Data Transformation... + Asp.Net d3

    Thanks a lot for the reply Diego, it definitely clears some things up. :-) While I have your attention maybe I can get you to answer another question that I am having trouble getting a straight answer about - once I have imported a stored procedure as a function (which has been mapped to an entity set based off one of my SQL views) how do I use it w/ the EntityDataSource, or do I have to use the ObjectDataSource as well?Thank you for your time,                                    Azad
    ▫▫▫▫▫▫▫▫▫▫▫▫▫▫▫▫▫▫▫▫▫▫▫▫
    Azad Ratzki
    http://azad.fucius.cc===
    ▫▫▫▫▫▫▫▫▫▫▫▫▫▫▫▫▫▫▫▫▫▫▫▫

  • RELEVANCY SCORE 2.81

    DB:2.81:Index Usage From Sql Query In Oracle Forms k7


    Would using LIKE/OR in where clause (of an indexed column) will force the the query to NOT use INDEX. We have these where clause in Oracle Forms Records Group.

    Below are two examples...
    1. If we have a where clause with LIKE would that NOT use the index?
    Example: ColumnName like :block.Column||%

    2. How about having an OR clause?
    Example: and (ColumnName = :block.column or :block.column is null)

    Thanks

    DB:2.81:Index Usage From Sql Query In Oracle Forms k7

    Hi
    Answer 1: Where with like clause WOULD use the index.
    In this example index on ColumnName

    Answer 2: Write better where:
    Example: and (:block.column is null or ColumnName = :block.column)
    When :block column is null then statement after 'or' is not used. Index will not be used with RBO, i think.

    The best way to be sure is to look at explain plan on the original query.

    Regards
    Kuba

  • RELEVANCY SCORE 2.81

    DB:2.81:Preparedstatement And "In" Clause 19


    I am trying to pass an "in" clause to a SQL statement as a bind variable, but keep getting an "invalid number" runtime error:

    The "where" clause of the SQL statement is:
    String wherestmnt = "where sh.header_id in ? ";

    I am using a PreparedStatement and am setting the bind variable as follows:
    pstmt.setString(1,"(34552)")

    If I change the "in" clause to "=" and do a set as pstmt.setString(1,"34552") it works fine.

    Any advice?
    null

    DB:2.81:Preparedstatement And "In" Clause 19

    There is also another error. If you need to use the in clause the values must be within paranthesis,

    So if your query were like,

    select * from emp where empno in (?)

    then the bind would work. You can have as many ? as you want separated by commas and you can bind that many values..!

  • RELEVANCY SCORE 2.81

    DB:2.81:Advantage Of Period For Clause In 12c sa


    Hello,I'm trying to understand the new PERIOD FOR clause in 12c. After reading several examples and documentation however I'm still not sure about its advantage. What can PERIOD FOR do that I cannot achieve with using a WHERE clause on normal start and end time columns?Thanks!

    DB:2.81:Advantage Of Period For Clause In 12c sa

    Giving it some break to let the information sink in, I may have a somewhat better understanding how Row Archival and Temporary Validity work with Information Lifecycle Management (ILM).Part of the answer is that Temporal Validity can be part of an ADO policy, similar to Row Archival to manage compression and tiered storage for archiving. While Row Archival can be used to archive rows based on age and access frequency (12c Heat Map), Temporal Validity end times add further logic at an application data level. Row-level policies for ADO are not supported for Temporal Validity, but ADO and compression are supported if partitioned on the end-time columns.I suppose the visibility options provide some SQL query efficiency and convenience. ILM among other things improves the performance of indexes, as data that is archived is no longer part of an index. Flashback Data Archive (FDA) is archived undo for specific tables and does not use indexes, if I understand correctly, but Temporal Validity adds additional features, although I still wonder about the practical advantage.Anyway, it's all in Oracle documentation, but as usual it only makes sense once you manage to understand the necessary background first.

  • RELEVANCY SCORE 2.81

    DB:2.81:Cast In Entitydatasource Where-Klausel 9a



    Hallo,
    wie kann ich in einer Where-Klausel einer EntityDataSource einen Cast verwenden?
    Konkret: ein Entittsmember vom Typ int soll mit einem String verglichen werden und ich mchte den Integer auf nvarchar, System.String o.. casten. Fr mich unklar ist dabei zum einen, welches der richtige Datentyp wre, zum anderne,
    wie dieser Cast syntaktisch auszusehen hat.
    Gre und Danke vorab!
    Anja
    ...zuerst im ASP.NET-Forum gepostet, aber dort vermutlich falsch aufgehoben.

    DB:2.81:Cast In Entitydatasource Where-Klausel 9a

    Zeig mal einenkleinen Codeschnipsel.

    asp:EntityDataSourceWhere=it.[Name] like @Name '%' AND (@Description = '%' OR it.[Description] like @Description '%') AND (it.[Status] = 1) AND (it.[FunctionalGroup].Caststring() like '@FunctionalGroup')

  • RELEVANCY SCORE 2.80

    DB:2.80:Re: Using Bind Variable In Dynamic Where Clause And Concatenate With Query 97


    Or wait for the new DBMS_SQL.TO_REFCURSOR and TO_CURSOR_NUMBER functions due in 11g ;)

    DB:2.80:Re: Using Bind Variable In Dynamic Where Clause And Concatenate With Query 97

    Yes - what I would be looking for (and what in fact you can't do) is something like:

    SQL SELECT * FROM TABLE(emp_pkg.to_csv(CURSOR(SELECT * FROM emp)));

    COLUMN_VALUE
    ----------------------------------------------------------------------------------------------------
    7369,SMITH,CLERK,7902,1980-12-17,800,,20
    7499,ALLEN,SALESMAN,7698,1981-02-20,1600,300,30
    7521,WARD,SALESMAN,7698,1981-02-22,1250,500,30
    7566,JONES,MANAGER,7839,1981-04-02,2975,,20
    7654,MARTIN,SALESMAN,7698,1981-09-28,1250,1400,30
    7698,BLAKE,MANAGER,7839,1981-05-01,2850,,30
    7782,CLARK,MANAGER,7839,1981-06-09,2450,,10
    7788,SCOTT,ANALYST,7566,1987-04-19,3000,,20
    7839,KING,PRESIDENT,,1981-11-17,5000,,10
    7844,TURNER,SALESMAN,7698,1981-09-08,1500,0,30
    7876,ADAMS,CLERK,7788,1987-05-23,1100,,20
    7900,JAMES,CLERK,7698,1981-12-03,950,,30
    7902,FORD,ANALYST,7566,1981-12-03,3000,,20
    7934,MILLER,CLERK,7782,1982-01-23,1300,,10

    14 rows selected.but be able to pass in any arbitrary ref cursor and have it return some transformed version of the row set, in this case a CSV collection. However the above example is currently only possible with a strongly typed ref cursor, something like:

    CREATE OR REPLACE PACKAGE emp_pkg
    AS
    TYPE emp_refcursor IS REF CURSOR RETURN emp%ROWTYPE;

    FUNCTION to_csv
    ( p_rowset IN EMP_REFCURSOR )
    RETURN VARCHAR2_TT -- collection of VARCHAR2
    PIPELINED;
    END emp_pkg;

    CREATE OR REPLACE PACKAGE BODY emp_pkg
    AS
    FUNCTION to_csv
    ( p_rowset IN EMP_REFCURSOR )
    RETURN VARCHAR2_TT -- collection of VARCHAR2
    PIPELINED
    AS
    r emp%ROWTYPE;
    BEGIN
    LOOP
    FETCH p_rowset INTO r;
    EXIT WHEN p_rowset%NOTFOUND;

    PIPE ROW
    ( r.empno || ',' || r.ename || ',' ||
    r.job || ',' || r.mgr || ',' ||
    TO_CHAR(r.hiredate,'YYYY-MM-DD') || ',' ||
    r.sal || ',' || r.comm || ',' || r.deptno );
    END LOOP;

    RETURN;
    END to_csv;
    END emp_pkg;This is the enhancement to DBMS_SQL expected in 11g.

  • RELEVANCY SCORE 2.80

    DB:2.80:Doubt In Pl/Sql af


    i am having an sql that uses an "IN clause" in where condn..is using "=" faster than in even if only one value is there in the where clause..
    eg
    where id = 1 or where id in(1) which is faster?

    DB:2.80:Doubt In Pl/Sql af

    '=' CAN be faster but is not always. WHERE A IN (1) and WHERE A = 1 are equivalent. No one can be "faster", no matter what indexes, data distribution etc.
    Consider following:
    DROP TABLE T1;
    CREATE TABLE T1 AS (SELECT OBJECT_ID A FROM USER_OBJECTS);

    SET AUTOTRACE ON

    SELECT * FROM T1 WHERE A IN (60716);
    Execution Plan
    ---------------------------------------------------
    0 SELECT STATEMENT Optimizer=CHOOSE
    1 0 TABLE ACCESS (FULL) OF 'T1'
    Statistics
    ---------------------------------------------------
    .....
    8 consistent gets
    .....
    1 rows processed

    SELECT * FROM T1 WHERE A = 60716;
    Execution Plan
    ---------------------------------------------------
    0 SELECT STATEMENT Optimizer=CHOOSE
    1 0 TABLE ACCESS (FULL) OF 'T1'
    Statistics
    ---------------------------------------------------
    .....
    8 consistent gets
    .....
    1 rows processed

    CREATE INDEX T1_IDX ON T1(A);
    Index created.

    SELECT * FROM T1 WHERE A IN (60716);
    Execution Plan
    -------------------------------------------------------
    0 SELECT STATEMENT Optimizer=CHOOSE
    1 0 INDEX (RANGE SCAN) OF 'T1_IDX' (NON-UNIQUE)
    Statistics
    -------------------------------------------------------
    .....
    2 consistent gets
    .....
    1 rows processed

    SELECT * FROM T1 WHERE A = 60716;
    Execution Plan
    -------------------------------------------------------
    0 SELECT STATEMENT Optimizer=CHOOSE
    1 0 INDEX (RANGE SCAN) OF 'T1_IDX' (NON-UNIQUE)
    Statistics
    -------------------------------------------------------
    .....
    2 consistent gets
    .....
    1 rows processed

  • RELEVANCY SCORE 2.80

    DB:2.80:Branching Control In Where Clause sk


    Hi All,
    Do I have an option to branch control in the WHERE clause , i.e. based on a condition being true in one of the clause, then only I execute the other clause in the same WHERE clause .

    Regards,

    Gaurav S

    DB:2.80:Branching Control In Where Clause sk

    where ((:v = 1 and ....) OR( :v = 2 and ...) OR (:v = 3 and ...))

  • RELEVANCY SCORE 2.79

    DB:2.79:Dynamic Where Clause In Ref Cursor From Form ff


    Hi,
    I have created a data block in a Form using a ref cursor. I have to dynamically create and pass a where clause to the query in ref cursor.

    How to pass a where clause dynamically to a ref cursor from Forms.

    Appreciate any help.

    Umasankar

    DB:2.79:Dynamic Where Clause In Ref Cursor From Form ff

    set_block_property will NOT work if datablock is based on stroed procedure !

  • RELEVANCY SCORE 2.79

    DB:2.79:Filter Entitydatasource Based On Foreign Key 3a


    Hi, I am trying to do something simple but I just can't figure it out. Please can you help!My schema looks like this:CustomerOrder  Id (pk, guid)  AgentId (fk, guid, nullable)  ... other fields ...Agent  Id (pk, guid)  Name (string)  ... other fields ...I need to create an EntityDataSource in my c# asp.net app that displays a list of orders for the logged-in agent. The agent's ID is stored in the Session collection during login.Currently, my EntityDataSource looks like this:

    asp:EntityDataSource ID=customerOrdersDataSource runat=server   

            ConnectionString=name=MyEntities   

            DefaultContainerName=MyEntities EntitySetName=CustomerOrder   

            Select=it.[Id], it.[Title], it.[FirstName], it.[LastName], it.[HomeTelephone], it.[Postcode], it.[Status]   

            Where=(it.[Agent] = @AgentId) 

            Include=Agent 

            EntityTypeFilter=  

            WhereParameters 

              asp:SessionParameter Name=AgentId SessionField=LoggedInAgentId Type=String / 

            /WhereParameters 

        /asp:EntityDataSource 

  • RELEVANCY SCORE 2.79

    DB:2.79:Setting Where Clause In Eds In Gridview xs


    Hi All
    Iam trying to programatically set a where clause in an EntityDataSource that controls a dropdown in a cell in a Gridview. The selected value of the DropDown Binds to one of the Gridview coulmns.
    However, I would like to filter the DropDown list based on one of the DataKeys of the Gridview so Iam trying to set the where clause for the EDS for the dropdown in the codebehind.
    When I try to do this I get the error : Databinding methods such as Eval(), XPath(), and Bind() can only be used in the context of a databound control.
    Here is the GridView snippet.

    asp:GridView ID=gvGames runat=server AutoGenerateColumns=False DataKeyNames=Id,DivisionId
    DataSourceID=edsGames SkinID=Small
    Columns
    ...
    ...

    asp:TemplateField HeaderText=Home SortExpression=HomeTeamId
    ItemTemplate
    asp:DropDownList ID=ddHomeTeam runat=server DataSourceID=edsHomeTeamDD DataTextField=Name
    DataValueField=Id SelectedValue='%# Bind(HomeTeamId) %'
    /asp:DropDownList
    asp:EntityDataSource ID=edsHomeTeamDD runat=server ConnectionString=name=FBEntities
    DefaultContainerName=FBEntities EnableFlattening=False EntitySetName=Teams
    /asp:EntityDataSource
    /ItemTemplate
    ...
    ...
    /Columns
    /asp:GridView
    asp:EntityDataSource ID=edsGames runat=server ConnectionString=name=FBEntities
    DefaultContainerName=FBEntities EnableDelete=True EnableFlattening=False
    EnableUpdate=True EntitySetName=Games Include=Location, Home, Away, Division
    /asp:EntityDataSource

    DB:2.79:Setting Where Clause In Eds In Gridview xs

    Looks like I was using the wrong event. Seems to work OK when I use the RowCreated event.
    Seems we often end up solving our own problems...

    ____________________________________________________ Regards The.Blacksmith

  • RELEVANCY SCORE 2.79

    DB:2.79:Dynamic Data And Entitydatasource Complex Where Clause 77


    Hi,
     
    I'm trying to customize a ListDetails page in the Dynamic Data setup to display a list of records based on a more complex where clause. If, for example, you had Customers and Orders and OrderDetails, my query would be something where I want to display Customers but filter them on Orders.OrderDetails.someField = someValue.
     
    In the code-behind I tried something like
     
    GridDataSource.AutoGenerateWhereClause = false;
    GridDataSource.Where = it.Orders.OrderDetails.someField = someValue;
     
    I just keep getting an error: 'someField' is not a member of 'Transient.collection...
    and it says I have to iterate through the collection but I don't see how to do that in a simple string where clause.
     
    The end result I'm hoping for is to have a dropdown that specifies several conditions where data inconsistencies can occur and based on the item selected from the dropdown, I can apply a where clause that will return a limited Customer list based on criteria from one or more related tables. I haven't quite got a grip on the nuances of navigation properties, but any help would be appreciated.
     
    thanks,

    DB:2.79:Dynamic Data And Entitydatasource Complex Where Clause 77

    John,
    That is right. BoundFields will only look at the 1st level properties of the entities, while an Eval() expression can drill down into the object graph to arbitrary levels. The reason some second level properties may work with a BoundField (i.e. “Category.CategoryID” in Products) is because we purposely exposed those properties for databinding.
    Databinding doesn’t really look at the actual properties of an object, but at PropertyDescriptors, which provides an extensible view of objects, similar but not the same that reflection. While actual properties in an Object cannot have a name like “Category.CategoryID”, that is perfectly fine for a PropertyDescriptor.
    You can learn more on what the EntityDataSource does here:
    http://blogs.msdn.com/diego/archive/2008/05/13/entitydatasource-to-wrap-or-not-to-wrap.aspx
    http://blogs.msdn.com/diego/archive/2008/05/24/entitydatasource-s-flattening-of-complex-type-properties.aspx
    Hope this helps,Diego

  • RELEVANCY SCORE 2.79

    DB:2.79:Select Statement In Where Clause f8



    Hi

    It is possible insert select statement in where clause? I'm using universe design end I want to insert select statement in where clause (a nested subquery).

    For example:

    select basic.field1

    from basic

    where basic.employee in{select employee from table_distinct where user='x'}

    DB:2.79:Select Statement In Where Clause f8


    Hi, pocho loco:

    what if you create the syntax in a quer filter (yellow object in the universe)?

    name: filter_emp

    code:

    basic.employee in (select employee from table_distinct where user='x')

    does the sql change when you use this filter object in the report?

    Regards

    Erika

  • RELEVANCY SCORE 2.79

    DB:2.79:In Clause Performance 7k


    I have query regarding the use of IN clause. I am in situation where i have to use IN clause and IN clause going to take 1000 arguments or more than that (using OR operator). The other option is that i have to hit database each time (1000 plus) from front end and fetch record for each value. Can any one suggest me what is the best approach in terms of performance.

    DB:2.79:In Clause Performance 7k

    I have query regarding the use of IN clause. I am in situation where i have to
    use IN clause and IN clause going to take 1000 arguments or more than that
    (using OR operator). The other option is that i have to hit database each time
    (1000 plus) from front end and fetch record for each value. Can any one suggest
    me what is the best approach in terms of performance.I think that the IN clause is just "translated" into OR's anyway.

    Can you put the values in a table and join to that instead - i.e.

    WHERE myValue IN (SELECT blahField FROM MyReferenceTable)

    Then run Tkprof and check - remember the mantra of Tom Kyte and Jonathan
    Lewis - Benchmark, Benchmark, Benchmark.....

    (added in edit - I also agree with BluShadow's point about design - how do you
    even write an SQL statement iwth 1000's of values in the IN clause?)

    Paul...

    Edited by: Paulie on 12-Apr-2012 15:33

  • RELEVANCY SCORE 2.79

    DB:2.79:Select Statement In Where Clause ax


    hi

    any body knows that can we use a select statement in where clause if yes how?

    DB:2.79:Select Statement In Where Clause ax

    This is the general syntax for a correlated query

    SELECT select_list
    FROM table1 t_alias1
    WHERE expr operator
    (SELECT column_list
    FROM table2 t_alias2
    WHERE t_alias1.column
    operator t_alias2.column);

    for example:

    SELECT department_id, last_name, salary
    FROM employees x
    WHERE salary (SELECT AVG(salary)
    FROM employees
    WHERE x.department_id = department_id)
    ORDER BY department_id;
    returns data about employees whose salaries exceed their department average.

  • RELEVANCY SCORE 2.79

    DB:2.79:Filter Function In Where Clasue xs


    Hi All,How to use filter function  in where clause using MDX?

    DB:2.79:Filter Function In Where Clasue xs


    thanks for the reply this is generic filter usage on rows.but i want to use the filter in where clause.

    Hi Raum, Is there any differences between using filter in axis and using filter in where clause? Why not direly using filter in where clause?
    http://social.msdn.microsoft.com/Forums/en-US/sqlanalysisservices/thread/431b4da7-94ef-4b27-b34c-c708db715ef9
     
    Regards,
    Raymond

  • RELEVANCY SCORE 2.79

    DB:2.79:Cast In Entitydatasource Where-Klausel 9j


    Hallo,
    wie kann ich in einer Where-Klausel einer EntityDataSource einen Cast verwenden?
    Konkret: ein Entittsmember vom Typ int soll mit einem String verglichen werden und ich mchte den Integer auf nvarchar, System.String o.. casten. Fr mich unklar ist dabei zum einen, welches der richtige Datentyp wre, zum anderne,
    wie dieser Cast syntaktisch auszusehen hat.
    Gre und Danke vorab!
    Anja

    DB:2.79:Cast In Entitydatasource Where-Klausel 9j

    Wie gro ist die zu durchsuchende Liste, kommt diese aus der Datenbank?
    Vielleicht sollte man die Liste vorher konvertieren und die konvertierte Liste durchsuchen
    ungefhr so

    var conv = from a in MyList select new { value1 = a.MyInt.ToString(); identifier = a.Identifier};

    var result = from a in conv where a.value1 = int.ToString() select a;

  • RELEVANCY SCORE 2.79

    DB:2.79:Dynamic Sql Ref Cursor And Dynamic Using Clause k9


    Can you have a dynamic "using" clause? I am using an Oracle Form as a parameter form. If the user doesnt fill in a parameter, I dont include it in the where clause... I build the v_new_hal_select_str where clause together dynamically. So, depending on the where clause I need to alter the order and content of the using clause? I cannot seem to find any examples of such a thing...
    OPEN new_hal_cursor
    FOR v_new_hal_select_str
    USING p_hal_report_param_rec.target_year,
    p_hal_report_param_rec.target_type,
    p_hal_report_param_rec.compare1_year,
    p_hal_report_param_rec.compare1_type,
    p_hal_report_param_rec.target_year,
    p_hal_report_param_rec.target_type,
    p_hal_report_param_rec.compare2_year,
    p_hal_report_param_rec.compare2_type,
    p_hal_report_param_rec.target_year,
    p_hal_report_param_rec.target_type,
    p_hal_report_param_rec.compare3_year,
    p_hal_report_param_rec.compare3_type,
    p_hal_report_param_rec.target_year,
    p_hal_report_param_rec.target_type;
    FETCH new_hal_cursor
    BULK COLLECT INTO v_new_hal_tab;
    CLOSE new_hal_cursor;

    DB:2.79:Dynamic Sql Ref Cursor And Dynamic Using Clause k9

    A quite well-known way would be as described at Toms CURSOR thread.

  • RELEVANCY SCORE 2.79

    DB:2.79:Bind A Dropdown With Entitydatasource With Empty Value As The First Item 9k


    Hi,
    I have to bind a dropdown in my aspx page using an entity datasource.

    asp:EntityDataSource ID=StakeholdertypeDataSource runat=server

    ConnectionString=name=eContractModelContainer

    DefaultContainerName=eContractModelContainer EnableFlattening=False

    EntitySetName=StakeHoldersTypes_Translations

    Select=it.[StakeHoldersTypes], it.[Description] Where=it.[LanguageID] == @sessionLanguageID
    WhereParameters
    asp:SessionParameter Name=sessionLanguageID SessionField=sessionLanguageID DbType=Int16 /
    /WhereParameters

    /asp:EntityDataSource
    How shall i retrieve a blank row with the records retreived in EF dataset without any insert statement in the code behind seperately ?

    DB:2.79:Bind A Dropdown With Entitydatasource With Empty Value As The First Item 9k

    Solution 1: Try turning on AppendDataBoundItems=True and add an empty ListItem to your DropDownList tag. For instance like:

    asp:DropDownList ID=ddl1 runat=server
    SelectedValue=%# Bind(Whatever_Value) %
    AppendDataBoundItems=True
    DataSourceID=StakeholdertypeDataSource
    DataTextField=Whatever_Title
    DataValueField=Whatever_ID

    !-- an empty ListItem along with the AppendDataBoundItems property allow for a nullable relationship --
    asp:ListItem Value= Text= /
    /asp:DropDownList

  • RELEVANCY SCORE 2.79

    DB:2.79:Ora-01722: Invalid Number - Only In Where Clause fz


    I am getting ORA-01722: invalid number when using to_number in where clause:
    select to_number(txt_field) from tbl where 100=to_number(txt_field);I am not getting it without where clause (300 rows returned):
    select to_number(txt_field) from tbl;Any logical explanation?

    Edited by: totalnewby on Feb 21, 2012 4:54 AM

  • RELEVANCY SCORE 2.78

    DB:2.78:Filtering On User.Identity.Name 9s


    I have a ListView that is bound to an EntityDataSource object and I would like to filter the ListView Based on the username of the logged in user. I tried writing a where clause with some inline code to pull the logged in users name as shown below but it
    didn't work. Can someone point me in the right direction. Cheers!
    Where=it.UserId = '% User.Identity.Name.ToString() %'

    DB:2.78:Filtering On User.Identity.Name 9s

    I have a ListView that is bound to an EntityDataSource object and I would like to filter the ListView Based on the username of the logged in user. I tried writing a where clause with some inline code to pull the logged in users name as shown below but it
    didn't work. Can someone point me in the right direction. Cheers!
    Where=it.UserId = '% User.Identity.Name.ToString() %'

  • RELEVANCY SCORE 2.78

    DB:2.78:Query Performance ax


    Hello all,

    Two queries below return same result:
    --(a) query 1 uses from table2
    --(b) query 2 uses inner select in where clause
    Is there any difference in performance? What's the difference in performance between using a table in FROM clause or using inner select in WHERE clause?

    many thanks,

    keizersoz

    DB:2.78:Query Performance ax

    Dup thread :
    Re: query performance

    Nicolas.

  • RELEVANCY SCORE 2.78

    DB:2.78:Entitydatasource With Many-To-Many Master/Detail cd


     
    Hi,
    I would like to set up a master/detail web page using EntityDataSource.
     
    I have watched Diego's excellent video on EntityDataSource, but my situation is slightly different in that the master/detail is a many-to-many relationship. The 'link table' has only the keys as columns and so it does not appear as an entity.
     
    Any help would be appreciated ?
     
     
     

    DB:2.78:Entitydatasource With Many-To-Many Master/Detail cd


    Hi Graham,
    I should apologize instead for leaving your question unanswered. I am glad that you found the other thread.
    Thanks,Diego

  • RELEVANCY SCORE 2.78

    DB:2.78:Content Mapping 18


    Hi ,

    can any one please explain me about the 'content mapping' and using where clause in detail. I would like to when we should use content mapping and in what way the where clause will be helpful.
    Can i filter a column in rpd level using where clause in contentmapping please help me .

    Thanks in Advance,
    chak

    DB:2.78:Content Mapping 18

    Hi Chak,

    Content tab serves these purposes,

    1) Logical level: It is used to define the level of dimensional hierarchy in a fact table.It is also used for level based measure.Suppose you have year,month and days etc as levels in your hierarchy and you want data of a particular table to be aggregated by month then you can set content for that fact as month .

    2) Fragmentation Content:This is mainly used for increasing the performance usually done if the records are more .For example three sources pointing to the same table are created for the required table in BMM layer. BI server will be choosing from the three sources of the table based on the query required.

    3)WHERE Clause: To filter the values of the table. The data getting populated from the table is restricted using 'Where' clause.

    Rgds,
    Dpka