Writing Boolean variables to MS SQL Server

Unanswered Question
May 11th, 2010
User Badges:

I cannot figure this out.

In the script I'm working on, a boolean variable can be dynamic either True / False ,etc

I cannot get the syntex correct to write this variable to a "binary" datatype column in SQL Server.

Column name in database is Binary

I have tried :

UPDATE da-database
SET [email protected]
WHERE First=400


SET Binary=&bStatus
WHERE First=400


SET Binary=bStatus
WHERE First=400

But if I use


SET Binary=1
WHERE First=400

It sets the field to true i.e, Works correctly.  Just get get it going with a variable.

  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 0 (0 ratings)
kkelly Wed, 05/12/2010 - 11:24
User Badges:

it is UCCX and

I'm having issues writing to a database doing any variable substitution.

I gave up on the boolean and decided to use just strings but hitting Null.Pointer Exceptions even though (IMHO) things are correct.

Is there a particular varaible type that I should defining in SQL that works "best" with the java beans and IPCC?

Gergely Szabo Thu, 05/13/2010 - 07:01
User Badges:
  • Green, 3000 points or more
  • Community Spotlight Award,

    Member's Choice, December 2015

Hi, can you post the SQL query (the one generating Nullpointers)? G.


This Discussion