Questions tagged [sql-scripts]

SQL Scripts are lists of SQL sentences written in a single file, meant to be executed sequentially. Depending on the particular RDBMS system, SQL scripts can have procedural language characteristics, such as control-of-flow constructs.

437 questions
0
votes
0 answers

Multiple update queries in a single sql script file in oracle

I am in a situation where I need to update an oracle database table that contains different partitions. I need to update the table partition wise and I need to update all the partitions in a sql script file. Below is an example of what I am trying…
Sarshad
  • 29
  • 4
0
votes
1 answer

SQl query help to get the correct data

I wanted to write script to return those customer_id from customer table with following condition. The get date is between start_date and end_date on order table. Then the count of customer_id on order table after matching condition 1 is more than…
0
votes
2 answers

How would I fix these "ORA-00933: SQL command not properly ended" "ORA-00923: FROM keyword not found where expected" errors?

This Statement: SELECT id, units, cost FROM inventory_list WHERE cost <= 20; Gives me: ORA-00923: FROM keyword not found where expected While this statement: SELECT * FROM items WHERE ilt_id = 'il010230126' OR ilt_id =…
0
votes
4 answers

Sql script display leading 0 in excel output file

I have sql script "example.sql": SPOOL &1 Select '<.TR>'||'<.TD align="left">'||column_name||'<./TD>'||'<.TR>' from table1; spool off..which dumps it contents to cshell script "getdata.csh" this is how i get data from sql script to csh script…
jack
  • 163
  • 3
  • 9
  • 20
0
votes
2 answers

How to run multiple SQL script files in a Shell script

I have to create 1 UNIX Shell script. In that shell script i want to run multiple SQL script files from the same directory. I have used like this- #!usr/bin/ksh SQLPATH = /usr/sql/ (cd $SQLPATH; 'sqlplus usr/password@sid <.log …
Shahin P
  • 372
  • 1
  • 4
  • 14
0
votes
0 answers

How to pass a csv file as a parameter to a sql script?

I have a script which needs inputs from a csv file saved in GIT. I don't want to import the csv file as a table in the database. How can I pass the csv file as an input parameter to the sql script?
0
votes
1 answer

Pass CLOB to system procedure SAP HANA

How do I pass a clob to system procedure without getting an error? I am trying to pass: CALL SYS.GET_PROCEDURE_OBJECTS(CREATE PROCEDURE "IA_ATP"."ia_xsjob.xsjob_procedures_folder::atp_procedure" ( ) LANGUAGE SQLSCRIPT SQL…
LearningHero
  • 41
  • 2
  • 6
0
votes
1 answer

Is there any way to create schema and tables in mysql docker without build a new image for mysql?

I have 2 images. One of them is custom and the other one is mysql. I am using docker-compose. Its database part is given below. db: image: mysql container_name: mysql-docker-test volumes: - test-sql:/var/lib/mysql …
tgbzkl
  • 67
  • 1
  • 10
0
votes
2 answers

What ORACLE Update SQL Query for this?

I want to update the value of RENEWED_PERMIT_TEMP to T2_VAL. Thinking of merge into but I'm not used to ORACLE DB. SELECT t1.INSTANCE_ID ,t1.RENEWED_PERMIT_TEMP ,t1.USER_REFERENCE_NUMBER AS t1_val ,t2.USER_REFERENCE_NUMBER AS…
0
votes
0 answers

SQL Script for this

Sample Data: I want the value of RNWD_NO will be the USER REFERENCE OF THE OTHER. ID.2 RNWD_NO will be USER_REF of ID.1 same to others.
0
votes
1 answer

What SQL Query will be useful on this? ( ORACLE)

I want to get the value of column and set it to the other column but this is the challenge to me. Both are in the same table DATA 1 DATA 2 Prev.No = 789 App.No = 789 UserRefNo. = 23 RenewdNo = ? Question is: what query…
0
votes
2 answers

Order Quantity Double after joining with delivery

We can have multiple deliveries for single order item. So,when I am joining Order-Item with Delivery, I get multiple rows. Now, if I want to get order quantity at Order Item level ( not including Delivery-Item), I get wrong aggregation. I understand…
SQL_NOVICE
  • 35
  • 1
  • 7
0
votes
2 answers

How to check services(mysql running or not) in remote server without login from the local server. We don't have login access to the remote server

How to check services(mysql running or not) in remote server without login from the local server. We don't have login access to the remote server. I tried with mysqladmin command but getting below error mysqladmin --host=localhost:3306 --user=admin…
Ankit Shastri
  • 25
  • 1
  • 6
0
votes
0 answers

MYSQL script with database selection from query

Is there any way to write a Mysql script with a parameter for "USE" steatment? I tried this: SET @test=(SELECT dbname FROM dblist WHERE active>0); USE @test; ALTER ... But it doesn't work. My goal is to change/alter with my script a particular…
Tobia
  • 9,165
  • 28
  • 114
  • 219
0
votes
2 answers

Conditional SQL queries with SQL Script

I have two example tables: TABLE1: ID | COLUMN_B| COLUMN_C _________|_________|_________ 1 | 0 | 1 ________|_________|_________ 2 | 0 | 1 ________|_________|_________ 3 | 0 | …
Nicole
  • 107
  • 1
  • 2
  • 12