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.
Questions tagged [sql-scripts]
437 questions
0
votes
1 answer
while loop is ending to early in SAP Hana Sql Procedure
I have the following SQL-Script:
PROCEDURE "P_OVERVIEW" ()
LANGUAGE SQLSCRIPT
READS SQL DATA
AS
BEGIN
DECLARE I INT = 0;
WHILE :I < 24 DO
SELECT A, B, COUNT(A) AS COUNT, LAST_DAY(ADD_MONTHS(CURRENT_TIMESTAMP, -:I)) AS "DATE", I
FROM…

lisa
- 107
- 5
- 12
0
votes
1 answer
How do I execute a SQL script using a bind variable
I'm running Oracle 18.c on a Windows 10 platform.
I have a large DOS script which calls SQL Plus to run the first SQL script, passing a parameter to it.
The parameter is successfully passed to the first SQL script. In that SQL script I'm trying to…

user3138025
- 795
- 4
- 17
- 46
0
votes
2 answers
Dynamic SQL Where condition, in Powershell script
I am working on a Powershell script where output of query #1 is where condition feed for query #2 but it is not getting the feed, if someone please see and let me know what could be possible solution s for this.
Also please note, in real…

SKumar
- 33
- 9
0
votes
1 answer
How to run sql script with 'Go' statements from C#
I am trying to run SQL script which contains 'GO' statements as batch separators.
I came across Jon Galloway's way to handle this type situation which makes use of SMO(nuget package Microsoft.SQlServer.SQLManagementObjects).
con = new…

Aditya
- 65
- 10
0
votes
1 answer
How I can prevent the sql injection vulnerability when I generate sql scripts instead of directly accessing the database?
For my job I need to generate a sql scripts for updating some values in the database from a json file as seen bellow:
$jsonContents=file_get_contents('./myfile.json');
$jsonContents=json_decode($jsonContents,…

Dimitrios Desyllas
- 9,082
- 15
- 74
- 164
0
votes
1 answer
How to search duplicate records and order by columns from MSSQL Table without primary key?
I getting top 20 record from SQL Table
There is a column State in My MS SQL Table there are some numeric data,
In my case I skipped numeric records from C# function after I am getting duplicate results of City and Country,
for example 'Los…

Abhishek B.
- 5,112
- 14
- 51
- 90
0
votes
4 answers
SQL Script for SQL Azure
I'm developing an app that uses SQL Azure. I don't have an account to access Windows Azure and I want to start writing SQL script.
Can I use my SQL Server 2008 to test my SQL Azure script?

VansFannel
- 45,055
- 107
- 359
- 626
0
votes
2 answers
PLSQL script for exporting data into .csv format its working fine. I am looking for one file in which all data will come in proper format
I have one PL-SQL script for exporting data into .csv format its working fine. I am looking for one .csv file(I can open in excel format) in which all data will come in proper format.
In existing code it asks for start, end date and table name. but…

Swapnil G Thaware
- 799
- 3
- 6
- 19
0
votes
1 answer
Microsoft .NET Framework Data Provider for Oracle problem executing scripts
We are having trouble executing scripts that begin with BEGIN and are having multiple procedures or triggers with the aforementioned provider. Execution of those fails. Has anyone eperienced similiar problems?

the berserker
- 1,553
- 3
- 22
- 39
0
votes
1 answer
How can I remove or add a column in an sql script file?
I have an outdated sql insert into script with bunch of datas and I want to import this to the new database which has more columns between the old columns.

rog ogr
- 51
- 2
0
votes
0 answers
SQL Sever initial load failed in spring boot
I am trying to load the initial data to the database schema and data with the spring boot application.
I am trying to test out the initial load for schema.sql and data.sql with spring boot and SQL Server. Below are my code and error…

Developer
- 493
- 2
- 8
- 19
0
votes
2 answers
How to generate the script of rename table using sqlpackage.exe?
I have Two Database some-db-dev & some-db-qa. Both the databases are identical to each other.
I have created a DACPAC File for both the databases. some-db-dev.dacpac and some-db-qa.dacpac respectively.(It had the Table as "A" and Column "Test" in…

nikita kakraniya
- 141
- 2
- 14
0
votes
0 answers
Update table date field from other table when not null
I want to update a Date filed for Entry type = 4 )in the table from some records (entry type = 1) in the same table however getting a cannot insert null data into the field error.
UPDATE [Item Ledger Entry]
SET [Last Invoice Date] = (Select …

Ashu
- 1
0
votes
1 answer
Identiy missing rows and calculate them in SQL
I have the follwing data. Need to identify the missing rows and calculate the average
LineNo Field1 Field2 Year Average
1 France Paris 2019 100
2 France Paris 2017 300
3 France Nice 2018 200
4 Italy Rome 2019 50
5 Italy …

Robert
- 61
- 2
- 8
0
votes
0 answers
SQL Script fails to execute when invoked from Java code but works in sql developer
I'm facing the below mentioned issue while executing a sql script through Java but the same script executes fine in Oracle sql developer.
Reason is not clear to me.
java.sql.SQLException: ORA-00900: invalid SQL statement
Could anyone suggest on…

Manasa
- 72
- 10