esql

Linq to Entities vs ESQL

When using the Entity Framework, does ESQL perform better than Linq to Entities? I'd prefer to use Linq to Entities (mainly because of the strong-type checking), but some of my other team members are citing performance as a reason to use ESQL. I would like to get a full idea of the pro's/con's of using either method. ...

Entity Framework & LINQ To SQL - Conflict of interest?

I've been reading on the blogosphere for the past week that Linq to SQL is dead [and long live EF and Linq to Entities]. But when I read the overview on MSDN, it appeared to me Linq to Entities generates eSQL just the way Linq to SQL generates SQL queries. Now, since the underlying implementation (and since SQL Server is not yet an ODB...

Comparing dates in Entity SQL

What is the correct eSQL syntax to compare dates? The equivalent LINQ-to-Entities expression would look something like this: var lastYearsShipments = from p in MyDataServiceContext.Products where p.ShipDate.Value.Year == DateTime.Now.Year - 1 select p; ...

Entity Sql for a Many to Many relationship

Consider two tables Bill and Product with a many to many relationship. How do you get all the bills for a particular product using Entity Sql? ...

Working with the ObjectQuery Single Enumeration Challenge in Linq-To-Entities Entity SQL

I'm working on modifying this example: Using advWorksContext As New AdventureWorksEntities ' Call the constructor that takes a command string and ObjectContext. Dim productQuery1 As New ObjectQuery(Of Product)("Product", advWorksContext) Dim result As Product For Each result In productQuery1 Console.WriteLine("P...

Searching free accomodation

I need help with a query? I have 2 tables reservations & units among others. Table reservations has columns ResId,rfrom(datetime),rto(datetime),status(int),UnitID(foreign key). Status 2 means its confirmed. I need to get all free units in requested period, query needs to return only that units for which there aren't confirmed reservatio...

How to configure cmake to compile informix *.ec files?

I'm just found cmake and I want to use it to create make files for a little project that uses the esql compiler. ...

Comparing Date / DateTime ine Entity SQL Where clause...

I have a method which accepts an ObjectQuery and adds Where clauses to it depending on whether it receives values for various filter parameters. The method has to return an ObjectQuery. How can i do a basic Date comparison e.g. where dateX < dateY. This is my current code: if (myDateFilter != null) { query = query.Where( st...

"FOR UPDATE" clause is throwing error in esql program

Hi, We are developing a migrate program. There are nearly 80 million records are there in DB. The code is as follows: static int mymigration(struct progargs *args) { exec sql begin declare section; const char *selectQuery; const char *updateQuery; long cur_start; long cur_end; long serial; long number; ch...

Entity framework (3.5): How to translate a certain LINQ query to eSQL?

Hi there, I have the following LINQ query that I need to translate to Entity SQL /eSQL): return (ObjectQuery<User>) from user in Users where !user.Roles.Any(r => r.AnIntegerProperty < 0) select user; User.Roles is an navigation property to the n:m relation to Roles and there also is a Role.Users navigation property the other wa...

Entity Sql Group By problem, please help

Hello, help me please with this simple E-sql query: var qStr = "SELECT SqlServer.Month(o.DatePaid) as month, SqlServer.Sum(o.PaidMoney) as PaidMoney FROM XACCModel.OrdersIncomes as o group by SqlServer.Month(o.DatePaid)"; Here's what I have. I have simple Entity called OrdersIncomes with ID,PaidMoney,DatePaid,Order_ID properties I ...

Is writing eSQL database independent or not?

Using EF we can use LINQ to read data which is rather simple (especially using fluent calls), but we have less control unless we write eSQL on our own. Is writing eSQL actually data store independent code? So if we decide to change data store, can the same statements still be used? Does writing eSQL strings in your code pose any seriou...

Split a string in ESQL

Do we have a inbult esql function to split a string ? ...

Convert float to decimal in Informix

I have a table with a column of type decimal. There is a ESQL/C structure that represents the table. It has a member of type decimal. I also have a normal C structure for equivalent for the same table. The type of the above mentioned field is a float. Since we use memcpy to copy data to and from ESQL/C structure to C structure, there is...

How should i use navigation properties while writing a query using eSQL?

i am trying to write a query using eSQL where in my entity has got navigation properties. i am not able to include these navigation properties in the query. Like in Linq to SQL we have this .Include method, how will it be possible in eSQL? ...

Blanks causing problem while fetching rows (Informix)

The always interesting issue of NULL Vs Blank is driving me bit crazy now. I have two ESQL/C structures that represent two tables. I'm fetching a row from one table in a cursor. Using the values of two fields from this fetch, I will retrieve a row from another table. I know before hand the second fetch will definitely return one row. N...

How to change the condition of 2 ESQL where clauses in the final expression?

I have a fairly complex query where I am filtering results with a LIKE statement. Here is the query: var qsFilter = entities.QueryStatements.Where("it.Statement LIKE @searchTerm", new ObjectParameter("searchTerm", searchTerm)); var qtFilter = entities.QueryTables.Where("it.TableNames LIKE @searchTables", new ObjectParameter("s...

Comparing DateTime in Entity Framework with an Sql Server Compact database

Why this code throws a System.NotSupportedException telling that The specified method 'int? DateDiff(string, DateTime?, DateTime?)' on the type 'System.Data.Objects.SqlClient.SqlFunctions' cannot be translated into a LINQ to Entities store expression, though DateDiff has EdmFunction attribute? context.Users.Where(f => System.Data.Object...

Informix Dynamic Server / ESQL question - TEXT Update versus TEXT insert

I maintain a 3rd party Informix driver that's written with ESQL-style (Informix API) calls. I'm working on a bug where, for TEXT fields, INSERTs work fine and UPDATEs fail. Stepping through the code, what I've found is that we're checking our sqlda structure to tell us whether and how to bind, and after the call to sqli_describe_statem...

Eclipse CDT and ESQL syntax errors

I am using Eclipse CDT (Helios release) to edit the source code of an (old) C application, which also uses ESQL. In this project, by convention, files containing ESQL code have a .sc extension (instead of the default .c) All ESQL sections e.g. starting with EXEC SQL keywords are flagged as “syntax error” (vertical ruler, overview ruler ...