473,322 Members | 1,431 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

getting error which says to create unique aliases for duplicate fields

154 100+
Hi I am trying to get my query to work in my middleware which piggybacks off of the mssql driver using jdbc.
Anyway, The query gets this error when i run in it the middleware
ERROR: Failed to create input and/or output schema(s): "Duplicate field name found 'NAME', please modify the query and create unique aliases for duplicate fields""


The query otherwise runs fine in the microsoft SQL client in the studio
This is the query I am trying to run.
Could someone help me on how to create unique aliases for duplicate fields or if you could modify the query so i could see how you did it or give an example. This would be helpful.

Expand|Select|Wrap|Line Numbers
  1. SELECT DISTINCT (RNP_DOCUMENT_TYPES.NAME),
  2. RNP_FIELDS.NAME,
  3. RNP_DOCUMENT_TYPE_FIELDS.IS_KEYWORD_FLAG,
  4. RNP_DOCUMENT_TYPE_FIELDS.IS_ONBASE_KEYWORD_FLAG,
  5. RNP_DOCUMENT_TYPE_FIELDS.IS_REQUIRED_FLAG,
  6. RNP_DOCUMENT_TYPE_FIELDS.SEQUENCE,
  7. RNP_DOCUMENT_TYPE_FIELDS.IS_IMAGE_FLAG
  8.   FROM 
  9.   RNP_DOCUMENT_TYPE_FIELDS,
  10.   RNP_DOCUMENT_TYPES,
  11.   RNP_FIELDS 
  12.   WHERE 
  13.   RNP_DOCUMENT_TYPES.DOCUMENT_TYPE_ID=RNP_DOCUMENT_TYPE_FIELDS.DOCUMENT_TYPE_ID and 
  14.   RNP_DOCUMENT_TYPE_FIELDS.FIELD_ID=RNP_FIELDS.FIELD_ID
  15.   and RNP_DOCUMENT_TYPES.NAME='BOL'
  16.   ORDER BY 
  17.   RNP_DOCUMENT_TYPE_FIELDS.SEQUENCE ASC
  18.  
Dec 10 '11 #1
2 2149
Rabbit
12,516 Expert Mod 8TB
You have two fields in your result set with the same name. You need to use an alias.
Expand|Select|Wrap|Line Numbers
  1. SELECT someField AS someField1, someField AS someField2
  2. FROM someTable
Dec 11 '11 #2
jonathan184
154 100+
Thanks your help was greatly appreciated. It works fine now.
Dec 11 '11 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: Craig | last post by:
When trying to create a new project on a new install of .NET 2003 I get the following error Error says Web server in not running asp.net 1.1 But I look in the administrative tools and it says...
3
by: IMS.Rushikesh | last post by:
Hi Friends, My work is stuck up because of this unresolvable and unbelievable Error. I'm trying to Serialize my Class object using XmlSerialization. And at below line, I m getting "error File...
2
by: Alicia | last post by:
Does anyone know why I am getting a "Syntax error in Create Table statement". I am using Microsoft Access SQL View to enter it. Any other problems I may run into? CREATE TABLE weeks (...
8
by: Rod | last post by:
I have been working with ASP.NET 1.1 for quite a while now. For some reason, opening some ASP.NET applications we wrote is producing the following error message: "The Web server reported...
3
by: rudodoo | last post by:
My company uses coldfusion to create web applications and we currently are using TOAD as a front end to creating SQL queries. I was wondering how is Access compared to TOAD on its ability to...
0
by: maheshwari.sumit | last post by:
Hi, I am getting error Error: File /default/default.asp CreateObject Exception. The CreateObject of '(null)' caused exception C0000005, when i trying to create an object of component. This...
5
by: Archana | last post by:
Hi all, I am having application where i am downloading xml content using webrequest. my code is as below HttpWebRequest lWebRequest = (HttpWebRequest) WebRequest.Create(URL); HttpWebResponse...
8
by: Yew12 | last post by:
Hi, The following code is supposed to stop a booking being made if falls between another bookings start and end date. Unfortunately I get the following error message PLS-00410: duplicate...
0
by: =?Utf-8?B?UmF2aQ==?= | last post by:
Hi, I have WCF service and integrated with STS (WS-Federation). The Service exposes 5 endpoints Win, UNT and Federated Windows, Federated UNT and Mex endpoint. My STS Service exposes 3 endpoints...
6
by: Alvin SIU | last post by:
Hi all, I have a table in Db2 v8 like this: Team Name Role ------ -------- --------------------- A Superman Leader A Batman Member A WonderWoman Member B ...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.