Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Mon, 01 Dec 2003 @ 15:53:39 GMT


     
  <Prev Next>   <<First <Prev Next> Last>>  


Subj:   Re: Inconsistent behaviour of 'Coalesce' function in VB application
 
From:   Dempsey, Mike

As someone else pointer out, Queryman is an ODBC based VB application, so there is nothing inherantly wrong with ODBC/VB.

One posibility is that the ODBC driver is 'playing' with your SQL. ODBC will perform certain conversions to 'standard' SQL unless you tell it not to. In Queryman there is a setting that allows you to control this.

If you dont want ODBC to change your SQL (This also means that you will not be able to use the ODBC SQL Extnsions, or create stored procedures) you can call the ODBC function SQLSetStmtAttr() and set the SQL_NOSCAN parameter to true (1 [C 'True'] not -1 [VB 'True']).

For example:

rc=SQLSetStmtAttr(hStmt, SQL_NOSCAN, 1, 0)


where

SQL_NOSCAN = 2


and

Declare Function SQLSetStmtAttr Lib "odbc32.dll" (ByVal hStmt As Long, ByVal opt As Long, ByVal parm As Long, ByVal Lth As Long) As Integer


The above assumes that you are using the ODBC API directly and that you are using ODBC version 3.x.

If you are using ODBC 2.x then you should use the SQLSetStmtOption() function instead.

Declare Function SQLSetStmtOption Lib "odbc32.dll" (ByVal hStmt As Long, ByVal opt As Integer, ByVal parm As Long) As Integer (Same parameters, just drop the last one.)

If you are using ADO, RDO, etc. they probably have a property you can set. (If not, RDO provides the hStmt (Statement Handle) so you can call the API directly - something you can do with any ODBC API function when using RDO.)


Mike Dempsey
Teradata Client Tools



     
  <Prev Next>   <<First <Prev Next> Last>>  
 
 
 
 
 
 
 
 
  
  Top Home Privacy Feedback  
 
 
Copyright for the TeradataForum (TDATA-L), Manta BlueSky    
Copyright 2016 - All Rights Reserved    
Last Modified: 15 Jun 2023