Member Login

Username
Password
Forget Password
New Sign Up
Search Forum

Buy Support
Incidents

If you can't find your answer in the FREE PUBLIC QDeveloper Forum, require URGENT Priority Support, or you need to send us private or confidential information:

Click Here
If you can't login and post questions or you are having trouble viewing forum posts:
Click Here
Callback
Support

If you live in USA, UK, Canada, Australia or New Zealand, you can leave us details on your question and request us to call you back and discuss them with you personally  (charges apply).

Click Here
 
Buy Support
Incidents
If you can't find your answer in the FREE PUBLIC QDeveloper Forum, require URGENT Priority Support, or you need to send us private or confidential information:
Click Here

Forum : Conversion functions - STRING, CAST, CONVERTSearch Forum

Forum Home > FlexODBC - ODBC Driver for DataFlex Embedded DBMS > FlexODBC SQL Support Forum

 New Topic 
 
 Post Reply 
[1]  
 Conversion functions - STRING, CAST, CONVERT 
 Author   Message 
  Jackson Gomes 
  
 Group: Members 
 Posts: 2 
 Joined: 2007-07-17 
 Profile
 Posted : 2007-07-17 04:37:49

Hello:

I wonder if Flex/ODBC has support to any of the ODBC conversion functions. In the help file it says there is a STRING fuction, but it does not seems to work properly and I alwatys get the error [FlexODBC] Expected lexical element not found: <identifier>. My Select is below:

select
  cha.bloco as cd_lot,
  cha.cavalete as id_cav,
  cha.chapa as nu_cha,
  mat.descricao as ds_por,
  mat.descr_ingles as ds_eng,
  cha.bloco as cd_lot,
  cha.espessura as vl_esp,
  cha.tipo as id_cla,
  cha.beneficiamento as tp_ben,
  cha.altur_liq as vl_alt_liq,
  cha.compr_liq as vl_com_liq,
  cha.compr_bru as vl_com_bru,
  cha.altur_bru as vl_alt_bru,
  cha.altur_liq * cha.compr_liq as vl_m2_liq,
  cha.altur_bru * cha.compr_bru as vl_m2_bru,
  esp.ft_peso_bruto * altur_liq * compr_liq as vl_pes,
  cha.espessura as vl_esp_real,
  cha.defeito,
  cha.local_defeito,
  def.descricao
from

  (
    estcbene cha inner join tippedra mat on mat.codigo = cha.material
  )
   inner join esposerr esp on esp.espessura = cha.espessura
)
   inner join defeitos def on STRING(def.codigo) = cha.defeito

def.codigo is a INTEGER field...

Any tip will be apreciated. I need to make a decision regarding which Dataflex ODBC driver I will purchase within 3-4 days...

Jackson Gomes

 

  Top 
  Tom 
  6c3c1_sdk-qodbc.gif
 Group: Administrator 
 Posts: 5510 
 Joined: 2006-02-17 
 Profile
 Posted : 2007-07-17 08:11:44

Try:

CONVERT(value_exp, data_type) - The function returns the value specified by value_exp converted to the specified data_type, where data_type is one of the following keywords:

SQL_BIGINT, SQL_BINARY, SQL_BIT, SQL_CHAR, SQL_DATE, SQL_DECIMAL, SQL_DOUBLE, SQL_FLOAT, SQL_INTEGER, SQL_LONGVARBINARY, SQL_LONGVARCHAR, SQL_NUMERIC, SQL_REAL, SQL_SMALLINT, SQL_TIME, SQL_TIMESTAMP, SQL_TINYINT, SQL_TYPE_DATE, SQL_TYPE_TIME, SQL_TYPE_TIMESTAMP, SQL_VARBINARY, SQL_VARCHAR

Example:

SELECT ('0'+ {fn CONVERT(Id, SQL_VARCHAR)}) AS "IDString" From Company

Returns:

IDString

01

 

  Top 
 New Topic 
 
 Post Reply 
[1]  

Jump to