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

IBO problems with FB >= 1.5.3 "Error with joins and auto-generated search query", how can FB2.x help to solve? [CORE1012] #1422

Closed
firebird-automations opened this issue Nov 22, 2006 · 12 comments

Comments

@firebird-automations
Copy link
Collaborator

firebird-automations commented Nov 22, 2006

Submitted by: Marco Menardi (mmenaz66)

I've posted in the development list, and I've been told to insert here by Adriano dos Santos Fernandes. Here the test of my mail:

Hi, I confess I'm not an "expert", so I don't fully understand the
implication of what I'm reporting, but I'm following Jason Wharton
suggestion to raise the question/problem here.
So I report here below his reply to a problem I've had since 1.5.3.
Thanks a lot
Marco Menardi

----
http://tech.groups.yahoo.com/group/IBObjects/message/40238 (archive)
that is:

This issue is because Firebird 2.0 does not return the relation
alias name, nor a relation name for the columns participating in the
GROUP BY aggregation.

My only resort is to parse the SQL and look for a table alias being
used on the column name, which you are doing, and override what the
server returns so that we can have an accurate query put together
that won't trip up on the ambiguous column problem.

I believe it would be a good idea to raise this issue with the
Firebird development team and challenge them on not returning the
relation alias used.

Jason Wharton

--- In mailto:IBObjects@yahoogroups.com, "Marco Menardi" <mmenaz@...> wrote:
> >
> > IBO 4.6.Aa Firebird 1.5.3, Delphi 6 pro, Windows2000sp4.
> > I have a problem using native IBO controls and the "search" mode
with
> > Firebrid 1.5.3 that is less forgiving about ambiguos field name.
IBO
> > automatically generates a query that has no table qualifier, and if
> > that field is present in both tables I join, I get an error... how
can
> > I avoid it? I've tried setting "KeyRelation" property (I know it's
> > used for upates, but, you know...) or keylinks (but got an
error...)
> > but without success. Any clue?
> > The query is:
> > SELECT FORNITORI.FORNITORE_ID
> > , FORNITORI.DESCRIZIONEDISP
> > , SUM(SCADENZIARIO.TOT_CHIUSO) AS CHIUSO
> > , SUM(SCADENZIARIO.TOT_APERTO) AS APERTO
> > , SUM(SCADENZIARIO.TOT_CHIUSO - SCADENZIARIO.TOT_APERTO) AS
SALDO
> > FROM FORNITORI
> > INNER JOIN SCADENZIARIO ON (FORNITORI.FORNITORE_ID =
> > SCADENZIARIO.FORNITORE_ID)
> > GROUP BY FORNITORI.FORNITORE_ID, FORNITORI.DESCRIZIONEDISP
> >
> > When IBO generates the query searching for FORNITORE_ID value you
have:
> > SELECT FORNITORI.FORNITORE_ID
> > , FORNITORI.DESCRIZIONEDISP
> > , SUM(SCADENZIARIO.TOT_CHIUSO) AS CHIUSO
> > , SUM(SCADENZIARIO.TOT_APERTO) AS APERTO
> > , SUM(SCADENZIARIO.TOT_CHIUSO - SCADENZIARIO.TOT_APERTO) AS
SALDO
> > FROM FORNITORI
> > INNER JOIN SCADENZIARIO ON (FORNITORI.FORNITORE_ID =
> > SCADENZIARIO.FORNITORE_ID)
> > WHERE FORNITORE_ID STARTING 'FF0001'
> > GROUP BY FORNITORI.FORNITORE_ID, FORNITORI.DESCRIZIONEDISP
> > ORDER BY DESCRIZIONEDISP DESC
> >
> >
> > and then, of course, the error:
> > Project ammwine2000.exe raised exception class EIB_ISCError with
> > message 'ISC ERROR CODE:335544569
> > ISC ERROR MESSAGE:
> > Dynamic SQL Error
> > SQL error code = -204
> > Ambiguous field name between table FORNITORI and table SCADENZIARIO
> > FORNITORE_ID
> > '. Process stopped. Use Step or Run to continue.
> >
> > So I need a way to tell IBO to make something like:
> > WHERE FORNITORI.FORNITORE_ID STARTING 'FF0001'
> >
> > Btw, if I set KeyLinks to FORNITORI.FORNITORE_ID and I simply open
the
> > query I get the error:
> > Invalid KeyLinks entry: FORNITORI.FORNITORE_ID.
> >
> > Any help is much apreciated, thanks
> > Marco Menardi

Commits: 7638ffc d2e0434

@firebird-automations
Copy link
Collaborator Author

Modified by: @asfernandes

assignee: Adriano dos Santos Fernandes [ asfernandes ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @asfernandes

Dmitry, should this be backported to V2.0.1?
As this is a regression from V1.5.3 (and not V2) and there are some changes in the function between V2 and HEAD...

@firebird-automations
Copy link
Collaborator Author

Modified by: @asfernandes

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Fixed [ 1 ]

Fix Version: 2.1 [ 10041 ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @dyemanov

Yes, I think it should be backported.

@firebird-automations
Copy link
Collaborator Author

Modified by: @asfernandes

Fix Version: 2.0.1 [ 10090 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

status: Resolved [ 5 ] => Closed [ 6 ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @pcisar

Reopened to update ticket information.

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

status: Closed [ 6 ] => Reopened [ 4 ]

resolution: Fixed [ 1 ] =>

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

Fix Version: 2.1 Alpha 1 [ 10150 ]

Fix Version: 2.1.0 [ 10041 ] =>

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

status: Reopened [ 4 ] => Closed [ 6 ]

resolution: Fixed [ 1 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

Workflow: jira [ 11344 ] => Firebird [ 15423 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

QA Status: No test

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

No branches or pull requests

2 participants