Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

InterBaseSQL.EntityFrameworkCore.InterBase issue #6

Open
tramesh2009 opened this issue Nov 23, 2021 · 8 comments
Open

InterBaseSQL.EntityFrameworkCore.InterBase issue #6

tramesh2009 opened this issue Nov 23, 2021 · 8 comments

Comments

@tramesh2009
Copy link

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

@ulrich-berkmueller
Copy link

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

@OlivierLePichon
Copy link

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.

@jeffovercash
Copy link
Collaborator

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.

@flrizzato flrizzato pinned this issue Oct 27, 2022
@flrizzato flrizzato unpinned this issue Oct 27, 2022
@jeffovercash
Copy link
Collaborator

jeffovercash commented Mar 25, 2023

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.

@YiehraiS
Copy link

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

@bsriramIdera
Copy link
Collaborator

bsriramIdera commented Feb 12, 2025

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.

@YiehraiS
Copy link

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!

@YiehraiS
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants