Transact SQL – XQuery – Ancestor

Background

Playing around with XML, but dug in a quick sand.

XML

Here is the XML

Image

foo.xml

Code

Code

<root>                                                                                                             
  <foo id="0">                                                                                                       
	<foo id="1">                                                                                                   
	  <bar attr="xxx" />                                                                                         
	</foo>                                                                                                         
	<foo id="2">                                                                                                   
	  <bar attr="sam" />                                                                                         
	</foo>                                                                                                         
	<foo id="3">                                                                                                   
	  <tar>                                                                                                      
		<bar attr="samuel" />                                                                                     
	  </tar>                                                                                                     
	</foo>                                                                                                         
  </foo>                                                                                                             
</root>

Code

Find Nodes whose element matches specific value

SQL


declare @id int

set @id = 3

SELECT
         [id] = item.value
                    (
                          '@id'
                        , 'INT'
                    ) 

FROM @foo.nodes('//foo') t (item)

WHERE item.value('@id', 'INT') = @id

Output

XPath.attribute.value.is.3

Pass X PATH :- Child::bar/Attribute

SQL


-- child//bar/@attr=sam
SELECT
         [element.attribute.sam]
            = t.item.query('.')

FROM @foo.nodes('//*[child::bar[@attr=''sam'']]') t (item)

Output

XPath.attribute.value.is.sam

Find Descendants

SQL


-- descendant
SELECT
         [element.descendant]
            = t.item.query('.')

FROM @foo.nodes('//foo[@id=2]/descendant::*[position()=1]') t (item)

Output

XPath.element.descendant

Find Ascendants

SQL


-- ancestor
SELECT
         [element]
            = t.item.query('.')

FROM @foo.nodes('//bar[@attr=''sam'']/ancestor::*[position()=1]') t (item)

Output

Output – Textual


Msg 9335, Level 16, State 1, Line 61
XQuery [nodes()]: The XQuery syntax 'ancestor' is not supported.

Output – Image

XPath.element.ascendant

Source Code Control

Git Hub

TransactSQLXQuery/ancenstor/
Link

 

Summary

Transact SQL/XQuery does not support the ancestor function.

Referenced Work

  1. Stack Overflow
    • XPath to find nearest ancestor element that contains an element that has an attribute with a certain value
      Link
    • xpath: find a node that has a given attribute whose value contains a string
      Link

 

Damon Thompson / 2019 – Summer

 

Videos

  1. First Wednesday | Damon Thompson
    • Videos
      • Video #1
        Channel :- Celebration Church
        Published On :- 2019-April-8th
        Link

In Depth

First Wednesday | Damon Thompson

  1. Divine Restriction
    • Out live you
    • Out last you
  2. Long Path
  3. Release you from anxiety that can not endure the burn
  4. Spirit of God came upon
    • Where are Samuel and David ?
      • Saul had the same access to Samuel
      • When Saul the Political Spirit tried to attack the Prophetic Spirit
  5. Isolation Issue
    • Distance from God
      • Spiritual Warfare
    • Solitary Confinement
    • Go find a Father
  6. Fall into the Governmental Realm
    1. Created by a spiritual father
    2. I am going to have a take care of this myself
  7. Had he stayed their?
    • Saul and Jonathan could have ruled forever
  8. Split
    • Has long as you do not stay in Spiritual Authority
    • Properly respond to Spiritual Authority
  9. own
    • Own everything about you that is lawless
  10. Samuel took David
    • Samuel took David to go live with him
    • On the heels of becoming King, he went to live under Spiritual Authority

 

God and His Children – Discipline

Background

I am catching up on Francis Chan’s message during the recent “Altar Conference” in Fresno, California.

Francis Chan

Francis was speaking out of Hebrew 12.

God Disciplines His Children

Hebrew 12:4-6
Link

In your struggle against sin, you have not yet resisted to the point of shedding your blood. And have you completely forgotten this word of encouragement that addresses you as a father addresses his son? It says,

“My son, do not make light of the Lord’s discipline,
and do not lose heart when he rebukes you,
because the Lord disciplines the one he loves,
and he chastens everyone he accepts as his son.”

 

Quick Point

  1. Speaks of resisting sins
  2. Encouragement
    • It is the Father speaking to a Son
  3. Discipline
    • Do not make light of the Lord’s discipline
    • Yet, do not lose heart
    • Lord’s discipline is borne out of Love
    • It is borne out of his acceptance of you as his son

 

Guidance for the Young ( Proverbs 3 )

Anchor

Hebrews 12:4-6 is anchored on Proverbs 3:11-12

Proverbs 3

  1. Proverbs 3:1-2
    • My son, do not forget my law,
      But let your heart keep my commands;
      And peace they will add to you.
  2. Proverbs 3:3-4
    • Let not mercy and truth forsake you;
      Write them on the tablet of your heart,
      And so find favor and high esteem
      In the sight of God and man.
  3. Proverbs 3:5-6
    • Trust in the Lord with all your heart,
      And lean not on your own understanding;
      In all your ways acknowledge Him,
      And He shall direct your paths.
  4. Proverbs 3:7-8
    •  Do not be wise in your own eyes;
      Fear the Lord and depart from evil.
      It will be health to your flesh,
      And strength to your bones.
  5. Proverbs 3:9-10
    • Honor the Lord with your possessions,
      And with the firstfruits of all your increase;
  6. Proverbs 3:11-12
    • My son, do not despise the chastening of the Lord,
      Nor detest His correction;
      12 For whom the Lord loves He corrects,
      Just as a father the son in whom he delights.
  7. Proverbs 3:21-26
    • Keep sound wisdom and discretion;
      And will keep your foot from being caught.
  8. Proverbs 3:27-30
    • Do not withhold good from those to whom it is due,
      When it is in the power of your hand to do so.
      28 Do not say to your neighbor,
      “Go, and come back,
      And tomorrow I will give it,”
      When you have it with you.
      29 Do not devise evil against your neighbor,
      For he dwells by you for safety’s sake.
      30 Do not strive with a man without cause,
      If he has done you no harm.
  9. Proverbs 3:31-35
    • Do not envy the oppressor,
      And choose none of his ways;
      But His secret counsel is with the upright.
      But He blesses the home of the just.
      But gives grace to the humble.
      35 The wise shall inherit glory,
      But shame shall be the legacy of fools.

 

Referenced Work

  1. Francis Chan
    • Francis Chan | Session 3 | The Altar Conference 2019
      • Profile
        • A sermon by Francis Chan on the second day of The Altar Conference in Fresno, California.
        •  The Altar Conference 2019
      •  Videos
        • Video #1
          Channel :- The Altar
          Published on Jun 21, 2019
          Link

The Altar Conference / 2019

 

Videos

  1. Francis Chan
    • Francis Chan | Session 3 | The Altar Conference 2019
      • Profile
        • A sermon by Francis Chan on the second day of The Altar Conference in Fresno, California.
        •  The Altar Conference 2019
      •  Videos
        • Video #1
          Channel :- The Altar
          Published on Jun 21, 2019
          Link
  2. Mattie Montgomery
    • Mattie Montgomery | Session 1 | The Altar Conference 2019
      • Profile
        • A sermon by Mattie Montgomery followed by an altar call on the first night of The Altar Conference in Fresno, California.
      •  Videos
        • Video #1
          Channel :- The Altar
          Published on Jun 13th, 2019
          Link
  3. Damon Thompson
    • Damon Thompson | Session 2 | The Altar Conference 2019
      • Profile
        • A sermon by Damon Thompson followed by worship on the second day of The Altar Conference in Fresno, California.
      •  Videos
        • Video #1
          Channel :- The Altar
          Published on Jun 19th, 2019
          Link
  4. Derek Carr
    • Derek Carr | Session 3 | The Altar Conference 2019
      • Profile
        • A sermon by Derek Carr followed by an altar call on the second day of The Altar Conference in Fresno, California.
      •  Videos
        • Video #1
          Channel :- The Altar
          Published on Jun 24, 2019
          Link

 

In depth

Derek Carr

Derek Carr | Session 3 | The Altar Conference 2019

  1. I am not going to interrupt what God is trying to do
  2. Keep pressing
  3. Keep pressing in
  4. Don’t come face to face with the Living God and walk away with more information
  5. DO not come face to face and walk away with more information
  6. The feast set before us is you Jesus
  7. You are not going to interrupt me, you stay, you do what you have to do
  8. That song, the evidence is all around you
  9. I can not deny his presence in this place
  10. If nothing else happens
    • What he has done to my heart
  11. I felt the father’s heart for his people
  12. Nurturing the path with people around you
  13. The spirit of religion will tell you what God has done and will do
  14. Raise your hands if you physically healed
  15. Oakland Raiders quarterback cannot do that
  16. heather, wife, she is from Fresno
  17. I do not lust because I love her as she is God’s daughter
  18. Do not settle down for anything than God’s best for your life

 

Samba :- Linux & Windows Integration

Background

Mid last week as I was returning home received a word.

It read :-

The Linux Host is not accessible and the Linux Subsystem on our Window 10 desktop is not working either.

 

Working Through

Windows 10 Linux Subsystem

Looked at the Windows 10 Subsystem and the issue appears to be newbie issues.

It looks like a few of the commands from the Linux Study Guide that my family member  is following is not available in the Windows Subsystem.

 

Linux Host

The Linux host was more complicated.

Rebooted

Tried to connect to the Linux Host, but it wouldn’t respond

Due to lack of affection and attention and it needed a reboot badly.

 

Applied Patches

Waiting for me was a trek load of patches.

Applied them.

 

SSH

Tried to ssh it from one of our Windows systems.  But, I couldn’t get a response.

Wireless Access Point

Dynamic IP Address

The Linux host is connected to our network via a Wireless connection.

Connected to the WAP via a browser.

Confirmed that the IP Address had changed from the one registered with the DNS server.

 

DHCP Reservation

Tried to see whether the WAP supports DHCP Reservation.

DHCP Reservation basically states that a given MAC Address should be granted exclusive access to an IP Address.

DNS

Knowing the the WAP could end up offering a different IP Address, it was time to untie our Linux host from a permanent IP Address.

 

SAMBA

Years ago, played around with SAMBA.

But, that was yearns ago.

Vladyslav Baidak @ Scalified

Googled on the right terms.

And, ended up finding a quality post from Vladyslav Baidak @ Scalified.

That post is here :-

Devops: Configuring Host Name Resolution
Link

 

Linked In

Had a few suggestions and reached out to Vladyslav Baidak via Linked In.

Textual

Hi Daniel! Thanks for your interest. I’m really glad I could help you. Indeed that was the reason for writing this mini article – I had the same question some time ago.   As for the title – that’s a typo for sure, we’ll fix it soon

Daniel, we fixed the title and added possibility to add comments as you asked.

 

Image

VladyslavBaidak.linkedIn.20190715.1120AM

 

 

 

 

 

 

MySQL – Basic User Information

Background

Once one is connected to MySQL, it is good to review basic user information.

Functions

Here are some available functions for reviewing one’s own information.

Outline

  1. username
    • user()
    • current_user
  2. Review Permissions
    • show grants

Username

There are a few functions that basically do the same thing.

They are all return the current user’s name.

The functions are :-

  1. user()
  2. current_user

SQL

Sample


select
	  user() as 'user()'
	, current_user as 'current_user'

Output

userProfile.user.01.20190714.0812AM

 

Permissions

Let us quickly see what permissions we have.

There are functions for introspectively reviewing one own’s permission :-

  1. show grants
    • Show Grants ( for yourself )
    • Show Grants ( for another user )

Show Grants

Show Grants for Self

SQL
Sample

SHOW GRANTS

Output

showGrants.01.20190714.0817AM.PNG

Show Grants for Others

SQL
Sample

SHOW GRANTS for '{me}'@'%'

Output

showGrants.01.20190714.0817AM.PNG

 

Speaking Loudly to God

Standing In Line

Standing in line picking lunch for the family earlier today, I met a man with a cross on his neck.

I asked him about his walk.

Cross Around Our Necks

I figure if you have a cross around your neck, you better have a good story.

Nothing New

He looked at me and said No, this is not a new story.

It started has a kid.

Grand Mother is a Jehovah Witness.

He is Catholic.

Just last week, he had his son baptized.

Over a girl

A few weeks ago, one of his good friends posted on Facebook, how he was going to end it all.

The friend and his girl were having problems.

He said this is a big man.

And, he has been training him for MMA.

He got him in the gym the next Tuesday and he promised they will go walk the lake afterwards.

Girl Issues

He broke his friend down.

Girl issues are peachy.

Having to worry about paying mortgages, striving for your young son to be financial independent is a bit harder.

Losing

Losing Money

He said to me, I can have that conversation as I have lost and not found.

Years ago, he was planning on going to the DR, Dominican Republic.

She later became his wife, but she was his girlfriend then.

They had visited San Francisco and got in a big fight.

He went out mad at the world.

Later he found out that he had lost over $3400 cash he was throttling around.

Losing what wasn’t yours

Later that week during Church Services, the man of God said he had a Word about someone who has lost money.

The story was about a rich man who showed up in heaven will a train of God.  He was asked why he brought so much with him; as heaven as enough Gold and Diamond; as is.

The Word is that losing is not letting go of what wasn’t yours.

 

Epiphany

My new friend looked at me and said my life turned around in 2004.

I saw God face to face and he asked me to draw a line.

No more game playing.

 

Speaking Loudly to God

And, so each day he boldly wakes up and knows he is able to speak loudly to God.

No discouragement, No ambush.

Just Clarity.

 

Listening

Listening to ….

  1. Church of Truth
    • Church of Truth – Not in a hurry ( 2018-Jan-7th )
      Link
  2. Damon Thompson
    • Damon Thompson – Authority of Intimacy – Call to the Altar
      Link

Lyrics & Words

Church of Truth

Not in a Hurry

  1. Hurry
    • Just to rest in your nearness
    • I am starting to notice, you are speaking
    • I am not in a hurry
      • when it comes to your presence
      • when it comes to your voice
    • I am learning to listen
      • when it comes to your presence
  2. Get Rid
    • Get rid of the Failure
    • Get rid of the Lie of the enemy
  3. Spirit of God
    • When the Holy Spirit fills our lives, it fills us with the Spirit of God
    • It allows us to see into the Spirit World
    • Everything that is promised you, is promised you in the Spirit World

Damon Thompson

Damon Thompson – Authority of Intimacy – Call to the Altar

  1. Keep praying
  2. Peoples souls are in jeopardy, hanging in the balance
  3. Quit playing around with outer Church Christianity
  4. Conviction coming tonight
  5. The Love of God is coming to arrest
  6. Holy Spirit is coming to convict, righteousness
  7. God’s goodness is here tonight
  8. Issues of sin are separating you