In an effort to make this query work on more than just MySQL (and PostgreSQL?), I've adjust it a bit to work with all of the above + SQL Server (MSSQL). Stupid MSSQL requires that the length of the substring you want be specified, so I added the third (optional with MySQL and PostgreSQL) parameter (LEN(column)-30)... Make sense?

Comments

wim leers’s picture

Title: Adjsut SUBSTR() SQL Query to Provide More DB Support » Adjust SUBSTR() SQL query to provide more DB support
Version: 5.x-3.x-dev » 6.x-3.x-dev
Status: Active » Fixed
StatusFileSize
new981 bytes
new993 bytes

The query was incorrect, the LEN(column) - 30 part is wrong. It simply didn't work. Setting it fixed to 3 works, and allows for 999 vocabularies, which should be sufficient. I only tested in MySQL.

Tested and found working in D5 and D6. New patches attached. Committed: http://drupal.org/cvs?commit=239138 and http://drupal.org/cvs?commit=239140.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.