how to join with IIF function?

Hi I am using MSSQL 2017 and try to figure out how this code works DECLARE @customer TABLE ( credithold bit, id int primary key, deliverycityID int, postalcityID int ) DECLARE @city TABLE ( cityid int primary key, pop bigint ) INSERT INTO @city VALUES (1,2666),(2,7889),(3,28917) INSERT INTO @customer VALUES(1,1,2,1),(0,2,3,2),(1,3,1,3),(0,4,2,3) SELECT c1.id, pop, IIF(credithold =…

Details

Proper way to read files asynchronously

I’m trying to read files asynchronously. I was wondering if this is a proper way to do so. Below is what I have tried so far. Is this correct? static void Main(string[] args) { Task<string> readFileTask = Task.Run(() => ReadFile(@”C:\Users\User\Desktop\Test.txt”)); readFileTask.Wait(); string astr = readFileTask.Result; Console.WriteLine(astr); } static private async Task<string> ReadFile(string filePath) { string…

Details

Can’t run rmarkdown on Amazon Linux 2 due to Pandoc not available

I’m using Amazon Linux 2, t2.large. I understand the reason why I could not run rmarkdown::run() is because pandoc was not installed/configured correctly. After Googling for hours, I tried Sys.getenv(“RSTUDIO_PANDOC”) (empty result); I tried rmarkdown not working due to pandoc, but apt-get was not found; I tried downloading pandoc and move pandoc and pandoc-citeproc to…

Details

WKT linestring to SDO_GEOMETRY: Why are there so many nulls?

I have a well-known text (WKT) linestring that I want to convert to SDO_GEOMETRY: select sdo_geometry( ‘LINESTRING(675939.0 4861635.0, 675881.8 4861589.9)’ ,300001) as sdo from dual SDO ——————————————————————————– SDO_GEOMETRY(2002,300001,NULL,MDSYS.SDO_ELEM_INFO_ARRAY(1,2,1,NULL,NULL,NULL,NUL L,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NUL L,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NUL L,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NUL L,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NUL L,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NUL L,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),MDSYS.SDO_OR DINATE_ARRAY(675939,4861635,675881.8,4861589.9,NULL,NULL,NULL,NULL,NULL,NULL,NUL L,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NUL L,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NUL L,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NUL L,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NUL L,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NUL L,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL)) 1 row selected. Why does the resulting SDO_GEOMETRY have so many nulls and can…

Details