Author |
Topic |
Tomsriv
Starting Member
5 Posts |
Posted - 2013-01-31 : 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.lmabrepselect 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 Stylefrom htedta.ut550ap, Where htedta.ut550ap.utlcid = htedta.lmabrep.abaucd |
|
jackv
Master Smack Fu Yak Hacker
2179 Posts |
Posted - 2013-01-31 : 13:41:36
|
what happens if you run the first step on its ownselect abaucd as LocID, abbdnb, abbenb from htedta.lmabrepJack Vamvas--------------------http://www.sqlserver-dba.com |
|
|
James K
Master Smack Fu Yak Hacker
3873 Posts |
Posted - 2013-01-31 : 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 Stylefrom htedta.ut550ap, htedta.lmabrepWhere htedta.ut550ap.utlcid = htedta.lmabrep.abaucd |
|
|
Tomsriv
Starting Member
5 Posts |
Posted - 2013-01-31 : 14:15:50
|
I tried both ways and it tells me "Keyword Select Not Expected" |
|
|
James K
Master Smack Fu Yak Hacker
3873 Posts |
Posted - 2013-01-31 : 14:20:09
|
What environment are you running this query in? |
|
|
Tomsriv
Starting Member
5 Posts |
Posted - 2013-01-31 : 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
5 Posts |
Posted - 2013-01-31 : 14:46:21
|
No luck in ArcCatalog either. Each of these programs seem to need unique syntax. |
|
|
James K
Master Smack Fu Yak Hacker
3873 Posts |
Posted - 2013-01-31 : 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
5072 Posts |
Posted - 2013-01-31 : 15:50:26
|
Looks like you're trying to do a joinselect 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 Stylefrom htedta.lmabrepINNER JOIN htedta.ut550apON htedta.ut550ap.utlcid = htedta.lmabrep.abaucd; |
|
|
Tomsriv
Starting Member
5 Posts |
Posted - 2013-01-31 : 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
Master Smack Fu Yak Hacker
2179 Posts |
Posted - 2013-02-01 : 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 |
|
|
|