Update single character in mysql field - mysql

I have a column dedicated to keeping track of which messages on my project were viewed. It's written like "10010", a 1 denoting that the message has been seen and also without making it into many different columns. But how do I make one database call to replace just the 3rd character, or the 5th character in the field? Thanks in advance!

The comment was right. If you want more informations you can go there :
Change a character in a field
You just have to change some things (in your project, you don't want to change the first character)

Related

How to make the names stored in a list unique?

I created a variable that will prompt users to input their names 20x, the all those names will be appended into an empty list that I created, but I need a function that will constant check each name that was entered and compare it to other names in the list in order to ensure that it is unique, if similarity is found, the function should automatically add a unique number to that name to make it unique. The function should also enable users to enter not more than 20 characters and not less than 3 characters for their names. Id really appreciate it if someone can help me with this problem, thanks in advance. Also I would like it to be done with python programming language.
Here is an example of how i have tried to make the validation
CLICK THE LINK TO SEE MY EXAMPLE

How to turn off proper-case correction on a specific field?

I have an Access-based Employee table and have a field to hold username values. The username format for the application I'm tracking is FirstinitialLastname ("JDoe").
However, when I enter the username value in my Employee table, Access is automatically changing it to "Jdoe".
Is there a way for Access to accept what is being entered into this field and not change it? Searching online I see posts for how to turn on proper case, but for this particular field I don't want it to modify what I have entered.
In the near future, this Access database will be split in order to move the data out of Access and into SQL Server. Will the issue I'm having be alleviated once the data is stored in SQL Server?
Any guidance is greatly appreciated.
Thanks!
You can stop Name AutoCorrect from Access Option. Microsoft article here in this link. Set name AutoCorrect options
When you type name like JDoe then after finishing typing, access automatically correct two capital letter and it show a small smart menu. From that you can also make changes to stop auto correct. See below screenshot.
I may be misunderstanding the use of Name AutoCorrect Options and the Perform Auto Name AutoCorrect tick box as shown above.
I thought this was the very handy feature that if you had a table originally called Customers (with an s on the end) and had built many queries or forms etc based on this, when you changed the table to Customer (without the s on the end), Access would change all your SQL statements automatically for you on the your queries etc so the database didn't stop working.
Apologies if I am wrong but just wanted to check of a knock on effect because you wanted data entry values to stop being changed too.
One fix may cause a bigger issue is all I am worried about. I recently had a customer with a surname of Teh but Access kept changing his surname to The automatically so I just unticked the box for 'Replace text as you type' to stop that happening. It seems to have worked well.
I really like the Name AutoCorrect option for table or query renames etc as I used to hate having to go in an change all my queries back in the day
Apologies again if I have got the wrong end of the stick on this discussion and gone off on a very unhelpful tangent by misunderstanding things in the first place - my wife tells me I have a habit of doing this and my wife is always right

MySQL, get (just) column names and write them to a file?

I would like to get more or less what is discussed in this question.
What more? I would like to redirect the output to a file.
What less? The SHOW columns FROM your-table; actually returns a lot of stuff. In addition to column names it also shows i.e. type.
Ideally, in the end, I would like a plain text file listing one column name per line.

Insert query inside of memo Access

Is it possible to insert a query or tag inside of an access memo? I would like to create a welcome packet that will include a welcome letter along with other data pulled from Access tables. I can create a new field in a table to store the text i need but i would like to include several other pieces of information pulled from into the report. I would like to insert the data elements as if i was inserting a tag into an html page. The welcome letter should pull in the user's name and the letter address their name and other details individual to the homeowner. The other pages of the report include details about the user that are updated from several locations. Is this even possible in access? If not i will tell users that they must create the welcome letter somewhere else and attach it to the packet manually but it would save a lot of time to be able to print the letter with the packet.
I was able to resolve the problem by storing the paragraph text in new columns and setting the memo fields to "can grow" in the report. I then seperated the paragraphs with the inserted data. I will also look into Remou's options that he provided as the MS Word automation and HTML in code sound like better options.
Thanks Remou

How does a user insert a null in MS Access?

MS Access appears to support nulls in code, but I can't for the life of me figure out how to enter a null directly in a table. This is maddening because once a field has had a figure entered in it, it can never be deleted/set to null. Normally, allowing zero length strings would take care of this, but Access treats the XML export of a null and a zero length string differently. A null eliminates the associated XML tag and a zero length string sends an empty tag.
Does setting the "Allow zero length string" option in the table definition help? It may force an empty string to be interpreted as NULL.
Are you talking about needing to do it in Datasheet view? If you needed to do it in an update query, you can do it like this:
UPDATE test SET test.test = Null;
press ctrl-0 and a null is inserted.
Deleting all the characters will work, but Access is a bit fickle. Hitting backspace or delete will not work unless there are characters in the field. I find it is best to enter a few characters, select all, and hit delete, change focus and change the record. After all the above, if you run a query looking for "is null" the record will be found.
I'm actually looking for a way for a layperson to do the entry directly in a table. In MSSQL you can simply press ctrl-0 and a null is inserted. Deleting all the characters doesn't appear to work. Instead of a null, you are left with an empty string. They are not treated the same by Access for export purposes.
I think what I'm going to wind up doing is creating an xslt file to use during export that eliminates empty tags. That way the user can't really tell the difference.
It sure would be nice, though, to be able to key in a null.
Ok, I don't think this is an easily solvable problem and my original question was a little off target. The problem isn't so much with nulls, although they are involved, as with the manner in which the table was originally created. If you use an xsd file to create your tables you plan on exporting, something happens under the hood in Access that causes those fields to be treated a little differently than fields created with the editors.
The only solution I found was to create a new field in the table, rename the old field, copy the data from the old field to the new field and delete the old field.
After doing that, then blank fields that had data in them at one point are no longer included in the XML output. It's probably not the best way to do this, and I still don't know exactly why it's happening, but at least I can get past the issue.
Just delete all characters in the column and access will insert a null value for you if the coumn allows it.