Skip to content
Advertisement

Tag: bash

Creating and using an SQL variable after some set text

I’m needing to set some text into a field within a row, and use a SQL variable as part of that text. I’m then using this sql statement in a bash script. I have I believe I created the variable correctly I then need to use this variable as follows However its not working and is giving me errors about

Simple sql script fails on execution

Below is a sample bash script and it seems to error out when i execute the bash. The sql works on its own but in a script oddly. Please advise JOB_RUNNING=’SELECT count(1) from gv b,gv a WHERE b.paddr = a.addr AND type=”’USER”’ AND b.status=”’ACTIVE”’ AND b.program=”’Thin Client”’ * ERROR at line 1: ORA-00942: table or view does not exist’ Answer

AWK – Parsing SQL output

I have a SQL output something like below from the output of a custom tool. Would appreciate any help in finding what I am doing incorrectly. I am trying to pipe this output the columns I need in my case column1, column2, and column7. I have tried piping out like this but it just prints column1 tool check | awk

BigQuery cli bq how to use EXECUTE IMMEDIATE script

I would like to use two SQL scripts to create and update a table in BigQuery using bq query command. Here are the two scripts : 1- Creating the table 2- updating the table When using these two scripts as queries with the bq query command, I have got an error : Is there any other way to do that?

Advertisement