need help with SQL query to update pipes usage
Posted: Thu Aug 25, 2022 8:22 am
Hi.
I'm using IrriBase 20.07 (The latest update).
I'm trying to write a SQL query to update pipes usage that will do this:
1. clear all pipe usages (the first UPDATE Statment in the code below).
2. assgin new usages to pipes (the second and third UPDATE Statments in the code below)
in the test query I worte (see below) thre are 3 update statments, and if I run each one of them individually they works,
but when trying to run them togther I get An error "Characters found after end of SQL statement".
I've looked in SQL forums and it looks like the syntax is ok.
here is the query I'm trying to run (3 UPDATE statments in one query):
UPDATE Components
SET Components.[USAGE ]= ' ' WHERE Components.[Database Number]=1 AND (Components.[USAGE] <> ' ' and Components.[USAGE] <> 'L ');
UPDATE Components
SET Components.[USAGE] = 'M ' WHERE Components.[Database Number]=1 AND (Components.[Description] = 'PE IRRIGATION PIPE 90/6');
UPDATE Components
SET Components.[USAGE] = 'M ' WHERE Components.[Database Number]=1 AND (Components.[Description] = 'PE IRRIGATION PIPE 110/6');
Any help will be appreciated.
Thanks,
Ari.
I'm using IrriBase 20.07 (The latest update).
I'm trying to write a SQL query to update pipes usage that will do this:
1. clear all pipe usages (the first UPDATE Statment in the code below).
2. assgin new usages to pipes (the second and third UPDATE Statments in the code below)
in the test query I worte (see below) thre are 3 update statments, and if I run each one of them individually they works,
but when trying to run them togther I get An error "Characters found after end of SQL statement".
I've looked in SQL forums and it looks like the syntax is ok.
here is the query I'm trying to run (3 UPDATE statments in one query):
UPDATE Components
SET Components.[USAGE ]= ' ' WHERE Components.[Database Number]=1 AND (Components.[USAGE] <> ' ' and Components.[USAGE] <> 'L ');
UPDATE Components
SET Components.[USAGE] = 'M ' WHERE Components.[Database Number]=1 AND (Components.[Description] = 'PE IRRIGATION PIPE 90/6');
UPDATE Components
SET Components.[USAGE] = 'M ' WHERE Components.[Database Number]=1 AND (Components.[Description] = 'PE IRRIGATION PIPE 110/6');
Any help will be appreciated.
Thanks,
Ari.