SQL query: maximum of 257 columns increased to 512

Discussion forum about all things Team Developer 5.x and 6.x
Dave Rabelink
Founder/Site Admin
Founder/Site Admin
Netherlands
Posts: 3384
Joined: 24 Feb 2017, 09:12
Location: Gouda, The Netherlands

SQL query: maximum of 257 columns increased to 512

Post by Dave Rabelink » 08 May 2017, 05:41

I have totally missed this in the release notes, but we accidentally stumbled upon this in TD7.0.
The maximum number of bind/into variables in a SQL statement has been increased to 512 (previous limit was 257).
Registered as:

TD-23228: There is a limit of 257 variables that can be used in a select.


This enhancement is introduced in TD 6.3 SP2 UPD2 and is also present in TD 7.0.

A testcase is attached. It holds SQL script (Oracle) to create the needed table.
The testcase tries to select > 256 columns and will give SQL error or truncated data on previous versions.

Columns_max.zip
You do not have the required permissions to view the files attached to this post.
Regards,
Dave Rabelink

Image
Articles and information on Team Developer Tips & Tricks Wiki
Download samples, documents and resources from TD Sample Vault
Videos on TDWiki YouTube Channel

sudhakarulk
India
Posts: 1
Joined: 23 May 2018, 09:19
Location: Chennai

Re: SQL query: maximum of 257 columns increased to 512

Post by sudhakarulk » 23 May 2018, 09:48

Hi Dave,

We are trying to fetch 257 columns , however it's not working in TD4.2. What is the limit in TD4.2?

Regards,
Sudhakar G

Dave Rabelink
Founder/Site Admin
Founder/Site Admin
Netherlands
Posts: 3384
Joined: 24 Feb 2017, 09:12
Location: Gouda, The Netherlands

Re: SQL query: maximum of 257 columns increased to 512

Post by Dave Rabelink » 23 May 2018, 11:33

My guess it is 255.
Regards,
Dave Rabelink

Image
Articles and information on Team Developer Tips & Tricks Wiki
Download samples, documents and resources from TD Sample Vault
Videos on TDWiki YouTube Channel

landaware
Italy
Posts: 31
Joined: 30 Jul 2017, 18:27
Location: Italy

Re: SQL query: maximum of 257 columns increased to 512

Post by landaware » 03 May 2022, 03:58

How can be solved in ctd30?

FRBhote
India
Posts: 2206
Joined: 09 Mar 2017, 05:32
Location: Hyderabad, India

Re: SQL query: maximum of 257 columns increased to 512

Post by FRBhote » 03 May 2022, 05:23

Two selects I suppose.

Dave Rabelink
Founder/Site Admin
Founder/Site Admin
Netherlands
Posts: 3384
Joined: 24 Feb 2017, 09:12
Location: Gouda, The Netherlands

Re: SQL query: maximum of 257 columns increased to 512

Post by Dave Rabelink » 03 May 2022, 09:07

You can also concat column values using delimiter in SQL statement and unravel the value back to the column values after fetch to reduce direct column count.
Regards,
Dave Rabelink

Image
Articles and information on Team Developer Tips & Tricks Wiki
Download samples, documents and resources from TD Sample Vault
Videos on TDWiki YouTube Channel

Return to “General Discussion”

Who is online

Users browsing this forum: [Ccbot] and 1 guest