Other – ScottGeek Technology https://scottgeek.technology Tue, 10 Oct 2023 01:21:31 +0000 en-US hourly 1 https://wordpress.org/?v=6.9.4 https://scottgeek.technology/2023/10/09/5476-2/ https://scottgeek.technology/2023/10/09/5476-2/#respond Tue, 10 Oct 2023 01:21:31 +0000 https://scottgeek.technology/?p=5476 I’m  back! Well mostly…

ScottGeek

]]>
https://scottgeek.technology/2023/10/09/5476-2/feed/ 0
Happy Holidays to Everyone https://scottgeek.technology/2022/12/26/happy-holidays-to-everyone/ https://scottgeek.technology/2022/12/26/happy-holidays-to-everyone/#respond Mon, 26 Dec 2022 15:44:57 +0000 https://scottgeek.technology/?p=5456 It’s been a very season the last couple of months… and I’ve not been able to get back to blogging like I’ve wanted to…

So now, I’ve got a crap load of topics I want to write about… Indeed yes. Time to spend a few hours a day getting my list up and going.

~SG

 

]]>
https://scottgeek.technology/2022/12/26/happy-holidays-to-everyone/feed/ 0
Behind on posting, Yes I know https://scottgeek.technology/2022/08/24/behind-on-posting-yes-i-know/ https://scottgeek.technology/2022/08/24/behind-on-posting-yes-i-know/#respond Wed, 24 Aug 2022 22:29:30 +0000 https://scottgeek.technology/?p=5447 So, yes I’ve not been posting as much. It’s been a very busy time with doing some Raspberry PI things… teeth problems… you know the normal stuff where posting kind of falls off a bit. Oh, yeah… I’ve also been working at moving over one of my sites to Blazor (that should be interesting considering how mush I dislike CSS).

Ok, I’ll be back soon..

~SG

 

]]>
https://scottgeek.technology/2022/08/24/behind-on-posting-yes-i-know/feed/ 0
Autumn 2021 https://scottgeek.technology/2021/09/21/autumn-2021/ https://scottgeek.technology/2021/09/21/autumn-2021/#respond Wed, 22 Sep 2021 00:06:58 +0000 https://scottgeek.technology/?p=5363 ….

Welcome Autumn!

….

]]>
https://scottgeek.technology/2021/09/21/autumn-2021/feed/ 0
DB2 SQL Update on Joined Tables https://scottgeek.technology/2020/10/22/db2-sql-update-on-joined-tables/ https://scottgeek.technology/2020/10/22/db2-sql-update-on-joined-tables/#respond Thu, 22 Oct 2020 14:22:49 +0000 https://scottgeek.technology/?p=5240 From time to time I have to deal with my least favorite subjects like DB2. While DB2 has a functional SQL, it’s dated and has not really kept up with SQL language improvements over the years. But it is all that I have to flow data from the IBM AS400 to the outside world (** it could be worst… like dealing with old COBOL programs).

So  lets talk about updating column values that involve more that one table. Yeah, joined tables that have to have one or more columns updated.  Why would one need to do this? From time to time one needs to collect batches of rows from more than one table. And in the process of collecting batches one needs to update a “status” and/or date time stamp column to indicate the row was collected. It’s a common pattern in system integrations. When only one table is involved, it’s a simple matter. But when the data collected involves joined tables, then matters get complicated.

Getting right to it, here’s the general form:

Update <Table1>
 SET <StatusColumn> = 1 Where
  (Select DISTINCT
    <Table1>.ColumnA,
    <Table1>.ColumnB,
    <Table1>.ColumnC
    From <Table1> <Tabel2>
    Where
     <Table1>.ColumnA = <Table2>.ColumnA1 AND
     <Table1>.ColumnB = <Table2>.ColumnB1 AND
     <Table1>.ColumnC = <Table2>.ColumnC1
   )

The two tables, in our example, have three columns we are Joining on… note this is an implicit join where the actual Join statement is not used.

This update statement is a normal way to handle updating a column with a join select in the where. But this goes off the rails when it comes to DB2. Meaning it does not work. So how does one fix this?

 

Update <Table1> 
 SET <StatusColumn> = 1 Where 
  (ColumnA, ColumnB, ColumnB) IN 
   (Select DISTINCT 
     <Table1>.ColumnA, 
     <Table1>.ColumnB, 
     <Table1>.ColumnC 
     From <Table1> <Tabel2> 
     Where 
      <Table1>.ColumnA = <Table2>.ColumnA1 AND
      <Table1>.ColumnB = <Table2>.ColumnB1 AND 
      <Table1>.ColumnC = <Table2>.ColumnC1
    )

One adds to the Update Where clause a set of columns whose values are IN the Select of the joined tables. Like I said matters get a bit complicated for Joined tables.

So what happens in the first type of Update in DB2? It does execute, but it updates all rows in the table to the Set value. This happens because, why the Join Select does execute, there’s nothing in DB2 that allows it to be an implicit part of the Update’s Where clause. Yeah, got to love that! What is one really saying there?

The Where clause of the Update, in DB2, does not allow one to do just a Select… like other SQL implementations. It’s a hidden flaw, because while it looks to execute without an error, it simply does not do the intent. Therefore, one has to explicitly make sure that the Rows selected in the Where clause are part of the Update. Hence, the (columns) IN.

Yes, as I mentioned, DB2 SQL not amongst my favorite languages to deal with.

~SG

]]>
https://scottgeek.technology/2020/10/22/db2-sql-update-on-joined-tables/feed/ 0
Working From Home https://scottgeek.technology/2020/03/18/working-from-home/ https://scottgeek.technology/2020/03/18/working-from-home/#respond Wed, 18 Mar 2020 22:01:03 +0000 https://scottgeek.technology/?p=5144 Ya, Teleworking this week….

~ScottGeek.

]]>
https://scottgeek.technology/2020/03/18/working-from-home/feed/ 0
Behind in my posting https://scottgeek.technology/2019/12/12/behind-in-my-posting/ https://scottgeek.technology/2019/12/12/behind-in-my-posting/#respond Thu, 12 Dec 2019 17:43:02 +0000 https://scottgeek.technology/?p=5101 Ya, I’m a little behind… I’ve not posted anything since… gee October!. Really?

 It’s been a busy month and ½… It’s not that there’s not a lot to talk about… Indeed there is. Anyway, I’ve lots of Azure stuff to point out and comment on as I’ve completed a cert class on Azure dev (or so it was called). Then there’s ASP Core 3.x… some new versions of Visual Studio. And I’ve not even written anything on Media stuff… Star Wars… Disney+… the list goes on….

Well, I’ll be out of the corp life for a couple weeks coming… there will be time to do some catching up.

~ScottGeek.

]]>
https://scottgeek.technology/2019/12/12/behind-in-my-posting/feed/ 0
Example Use of class for HomeTown font https://scottgeek.technology/2019/03/03/example-use-of-class-for-hometown-font/ https://scottgeek.technology/2019/03/03/example-use-of-class-for-hometown-font/#respond Sun, 03 Mar 2019 16:58:33 +0000 https://scottgeek.technology/?p=1729

This is hometown. Made possible with UAF and a css class…. umm. Needs to be easier to use.

SG 

]]>
https://scottgeek.technology/2019/03/03/example-use-of-class-for-hometown-font/feed/ 0
Becky Treats from Night at the City https://scottgeek.technology/2018/04/29/becky-treats-from-night-at-the-city/ https://scottgeek.technology/2018/04/29/becky-treats-from-night-at-the-city/#respond Sun, 29 Apr 2018 01:39:18 +0000 https://scottgeek.technology/?p=285 Sugar Cookie Truffle

]]>
https://scottgeek.technology/2018/04/29/becky-treats-from-night-at-the-city/feed/ 0