Skip to content

Tag: sql

SAS pass through query to SQL Server

I have some troubles with passing through query to SQL Server. OS is RedHat 6. In SAS Enterprise Guide I try to execute this code: but I faced with error: ERROR: CLI execute error: [SAS][ODBC SQL Server Wire Protocol driver][Microsoft SQL Server]INSERT failed because the following SET options have incorrect s…

How do I access a field of nested user defined types?

How do I access the fields of user defined types when they are nested ? When I tried it using dot notation it failed: For example, how do I “compile” this code ? Trying to run it: Answer Looks like a PL/PgSQL deficiency. In normal SQL you can do so with but pl/pgsql doesn’t accept the same f…

Single result not showing when joining table

I have modified a SQL query in WordPress through a filter for the geomywp plugin so that I can search users by taxonomy and distance. The end query looks like this The term_taxonomy_id changes depending on what category they are searching for. The really weird thing about this is that it only works if there i…

REGEXP_LIKE between number range

Can someone please finalize the code on the below. I only want to look for a 6 digit number range anywhere in the RMK field, between 100000 and 999999 The current code works but is bringing back anything with a number so I’m trying to narrow it down to 6 digits together. I’ve tried a few but no lu…

Update statement SQL with CTE

I have a common table expression that I am using trying to use as an update statement. The only reason for the CTE is so I can use a where clause to filter by CredCount. I would like to use that where clause to update only records that match in this case CredCount of 2. However, I am having trouble