-
-
Save RamblingCookieMonster/4b86f958c41b50f74e66 to your computer and use it in GitHub Desktop.
zSQLite.InsertSelect.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Insert some data, use parameters for the fullname and birthdate | |
$query = "INSERT INTO NAMES (Fullname, Surname, Givenname, Birthdate) | |
VALUES (@full, 'Cookie', 'Monster', @BD)" | |
Invoke-SqliteQuery -DataSource $Database -Query $query -SqlParameters @{ | |
full = "Cookie Monster" | |
BD = (get-date).addyears(-3) | |
} | |
# Check to see if we inserted the data: | |
Invoke-SqliteQuery -DataSource $Database -Query "SELECT * FROM NAMES" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment