Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Newbie client/server question, SQLEXEC() syntax for AS40
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Divers
Thread ID:
00125846
Message ID:
00126832
Vues:
26
No, we use SQL Server and Oracle. We've had some inquiries about DB2 and I was just curious.

>(heh, heh...) how do I determine that? Remember I said I'm a non-AS400 type. Everything I know about the AS400 is pulled out of the on-line help for the ODBC driver I'm using (Walldata's Rhumba BTW). If you've got any knowledge to share I'd be more than happy to drain you of some of it :-)
>
>>Are you using DB2?
>>
>>>I found some example code for AS400 sql in the archives. Turns out the SQL needs to reference the library and filename in the following manner:
>>>
>>>'select * from DBASE2.HMPTKMSZ HMPTKMSZ'
>>>
>>>where dbase2 is the library of the file. You then need to repeat the filename (table for us non-AS400 types)
>>>
>>>Strange but it works.
>>>
>>>>Use AERROR right after the sqlexec and look at the error message. That should tell you what's wrong.
>>>>
>>>>>I've just created a connection to an AS400 but I'm having trouble issuing a simple SQLEXEC() to test it out. I'm getting back valid handles when I issue SQLCONNECT(). It appears that it doesn't like the syntax I'm passing in my SQL statement:
>>>>>
>>>>>lnResult=sqlexec(lni, "Select * FROM HMPTKMSZ")
>>>>>
>>>>>where lni is a valid connection handle. HMPTKMSZ is a valid table. I was able to verify that with SQLTABLES(). I tried "SELECT * from BMC2!HMPTKMSZ" where bmc2 is the table qualifier that SQLTABLES() returns, that didn't work either. Does anyone know how to reference a table on the AS400?
"It is an important and popular fact that things are not always what they seem. For instance, on the planet Earth, man had always assumed that he was more intelligent than dolphins because he had achieved so much -- the wheel, New York, wars and so on -- whilst all the dolphins had ever done was muck about in the water having a good time. But conversely, the dolphins had always believed that they were far more intelligent than man -- for precisely the same reasons." - Douglas Adams
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform