Focal Point
SET ASNAMES not working if using MYSQL database

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/1381057331/m/22610706

March 27, 2009, 10:38 AM
<Allen Richardson>
SET ASNAMES not working if using MYSQL database
I am using MYSQL database and retrieving the data to be used in WebFOCUS table...my table names are too long to be used in JOIN so used SET ASNAMES to use the duplicate name in the Join but its not getting recognized.

I would be happy if someone can help me out.

THanking you
March 29, 2009, 02:35 AM
Michael L. Meagher
Could you send a snippet of your code? I am not sure how you are using ASNAMES as a file name substitute for a join?


In FOCUS since 1980

March 31, 2009, 03:29 AM
<Allen Richardson>
quote:
Originally posted by Allen Richardson:
 SET ASNAMES=ON
SQL MYSQL
  SELECT
    T1.idRoute   AS 'ID',
    T1.Name       AS 'ROUTENAME',
    T2.Description   AS 'DESCRIPTION',
    FROM ROUTE_TAB  T1 LEFT OUTER JOIN CHANNEL T2
    ON T1.idRoute = T2.idRoute
  END
-RUN
TABLE FILE SQLOUT
  PRINT *
  BY ID
  ON TABLE HOLD FORMAT FOCUS INDEX 'ID'
END 


Getting the error that it not recognize the ID.

I'm sure whether the SET ASNAMES affect the SQL query.

This message has been edited. Last edited by: <Allen Richardson>,
March 31, 2009, 08:15 AM
<Allen Richardson>
Gave the orignal name in INDEX its working fine now...Its not recognizing the Asnames Smiler
June 15, 2009, 04:44 PM
Frans
ASNAMES only works with TABLE requests. It helps to store fields with a certain name.

Next time you could try to put ?FF in your code. Then you see the exact names and aliases.


Test: WF 8.2
Prod: WF 8.2
DB: Progress, REST, IBM UniVerse/UniData, SQLServer, MySQL, PostgreSQL, Oracle, Greenplum, Athena.