Solved

Resolve column ambiguity in Infomaker

Posted on 2010-09-15
4
1,106 Views
Last Modified: 2013-12-19
After trying to join two tables I'm getting an ambiguity error. As far as I can see, I've used the table name with the column name throughout the query. Is there some way to identify the offending statement?
0
Comment
Question by:clcarlson
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 2

Expert Comment

by:j_coreil
ID: 33686835
Post the SQL and we might can find it. That error typically means that you are referencing a column in the select statement that could come from two or more tables in the from statement.

Select a.First_Name,
           b.First_Name
From   employees a, spouses b
Where a.spouse_id = b.spouse_id;

If you alias the tables make sure you use the alias throughout the query as well.
0
 

Author Comment

by:clcarlson
ID: 33686894
Following is the query. I'm VERY new at this and, unfortunately, don't yet understand a lot of the syntax. I've tried to find a resource on point, but haven't had a lot of luck. Any suggestions would be appreciated. Thanks.

SELECT "GL_TRANSACTION_VIEW"."GLPOSTINGDATE",  
         "GL_TRANSACTION_VIEW"."TIMESTAMP",  
         "GL_TRANSACTION_VIEW"."AFTERCLOSEFLAG",  
         "GL_TRANSACTION_VIEW"."AMOUNT",  
         "GL_TRANSACTION_VIEW"."SOURCENAME",  
         "GL_TRANSACTION_VIEW"."GLACCOUNTID",  
         "GL_TRANSACTION_VIEW"."GLACCOUNTNAME",  
         "GL_TRANSACTION_VIEW"."USERNAME",  
         "GL_PACK".DebitAmt(amount) as "DR",  
         "GL_PACK".CreditAmt(amount) as "CR",  
         DP.Get('Report Date') as ReportDate,  
         DP.Get('ReportTitle') as asTitle,  
         DP.Get('CompanyName') as asCompanyName,  
         Gl_Pack.GetRefNameNoDescr(GL_Transaction_View.GLTrxHdrIdx, GL_Transaction_View.GlTrxSeq) AS REF1 ,  
         "GL_TRANSACTION_VIEW"."SOURCEIDX",
         "CA_TRANSACTION_VIEW"."COSTCENTERNAME",
         "CA_TRANSACTION_VIEW"."PHASENAME"  
    FROM "GL_TRANSACTION_VIEW",
         "CA_TRANSACTION_VIEW"
   WHERE ("GL_TRANSACTION_VIEW"."ACRUCASHTYPE"="CA_TRANSACTION_VIEW"."ACRUCASHTYPE") AND
         ("GL_TRANSACTION_VIEW"."FISCALYEAR"="CA_TRANSACTION_VIEW"."FISCALYEAR") AND
         ("GL_TRANSACTION_VIEW"."FISCALPERIOD"="CA_TRANSACTION_VIEW"."FISCALPERIOD") AND
         ("GL_TRANSACTION_VIEW"."GLPOSTINGDATE"="CA_TRANSACTION_VIEW"."GLPOSTINGDATE") AND
         ("GL_TRANSACTION_VIEW"."USERNAME"="CA_TRANSACTION_VIEW"."USERNAME") AND
         ("GL_TRANSACTION_VIEW"."TIMESTAMP"="CA_TRANSACTION_VIEW"."TIMESTAMP") AND
         ("GL_TRANSACTION_VIEW"."INITIALINSTALLATIONFLAG"="CA_TRANSACTION_VIEW"."INITIALINSTALLATIONFLAG") AND
         ("GL_TRANSACTION_VIEW"."AFTERCLOSEFLAG"="CA_TRANSACTION_VIEW"."AFTERCLOSEFLAG") AND
         ("GL_TRANSACTION_VIEW"."AMOUNT"="CA_TRANSACTION_VIEW"."AMOUNT") AND
         ("GL_TRANSACTION_VIEW"."SOURCEIDX"="CA_TRANSACTION_VIEW"."SOURCEIDX") AND
         ("GL_TRANSACTION_VIEW"."SOURCENAME"="CA_TRANSACTION_VIEW"."SOURCENAME") AND
         ("GL_TRANSACTION_VIEW"."SOURCEID"="CA_TRANSACTION_VIEW"."SOURCEID") AND
         ("GL_TRANSACTION_VIEW"."GLTRXHDRIDX"="CA_TRANSACTION_VIEW"."GLTRXHDRIDX") AND
         ("GL_TRANSACTION_VIEW"."GLTRXSEQ"="CA_TRANSACTION_VIEW"."GLTRXSEQ")
ORDER BY "GL_TRANSACTION_VIEW"."GLACCOUNTID" ASC,
                  "GL_TRANSACTION_VIEW"."GLACCOUNTNAME" ASC,
                  "GL_TRANSACTION_VIEW"."GLPOSTINGDATE" ASC,
                  "GL_TRANSACTION_VIEW"."TIMESTAMP" ASC
0
 
LVL 20

Accepted Solution

by:
flow01 earned 500 total points
ID: 33686961
the amount in
          "GL_PACK".DebitAmt(amount) as "DR",  
         "GL_PACK".CreditAmt(amount) as "CR",  
is not qualified
    change to  
         "GL_PACK".DebitAmt( GL_TRANSACTION_VIEW.amount) as "DR",  
         "GL_PACK".CreditAmt(GL_TRANSACTION_VIEW.amount) as "CR",  
0
 

Author Closing Comment

by:clcarlson
ID: 33687004
AWESOME! You're hired. Thanks very much.
0

Featured Post

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Background In several of the companies I have worked for, I noticed that corporate reporting is off loaded from the production database and done mainly on a clone database which needs to be kept up to date daily by various means, be it a logical…
Shell script to create broker configuration file using current broker Configuration, solely for purpose of backup on Linux. Script may need to be modified depending on OS-installation. Please deploy and verify the script in a test environment.
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
This video explains at a high level about the four available data types in Oracle and how dates can be manipulated by the user to get data into and out of the database.
Suggested Courses

615 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question