• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

SQLServerException: Incorrect syntax near / SQLServerException: Must declare the scalar variable

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

In my Java code I am getting an Sql Exception : .
When I remove all the U's from my statement then I am getting

This is my stored proc.



Can someone please help?
 
Rancher
Posts: 4614
47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why are you doing an EXEC in there?
Why not simply call the UPDATE directly?
 
Rico Strydom
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is a difference?
 
Dave Tolls
Rancher
Posts: 4614
47
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, yes.
The EXEC is for interpreting and executing a string.
T-SQL can run queries directly.

It's the use of EXEC that's causing you your problem.
 
    Bookmark Topic Watch Topic
  • New Topic