I have a sqlfile that I want to run via shell script against an Oracle pluggable database. The sql file basically just loops through table names to apply grants to a role. When I run the script, it looks like it executes the file, but it really doesnt, no grants are applied. When I log into sqlplus and execute the
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?
Execute sql queries from shell script
I need to execute the following sql queries from bash/expect script what is the preferred approach to run these queries from bash script # psql ambari -U ambari Password for user ambari: psql (9.2.24)…
Unable to run simple presto shell query
I am trying to run simplest query. However it is not working. -bash-4.2$ prestosql –execute “select 1;” Exception in thread “main” io.airlift.airline.ParseArgumentsUnexpectedException: Found …
Extracting unique values with SQL [closed]
I’m new to SQL and would greatly appreciate your help with extracting data from a hive table. The table contains two relevant columns: host and url. The url column has a lot of duplicates and …