Embarcadero/IB.NETDataProvider

InterBaseSQL.EntityFrameworkCore.InterBase issue

tramesh2009 opened this issue · 8 comments

Getting this below error in class library project in .Net core
InterBaseSql.Data.InterBaseClient.IBException: 'Dynamic SQL Error
SQL error code = -104
Token unknown - line 2, column 14
AS'
some please help to resole this issue

Please be so kind and provide more info (e.g. the SQL statement). This is too less for helping you.

I may have had the same problem.

My InterBase version do not accept :

  • FROM Xxxx AS yy but only FROM Xxxx yy (without AS)
  • INNER JOIN Xxxx AS yy but only INNER JOIN Xxxx yy (without AS)

Perhaps a clue.

Sorry, I did not get a chance to get to this in the 7.12.1 release but I have some work to do on EFCore over the next month and might be able to get it out in that. You have just hit a place where there probably is not a unit test to catch a SQL syntax difference between Fb and InterBase.

IB has always supported AS for aliasing table names. This runs fine in IBConsole

select * from employee as e
where e.emp_no > 10

I need more details on this, some sort of example code I can run through a debugger to test.

I have the same issue. My query doesn't run with 'AS', only without.
It WORKS:

SELECT "s"."S_INCKEY" FROM "TABLE" "s"

It DOESN'T:

SELECT "s"."S_INCKEY" FROM "TABLE" AS "s"

Image

Image

Looks like you are using a very old version of InterBase that does not have support for <table> AS <alias>. Are you still using InterBase 2009?

The <table> AS <alias> syntax support was added in InterBase 2017, when Derived Tables support was introduced.

Yes, you are right about the old version of IBS.
Unfortunately, I am forced to use it. I am using many different databases and there is an abstract db-independent layer with my own simple query language to access data providers. This layer is using a mapper from provider to translate query to expression and apply to the provider data source. So I really want to lack using dapper to access old ibs db and want to use EF advantage. I started reading source code and maybe there is some advice on what I could change to get the desired result.
Thanks in advance!

Thank everyone. I found simple solution for me.
Now I am using OleDbConnection and just generating where part with Visitor for my query language.