Toad World® Forums

Simple Question about bind variables


#1

I am running a query with couple of bind variables in.

select isnull(w.assetno, w.pm_grp) assetno,
w.assetshortdesc,
w.assetlocn,
case when w.route_id is not null then ‘R’ when w.task_id is not null then ‘T’ when w.pm_idno is not null then ‘P’ else ‘C’ end as woType
FROM wkaw w
LEFT OUTER JOIN ast a ON w.assetno = a.assetno
LEFT OUTER JOIN wkpm m ON m.pm_idno = w.pm_idno
WHERE DATEDIFF(day,w.ORG_date, GETDATE()) between 0 and :daysCount --w.sc_date >= GETDATE() - :daysCount
AND (w.work_area = CASE WHEN :woWorkArea is null THEN w.work_area ELSE :woWorkArea END)
AND (m.status = CASE WHEN :pmStatus is null THEN m.status ELSE :pmStatus END)
AND (w.status = CASE WHEN :woStatus is null THEN w.status ELSE :woStatus END)

I get the bind variable window to appear and run the query with the appropriate data.

I then want to re run the query but setting one of the variables to null, if I delete the text in the box, it does not get set to null and sees {null} as a value

I just can’t figure how to do it.

I know I missing something somewhere, just been looking too long.

thanks

Pete


#2

Hi Pete,

Thanks. I reproduced this and it’s a issue, I have create TSS-798 for this. Sorry for your inconvenience.

Best Regards,

Kelly


#3

Thanks for the update, is there any work around that you know of ?

Or is the only way to close the app down and then re open it ?

Pete

From: Kelly.Chen [mailto:bounce-KellyChen@toadworld.com]

Sent: 05 December 2014 08:53

To: toadss@toadworld.com

Subject: RE: [Toad for SQL Server - Discussion Forum] Simple Question about bind variables

RE: Simple Question about bind variables

Reply by Kelly.Chen

Hi Pete,

Thanks. I reproduced this and it’s a issue, I have create TSS-798 for this. Sorry for your inconvenience.

Best Regards,

Kelly

To reply, please reply-all to this email.

Stop receiving emails on this subject.

Or
Unsubscribe from Toad for SQL Server - General
notifications altogether.

Toad for SQL Server - Discussion Forum

Flag
this post as spam/abuse.


#4

Hi Pete,

There is a workaround to set the var back to null: change the Type to another type and press OK. The next time you execute the SQL again, the Type will be restored
to the correct one and the value is back to null.

Thanks,

Vincent