Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Resolve column ambiguity in Infomaker

Posted on 2010-09-15
4
Medium Priority
?
1,108 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 2000 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

Truncate is a DDL Command where as Delete is a DML Command. Both will delete data from table, but what is the difference between these below statements truncate table <table_name> ?? delete from <table_name> ?? The first command cannot be …
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.  …
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 videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

705 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