Jmeter java.sql.SQLSyntaxErrorException: ORA-00933: SQL command not properly ended - sql

I am trying to delete a record from my database using Jmeter and I am having some difficulties. I can query just fine, but when it comes to DELETE, I am getting an error. I enter the following code in my Jmeter:
delete from DATA_RECORDS where DATA_RECORDS_ID = (select id from DATA_RECORDS_STORE where RESOURCE_IDENTIFIER='somevalue');
delete from DATA_RECORDS_STORE where RESOURCE_IDENTIFIER='somevalue';
After running the test in Jmeter I get the following error:
java.sql.SQLSyntaxErrorException: ORA-00933: SQL command not properly ended
However when I enter that same code in my SQLDeveloper, SQL actually runs the script and it deletes the appropriate data.
The Query Type is set to: Update Statement and I have nothing in the remaining fields: Parameter values, Parameter types, Variable names, etc. I would also like to mention that I am running Jmeter 3.2 GUI mode. If you could help me out that would greatly be appreciated. Thanks!

Separate to 2 jdbc requests:
delete from DATA_RECORDS where DATA_RECORDS_ID = (select id from DATA_RECORDS_STORE where RESOURCE_IDENTIFIER='somevalue')
delete from DATA_RECORDS_STORE where RESOURCE_IDENTIFIER='somevalue'

Related

DataGrip only executing first 19 lines of SQL query

I'm attempting to execute a 236 line query in DataGrip in an attached BigQuery console. When I select the whole script to run, it always only executes up to the 19th line. Because of that, I get this error
[HY000][100032] [Simba][BigQueryJDBCDriver](100032) Error executing query job. Message: Syntax error: Unexpected end of script at [19:49] com.simba.googlebigquery.support.exceptions.GeneralException: [Simba][BigQueryJDBCDriver](100032) Error executing query job. Message: Syntax error: Unexpected end of script at [19:49]
I've tried running it as a SQL file as well, but that resulted in the same error. I Know that this query is valid because it returns the desired results when I run it directly in the Google Cloud query editor. Has anyone else run into this issue, and is there a fix?
We introduced BigQuery dialect recently and it does not apply to your previously created data source after update, since this data source was created with custom driver with 'Generic' dialect as default. It is needed to change dialect in driver options, then you'll have all related consoles and datasources with correct one.

line being ignored when trying to run a script in oracle sql

I am a student who is new to Oracle SQL and I am having some trouble when trying to run my script. One step in my assignment is to display the table structure using a describe command. Whenever I run the script I use either DESC or DESCRIBE and both give the error message "You have requested to run a script containing statement(s) SQL Workshop will ignore. Please confirm your request." as well as displaying "Line Number Unknown Statement
7 ". Would anyone be able to help me find what the problem is? The rest of the script runs with no problem. Code:
***
> Blockquote
DESC LOCATION;
SELECT* FROM LOCATION;
UPDATE LOCATION SET ZIP_CODE='10601' WHERE LOCATION_ID='L01';
UPDATE LOCATION SET ZIP_CODE='32099' WHERE LOCATION_ID='L09';
UPDATE LOCATION SET ZIP_CODE='02138' WHERE LOCATION_ID='L12';
UPDATE LOCATION SET ZIP_CODE='08818' WHERE LOCATION_ID='L04';
UPDATE LOCATION SET ZIP_CODE='07097' WHERE LOCATION_ID='L07';
SELECT* FROM LOCATION;
SELECT* FROM LOCATION ORDER BY ZIP_CODE;
SELECT* FROM LOCATION ORDER BY STATE, LOCATION;***
DESC statement is not an Oracle SQL statement: it is actually a command implemented by Oracle client tools such as SQL*Plus, sqlcl or SQL Developer. If you are SQL Workshop in APEX you need to use something else: in APEX you should use the Describe button as documented in https://docs.oracle.com/cd/E59726_01/doc.50/e39150/sql_proc.htm#AEUTL222.

Pentaho Execute SQL Statements variable conversion to null

I am using PDI to delete and insert some data from a DB. I have the following issue. I create two variables called START_DATE and END_DATE that are used to select the data that will be deleted from my DB. I am able to get them and run my transformation with no erors in the log file, but when I checked if data was deleted, I find it didn't. I send checked my "DeleteProcedure" step, and it says "Conversion error: null". I have tried different approached to take the variables and pass them as Strings, but I haven't been able to solve this issue. It cannot be a SQL mistake as I tested it with a constant and it works.
Any ideas? I attach some pics. Thanks!
As a documentation of the Execute SQL script says:
Note: When you have an issue, that the SQL is started at the initialization phase of the transformation and not for each row, make sure to check the option "Execute for each row" (see description below).
In your case it executes during the initialization phase of the transformation that's why it gets null values instead of ones from previous step.

Execute SQL Task fails in SSIS 2008 package but runs successfully outside package

I created an execute sql task to save the filenames encountered in a Foreach Loop task into a database table,
this works fine when I run the the individual task and it writes the filename to the database table (see below)
UNABLE TO POST IMAGES CURRENTLY
![task successfully runs][1]
However when i run the complete SSIS package, this task fails (see below)
UNABLE TO POST IMAGES CURRENTLY
![unsuccessful execution][2]
The error message I am getting is:
Error: String or binary data would be truncated.
[Execute SQL Task] Error: Executing the query "insert into filename_staging_table
(FileName) Val..." failed with the following error:
"The statement has been terminated.". Possible
failure reasons: Problems with the query,
"ResultSet" property not set correctly, parameters
not set correctly,
or connection not established correctly.
Any guidance with this greatly appreciated....I am completely stuck!!!!
Thanks
The error reads "String or binary data would be truncated." The reason the script works when run manualy is because you are only trying to insert one value. That value is within the length constraint of your column.
When you run the task, it is looping through a list of filenames and trying to insert each one. One of these names is too long for the field you are trying to insert it into.
You need to change the length of the field in SQL or you need to use a LEFT(filename, xx) on the filename itself so that a only the first xx characters are inserted into your table. (Change the xx to the number of characters to be inserted)

SQL Permission Problem

I have having an issue with a SQL execution where I am getting an error message
-2147217843 Login Failed for user.
I am able to successfully open the connection to the database and execute select count(*) queries.
I am getting this error when I include fields.
In a separate application that uses the same fields I am able to retrieve the same data so seems to rule out column permissions.
The query coming back with no error is:-
SELECT tbl_PersonalDetails.SystemID
FROM tbl_PersonalDetails
WHERE tbl_PersonalDetails.Title IS NOT NULL
And tbl_PersonalDetails.HospitalNumber IS NOT NULL
AND tbl_PersonalDetails.SiteID = 1
The query coming back with the error is:-
SELECT DISTINCT tbl_PersonalDetails.Title,tbl_PersonalDetails.HospitalNumber
FROM tbl_PersonalDetails
WHERE tbl_PersonalDetails.SiteID = 1
ORDER BY tbl_PersonalDetails.Title,tbl_PersonalDetails.HospitalNumber ASC
This is not specific to these particular queries, in the first query where we are just doing a count I always get a count back with no issue, when I try to request fields such as in the second I always get the Login Error.
Your problem isn't in the SQL queries you've posted. They would either all fail or all succeed based on the information given.
Your problem is your calling/client code. Sounds like you're using Classic ASP ("recordset....adodb connection").
Double check that your ASP code is using the proper connection strings.
To prove this, run any of these queries in SQL Server Management Studio. Connect using the credentials that your connection string contains.