Focal Point Banner
Community Center Education Summit Technical Support User Groups
Let's Get Social!

Facebook Twitter LinkedIn YouTube
Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] column names in sql passthru upper/lower case
Go
New
Search
Notify
Tools
Reply
  
[SOLVED] column names in sql passthru upper/lower case
 Login/Join
 
Platinum Member
posted
We are migrating from DB2 database to SQL Server, actually to Azure SQL through MSODBC adapter.
An issue we are facing is that our sql passthru behaves differently in column names. Often our sql passthru is written in lower case, like
SQL DB2
select column1 from table1
;
TABLE FILE SQLOUT
PRINT *
ON TABLE HOLD AS HOLD000
END
-RUN

With DB2 passthru we could afterwards give an uppercase TABLE request:
TABLE FILE HOLD000
PRINT COLUMN1
END

Changing it to MSODBC it now gives error
(FOC258) FIELDNAME OR COMPUTATIONAL ELEMENT NOT RECOGNIZED: COLUMN1

If I change it to lowercase column1 it works.
It would be quite a work changing the sql passthru everywhere to uppercase, so I wondered is there somewhere an adapter setting to arrange that it returns upper case column names, or at least as an alias? Or would someone have a different (easy) solution

Martin.

This message has been edited. Last edited by: FP Mod Chuck,


WebFocus 8203M, iWay DataMigrator, Windows, DB2 Windows V10.5, MS SQL Server, Azure SQL, Hyperstage, ReportCaster
 
Posts: 152 | Registered: March 29, 2013Reply With QuoteReport This Post
Platinum Member
posted Hide Post
For DB2 the ?FF HOLD000 gives:
FILENAME= HOLD000
COLUMN1 E01 A20

For MSODBC the ?FF HOLD000 gives:
FILENAME= HOLD000
column1 E01 A20

I think I also know the reason. It does not have to do with WebFocus and adapter settings. But DB2 is not case sensitive (at least not our installation) and in SQL Server we do use a case sensitive collation. And especially in migrating our database views, which are mainly defined in lower case create view scripts, SQL server has created column names in lower cases, whereas DB2 had made them uppercase column names.

Nevertheless is there some setting I can tell WebFocus or the MSODBC adapter that with sql passthru it should Always return upper case field names?


WebFocus 8203M, iWay DataMigrator, Windows, DB2 Windows V10.5, MS SQL Server, Azure SQL, Hyperstage, ReportCaster
 
Posts: 152 | Registered: March 29, 2013Reply With QuoteReport This Post
Virtuoso
posted Hide Post
Yeah I just tested it in SQL Server and the default is to create the hold master files with mixed case column names. I don't see any settings in the adapter manual that'll let you change that. Is creating the SQL Server tables with uppercase column names an option? I know that's a crazy question but if this is a migration from one system to another, then wouldn't it be reasonable to have identical DDLs for all the SQL tables in the target platform so you don't have to remediate all the code?


WebFOCUS 8206, Unix, Windows
 
Posts: 1659 | Location: New York City | Registered: December 30, 2015Reply With QuoteReport This Post
Virtuoso
posted Hide Post
I haven't tested this but maybe you could work around the problem using SET ASNAME. Check out the doc for the behaviors you can get out of it. Might be worth a test.

https://webfocusinfocenter.inf...ang/source/out94.htm


WebFOCUS 8206, Unix, Windows
 
Posts: 1659 | Location: New York City | Registered: December 30, 2015Reply With QuoteReport This Post
Virtuoso
posted Hide Post
quote:
Originally posted by Martin vK:
in SQL Server we do use a case sensitive collation.


Apparently, in SQL server, identifier case sensitivity is an optional server feature and this can be queried. Possibly, the WF adapter uses that information to decide how to behave.

If possible, test what happens if you turn off SQL server's case sensitivity.

quote:

SQL server has created column names in lower cases, whereas DB2 had made them uppercase column names.


That's not entirely accurate. DB2 column names are case insensitive. They "fold" to upper case when presented, but you can address them in any case, upper, lower or mixed.


WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010
: Member of User Group Benelux :
 
Posts: 1643 | Location: Enschede, Netherlands | Registered: August 12, 2010Reply With QuoteReport This Post
Platinum Member
posted Hide Post
I can not change the case sensitivity in SQL Server, that is not my decision, I have to live with that.

We did find a way to get around it, preventing we have to change all our sql passthru. We made following standard routine to add define's in upper case.
-DEFAULTH &SQLOUT_HOLDFILE = 'HOLD000';

CHECK FILE &SQLOUT_HOLDFILE HOLD AS TEMPHOLD

FILEDEF INCLUDE_DEFINE DISK include_define.fex (APPEND
-RUN

-WRITE INCLUDE_DEFINE DEFINE FILE &SQLOUT_HOLDFILE ADD

TABLE FILE TEMPHOLD
  PRINT
    COMPUTE LINE/A1200 = UPPER(FIELDNAME) || '/' || FORMAT || '=' || FIELDNAME || ';' ;
  ON TABLE HOLD AS INCLUDE_DEFINE FORMAT ALPHA
  ON TABLE SET HOLDLIST PRINTONLY
END
-RUN

-WRITE INCLUDE_DEFINE END
-RUN

-INCLUDE include_define

We can include this fex where we need it.


WebFocus 8203M, iWay DataMigrator, Windows, DB2 Windows V10.5, MS SQL Server, Azure SQL, Hyperstage, ReportCaster
 
Posts: 152 | Registered: March 29, 2013Reply With QuoteReport This Post
  Powered by Social Strata  
 

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] column names in sql passthru upper/lower case

Copyright © 1996-2018 Information Builders, leaders in enterprise business intelligence.