| Author |
Topic  |
|
|
Tomsriv
Starting Member
USA
5 Posts |
Posted - 01/31/2013 : 12:53:08
|
Greetings all, I am trying to pull and join some fields from an AS400 database into another program that will create points and a table. First off, I want to know if their is a problem in my syntax. From what I have read this is how to use select, but something isn't working. I get errors like "Keyword SELECT not expected." Can anyone help me troubleshoot?
select abaucd as LocID, abbdnb, abbenb from htedta.lmabrep select utmtr as SerialNo, uttms as Type, utinmm as Month, utindd as Day, utinyy as Year, utmrmk as Remarks, utregs as registers, utmmke as Make, utmszc as Size, utstyl as Style from htedta.ut550ap, Where htedta.ut550ap.utlcid = htedta.lmabrep.abaucd
|
|
|
jackv
Flowing Fount of Yak Knowledge
United Kingdom
1765 Posts |
Posted - 01/31/2013 : 13:41:36
|
what happens if you run the first step on its own
select abaucd as LocID, abbdnb, abbenb from htedta.lmabrep
Jack Vamvas -------------------- http://www.sqlserver-dba.com |
 |
|
|
James K
Flowing Fount of Yak Knowledge
1481 Posts |
Posted - 01/31/2013 : 13:57:21
|
As for the second query, I don't know the AS 400 syntax, but I think you need to list the second table as well.select utmtr as SerialNo, uttms as Type, utinmm as Month, utindd as Day, utinyy as Year,
utmrmk as Remarks, utregs as registers, utmmke as Make, utmszc as Size, utstyl as Style
from htedta.ut550ap, htedta.lmabrep
Where htedta.ut550ap.utlcid = htedta.lmabrep.abaucd |
 |
|
|
Tomsriv
Starting Member
USA
5 Posts |
Posted - 01/31/2013 : 14:15:50
|
| I tried both ways and it tells me "Keyword Select Not Expected" |
 |
|
|
James K
Flowing Fount of Yak Knowledge
1481 Posts |
Posted - 01/31/2013 : 14:20:09
|
| What environment are you running this query in? |
 |
|
|
Tomsriv
Starting Member
USA
5 Posts |
Posted - 01/31/2013 : 14:39:59
|
| The environment is called Looking Glass Geomanager. I'll see if I can do a similar query in ArcGIS ArcCatalog. |
 |
|
|
Tomsriv
Starting Member
USA
5 Posts |
Posted - 01/31/2013 : 14:46:21
|
| No luck in ArcCatalog either. Each of these programs seem to need unique syntax. |
 |
|
|
James K
Flowing Fount of Yak Knowledge
1481 Posts |
Posted - 01/31/2013 : 14:48:20
|
| Most of the expertise on this forum is in Microsoft SQL Server. So if you are writing queries in those platforms, you would get better, faster, and more accurate answers on forums or other venues that have expertise in those platforms. |
 |
|
|
russell
Pyro-ma-ni-yak
USA
4964 Posts |
Posted - 01/31/2013 : 15:50:26
|
Looks like you're trying to do a join
select abaucd as LocID, abbdnb, abbenb,
tmtr as SerialNo, uttms as Type, utinmm as Month,
utindd as Day, utinyy as Year, utmrmk as Remarks,
utregs as registers, utmmke as Make, utmszc as Size,
utstyl as Style
from htedta.lmabrep
INNER JOIN
htedta.ut550ap
ON htedta.ut550ap.utlcid = htedta.lmabrep.abaucd; |
 |
|
|
Tomsriv
Starting Member
USA
5 Posts |
Posted - 01/31/2013 : 15:59:26
|
You may be right James. I should ask in the SQL 2000 forum because I bet that is the language this program needs.
Russel, Thank you for making a very well organized example. I'll see if I can make it work in another program. |
 |
|
|
jackv
Flowing Fount of Yak Knowledge
United Kingdom
1765 Posts |
Posted - 02/01/2013 : 12:56:42
|
Tomsrive - have you attempted to run this code on a different client such as iSeries navigator ?
Jack Vamvas -------------------- http://www.sqlserver-dba.com |
 |
|
| |
Topic  |
|