How to avoid & popup when SQL query contain '&' letter? - sql

I am writing a migration script where I replaced html encoded values by original values like & will get replaced by &. So my SQL query has & letter but when I execute this query it give me popup for every & to replace that character which is as shown below
After clicking on OK its giving anexpecetd result but actually this popup should not come for every &. What should have to do to avoid this popup?

At the top of your script, add:
set define off;

Related

Pentaho spoon + redoing field enclosures in output file

I'm new to Pentaho 8.3 CE (Spoon) and am trying add an extra column to a CSV file by concatenating 3 other text fields together. I'm using 2 options - Calculator and the inbuilt 'Concat fields' transformations.
The issue I'm facing is that some rows are enclosed by " " while others aren't... e.g.
Field A = "One thing, another thing"
Field B = Yet another thing
Field C = Final thing
Ideally, I want,
New field = "One thing, another thing Yet another thing Final thing",
I find I can't get the final " to enclose each line, so it looks like "One thing, another... Final thing
How do I get Pentaho to add that final " on? I've set to force the enclosure on.
enter image description here
First strip the double quotes with a String operations step or a Replace in String step (the latter allows regexp search and replace).
The use a Concat strings step to join them all together comma separated.
Finally, either prepend & append double quotes, or when writing out with e.g. a text file output, add the enclosure character.

Search for a field that contains ampersand mark

I have a field that contains values such as
fish & chips
When I try to search for this field
Select * From Menu WHERE FoodItem = 'fish & chips'
It returns nothing despite all the matching entries in the table.
Now I realised this is an issue with the ampersand(&) mark. One workaround would be to change all 'fish & chips' to 'fish and chips'. But I would rather not play with that many data.
Also, I don't want to use LIKE or CONTAINS because I want to match things exactly.
How can I write a WHERE statement that will work with the & mark?
Thanks!
Cheers!
Some information is missing. It simply just works given the description of information provided unless you've got a trigger or something that is stripping the & on INSERT or UPDATE.
Verify that the data in the table actually still contains the &.
For example, as you can see here, searching on that character in your string is returning as it should.

Microsoft Access search query

I have a search query that compare the text from text box with my database table untill now I have no problem and every thing works good .. but when I want to make the query compare part of text with database here I have the problem. For example if I have record "USA". I want to type "us" in the text box the query must have a result "USA".
Here is my query:
SELECT Goods.ID, Goods.Name, Goods.Description,
Goods.CatID, Goods.SubCatId, Goods.DealerPrice,
Goods.SuperDealerPrice, Goods.EndUserPrice,
Goods.BarCode, Goods.Quantity
FROM Goods
WHERE (((Goods.CatID)=Forms!Form1!Text58)
And ((Forms!Form1!Text78) Is Null))
Or (((Goods.SubCatId)=Forms!Form1!Text78))
Or (((Goods.BarCode)=Forms!Form1!Text115))
Or (((Goods.Name)= Forms!Form1!Text115))
Or ((Goods.Description) Like [Forms]![Form1]![Text115]);
I know in sql I must to put "%" in the query but it's not work.
Can any one show me how to make the change on this code here and I will make the others:
((Goods.Description) Like [Forms]![Form1]![Text115]);
Use * in Access.
((Goods.Description) Like "*" & [Forms]![Form1]![Text115] & "*")
Or you can use alike if you plan to use %.
((Goods.Description) alike "%" & [Forms]![Form1]![Text115] & "%")

how can I disable rows in my gridview with datasource rowfilter?

How can I hide rows in my Gridview with a specific value? For example I want to hide all rows with column("dubletten_Vorschlaege") is empty
skmTabelle.SLXADRIUMDEVDataSet.Tables("SKM2").DefaultView.RowFilter = "Dubletten_Vorschlaege =Nothing"
said he cant find the column nothing?
skmTabelle.SLXADRIUMDEVDataSet.Tables("SKM2").DefaultView.RowFilter = "Dubletten_Vorschlaege ="""
said he cannot read the statement at """
I've never used rowfilter so I hope someone can explain.
Edit:
thx levi, it doesn't throw an exception now. But the gridview doesn't change. how do I do that? Do I need to use the fill query again?
on the formload event I have
Me.SKM2TableAdapter.Fillg(Me.SLXADRIUMDEVDataSet.SKM2, Module1.pkey)
which only selects the rows which are new.
for example I imported new 2000 rows it only shows them.
Do I need to use this statement again?
I would refer you to this site for a few tips on using rowfilter.
http://www.csharp-examples.net/dataview-rowfilter/
In your case, I think the proper way may be to write the string like this. I have followed a similar approach and this worked.
...DefaultView.RowFilter = "Dubletten_Vorschlaege ='" & "'"
you will notice that i add a single quote after the = and again add a single quote within double quotes after the &.
Also, I refer you to this StackOverflow link
How do I check for blank in DataView.RowFilter
The user simply added the line of code as this:
...DefaultView.RowFilter = "Dubletten_Vorschlaege = ''"
notice the two single qoutes before the ending double quote.

SSRS expression and free text in the same textbox

Is it possible?
I would like to place the following inside a textbox:
There are =Count("MyDataSet") records found.
But if I place that in the expression on the textbox it just displays as above instead of getting the value.
Now I know if I were to split the above in two different textbox works ok but for spacing reasons it would be better if I could just use one?
Is that possible?
You need an expression in the textbox that specifies the text strings and concatenates these to your count value, something like:
="There are " & CountRows("MyDataSet") & " records found"