Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request for the functions CHARINDEX and LENGTH #1059

Closed
tikomir opened this issue Sep 27, 2020 · 1 comment
Closed

Feature request for the functions CHARINDEX and LENGTH #1059

tikomir opened this issue Sep 27, 2020 · 1 comment
Assignees

Comments

@tikomir
Copy link

tikomir commented Sep 27, 2020

It seems that only a few String functions have been supported. For example, there are no LENGTH and CHARINDEX functions which I consider essential. Here s an example:

INSERT` INTO Customer (FirstName, LastName, City, Country, Phone)
SELECT LEFT(ContactName, CHARINDEX(' ', ContactName) - 1),
SUBSTRING(ContactName, CHARINDEX(' ', ContactName) + 1, 100),
City, Country, Phone
FROM Supplier
WHERE CompanyName = 'Bigfoot Supplies';
Customer.insert(
     Supplier.slice(
                Supplier.contactName.substring(0, 1), // function CHARINDEX needed here
                Supplier.contactName.substring(0, 2), // function CHARINDEX needed here
                Supplier.city,
                Supplier.country,
                Supplier.phone)
            .select { Supplier.companyName eq "Bigfoot Supplies" },
      columns = listOf(Customer.firstName, Customer.lastName, Customer.city, Customer.country, Customer.phone)
)

As you can see, the column Supplier.ContactName contains name and surname as one string and I want to split them. Is there any way I can do it without CHARINDEX function?

@tikomir tikomir changed the title Function CHARINDEX is missing. Feature request for the function CHARINDEX Sep 27, 2020
@tikomir tikomir changed the title Feature request for the function CHARINDEX Feature request for the function CHARINDEX and LENGTH Sep 27, 2020
@tikomir tikomir changed the title Feature request for the function CHARINDEX and LENGTH Feature request for the functions CHARINDEX and LENGTH Sep 27, 2020
@fedache
Copy link

fedache commented May 20, 2022

@Tapac is this issue still needed ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants