Solved

Resolve column ambiguity in Infomaker

Posted on 2010-09-15
4
1,097 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
  • 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

Suggested Solutions

How to Unravel a Tricky Query Introduction If you browse through the Oracle zones or any of the other database-related zones you'll come across some complicated solutions and sometimes you'll just have to wonder how anyone came up with them.  …
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
This video shows setup options and the basic steps and syntax for duplicating (cloning) a database from one instance to another. Examples are given for duplicating to the same machine and to different machines
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…

746 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now