Search code examples
sqllocalparadox

Paradox Sql Local Update with Case Statments


i work with Paradox (SQL Local) and i want to Update two lines of one table with two differents values. I can do that with two updates commands but I want to do with ONE command.

Clearly I want to transform these two request :

 Update Table1 SET Lib = 'test1' where Code = 'Code1'
 Update Table1 SET Lib = 'test2' where Code = 'Code2'

in one request.

I try this :

Update Codiv Set Lib = 
                      (CASE Code WHEN 'Code1' THEN 'test1' 
                                 WHEN 'Code2' THEN 'test2'  ELSE Lib END)  
             Where Objet LIKE 'Object' AND Code  IN ('Code1', 'Code2')

But i have an error near the element "Code".


Solution

  • Paradox local SQL does not allow CASE statements.