Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Comparing VARG and VARCHAR

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
gylbharat

Active Member


Joined: 31 Jul 2009
Posts: 565
Location: Bangalore

PostPosted: Mon Dec 03, 2012 1:32 pm    Post subject: Comparing VARG and VARCHAR
Reply with quote

Hi,

I want to join two tables...

Say TableA, TableB.

Columns of TableA

C1 SMALLINT
C2 VARG(16)


Columns of TableB
C1 SMALLINT
C2 VARCHAR(40)

I have the below query.

Select * from TableA, TableB
where TableA.C2 = TableB.C2.

I want to know will there be any performance overhead in this case?
Back to top
View user's profile Send private message

dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Mon Dec 03, 2012 8:28 pm    Post subject:
Reply with quote

Hello,

How many rows are in the tables?

How are the keys defined for these tables?

How might a graphic value be equal to a varchar value?
Back to top
View user's profile Send private message
gylbharat

Active Member


Joined: 31 Jul 2009
Posts: 565
Location: Bangalore

PostPosted: Tue Dec 04, 2012 10:48 am    Post subject:
Reply with quote

As of now I am not sure on the number of rows... Keys/Indexes are defined on different columns....

Varchar in Unicode can accommodate 1,2,3 byte char and Vargraphic is 2 byte char set.

I tried matching few rows, they were matching.... I think DB2 does implicit type conversion here.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Tue Dec 04, 2012 9:14 pm    Post subject:
Reply with quote

Hello,

I suspect that if the WHERE has keys that are the same to match on, there would be little or no performance degredation (other than, of course, sheer volume.

Good luck, and we'd be interested to hear about how it goes icon_wink.gif
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Comparing Decimal and CHAR columns rakesh17684 DB2 7 Thu Oct 20, 2016 2:33 am
No new posts Low values Results from VARCHAR FORMAT balaji81_k DB2 10 Thu Oct 20, 2016 1:18 am
No new posts comparing comp-3 and unpacked numbers juares castro COBOL Programming 3 Mon May 30, 2016 6:46 pm
No new posts Need help on comparing hexadecimal va... ashok_uddaraju DFSORT/ICETOOL 4 Thu Apr 28, 2016 2:08 am
No new posts Only text from varchar Seppe DB2 8 Thu Apr 21, 2016 10:42 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us