run a query by pointing to the query script file #149
Closed
computechrr
started this conversation in
General
Replies: 2 comments
-
@computechrr -- yeah, you can do this, but you will have to use other cmdlets within PowerShell to handle reading from the file and then pass that information to the SimplySql commands. # use a variable
$query = Get-Content -Path .\example.sql
Invoke-SqlQuery -Query $query
# get the file content inline
Invoke-SqlQuery -Query (Get-Content -Path .\example.sql) |
Beta Was this translation helpful? Give feedback.
0 replies
-
did not think about that
thank you very much
Ted
…________________________________
From: Mithrandyr ***@***.***>
Sent: Tuesday, April 23, 2024 9:29 AM
To: mithrandyr/SimplySql ***@***.***>
Cc: Ted Reichelt ***@***.***>; Mention ***@***.***>
Subject: Re: [mithrandyr/SimplySql] run a query by pointing to the query script file (Discussion #149)
@computechrr<https://github.com/computechrr> -- yeah, you can do this, but you will have to use other cmdlets within PowerShell to handle reading from the file and then pass that information to the SimplySql commands.
# use a variable
$query = Get-Content -Path .\example.sql
Invoke-SqlQuery -Query $query
# get the file content inline
Invoke-SqlQuery -Query (Get-Content -Path .\example.sql)
—
Reply to this email directly, view it on GitHub<#149 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AKMYWOHPNPGW3Y5XUZVY6PDY6Z467AVCNFSM6AAAAABGVEOCGKVHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM4TEMBSGUZTQ>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have a query that is a nightmare trying to create as a string in powershell due to all the special charatcers. it loads a data file flushes tables etc. is there a way i can point to the existing query file to run it instead (mariadb)?
currently i use the mariadb command line in the script to run the query by pointing to the existing query file.
Beta Was this translation helpful? Give feedback.
All reactions