Skip to content
Advertisement

PostgreSQL – I have a Syntax error in my SUBSTRING query

I’m trying to make use of the SUBSTRING() function to extract a substring from vm.location_path, starting at the second character and ending at the position of the ‘]’ character, minus two.

I want to extract the text between the square brackets ([]) in vm.location_path but I’m hitting a syntax error.

It’s between the comma at the end of

and

What am I not seeing?

This is for vCloud Director. I am trying to get a print out of all VMs that are NULL.

Advertisement

Answer

The syntax is POSITION(search_string in main_string) with IN Keyowrd instead of ,

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement