Skip to Content (Press Enter)
OutSystems.com
Personal Edition
Community
Support
Training
Training
Online Training
Developer Schools
Boot Camps
Certifications
Tech Talks
Documentation
Documentation
Overview
ODC
O11
Forums
Forge
Get Involved
Get Involved
Jobs
Ideas
Members
Mentorship
User Groups
Platform
Platform
ODC
O11
Search in OutSystems
Log in
Get Started
Back to Forums
Nuno Bairro
368
Views
7
Comments
Advanced query in Linked Server entitie
Question
Hello,
I'm having some problems with a advanced query made on a Entitie that comes from a linked server.
select Loja, sum({SalesReportData}.[QuantidadeVendida])
From {SalesReportData}
very simple query but the result is:
"Error in advance query GetTotalVendas": The multi-part identifier "AliasServer" could not be bound."
Normal querys work fine...but the advanced ones don´t can some one provide help?
Thx
NB
Nuno Bairro
Reply to myself...
I found the problem...
The problem is that Sql server only accepts 4 names to extrapulate from a Data base.
example:
server.database.table.colum <- this is the max
Im my case I was using -> server.database.schema.table.colum
this produces the error...
The solution?! well I iam still triyng possible ones one of those is using Alias .
Nuno Bairro
This forum is great...no one helps !! great!!!
Paulo Tavares
Staff
Hi Nuno, and welcome back to the OutSystems community forums, after a 1 year of hiatus. It's good to still have you with us.
From the impression I get from this specific thread, you were on your way into studying alternatives about how to do what you wanted to.
Specifically, there is one thing that usually happens in forums, though: people usually only reply if they have gone through the problem you are going through. It's not that people don't want to help, but it's just that people don't know how to help you with your specific case! :)
That being said, however, what's the status of your current problem? Do let us know, and let's see if someone knows a better way to do what you're trying to do.
Regards,
Paulo Tavares
Bruno Cavaco
Hi Nuno,
you have two approaches:
1. create alias for tables in advanced queries:
select sum(sales.[QuantidadeVendida])
From {SalesReportData} sales
2. Create synonyms for each table on database and update field
physical_table_name
in Extension
sales_synonym
= server.database.schema.SalesReportData
So
physical_table_name
of SalesReportData looks like this:
sales_synoym
Regards,
Bruno Cavaco
asmaa gad
Hi Nuno,
this error happend with me too that's because i use the colum name in filter but i forget to put the tabel name in jion in from cluase so after i put it it work with me .
ex of my old version of code :
select * from table1 where table2.id=9
the solution put table2 in from :
select * from table1 inner join tabel2 on tabel1.id=table2.code where table2.id=9
Regards,
Asmaa Gad
Mark Cowan
Two things to look at for this problem are:
1. Have you joined the
AliasServer table into your query? If you are using an Aggregate you need to bring in the AliasServer table as a source. Double click the Get
SalesReportData
icon, then click sources and drop & drop an AliasServer entity from under the Data tab.
If you are using SQL (which I think
Nuno Bairro
is
) then you need something like:
INNER JOIN {AliasServer} ON {AliasServer}.[myUniqueData] = {SalesReportData}.[myUniqueData]
OR
2. The error says "
The multi-part identifier "AliasServer". I've had this error a few times when I started using SQL with OutSystems. I was mistakenly having only {MyTableName}
.*
or even just
{MyTableName}
I wasn't including which column to look in. I needed something like
{MyTableName} .[productID]
oDevFagundes
Champion
Using Advance Query Extension. Any questions let me know. https://www.outsystems.com/forge/component/1305/advancequery/
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
See the full guidelines
Loading...