This is probably a simple matter, but when I create a new object, the ID property starts off as 0 rather than null. As I understand it, SQLite takes/needs a value of null for the PK column to do the AutoIncrement.
So the short question is how to get the ID in the object to start life as null?
Thanks
cooter
Ok, here's what the solution seems to be. After you create the tables with PK's, open the table, right click on the left most column where the key image is and you can choose to edit Keys/Relationships. In that property screen you can set the column to auto-increment.
I also followed advice on this page.
This is all done using the most excellent tools from sqlite.phxsoftware.com/
-Cooter
Related
When I design my table, there comes a error:
Duplicate entry '??' for key 'emp_name_unique2'
My design table:
When I save it, comes the error.
Where is the problem?
EDIT
My data in t_employee:
That is, you see the emp_name, if you want to set it to unique, you should make sure the value is unique first.
You have many same ?? in the emp_name.
In general, Design table should before add data.
I am using the Logic App designer on Azure. Added "SQL Azure - Insert Row" as an Action, it prompts me to insert values for the columns but all the columns are marked as required and it doesn't save the changes/sequence if a value is not entered there.
Is there anyway of bypassing this or making the columns optional?
I tried this previously, there was no way to make the columns optional but i figured a workaround.
First, in the designer put any value, then open Code view and look for the columns you don't need and just delete it from the JSON schema and hit save :)
that should do it for you, but next time you open in designer and try to edit you have to do this again.
let me know if it helps
Edited
I added a screenshot of the steps that i made while trying to replicate this. (note that your database schema should handle these null values for the columns, in my case the Guid had a default value of newid() and the other column allowed nulls). You always pass null to the columns, not passing values at all might make sense for columns that has values computed or has default values (like newid() uniqueidentifier or getdate() for created/modified time)
I have a form. When I open the form the two fields called office and group should be picked up from another database named something like staff.nsf. The data is picked up based on the applicant name as key. I have included my name in staff database. But the form is not picking up the two fields from the staff database.
The field formula goes like this,
server := #Name([CN]; #Subset(#DbName; 1));
temp:= #If(Applicant != ""; #DbLookup( "" : "NoCache"; server:"Mast\\Staff.nsf";
"ByApplicant";Applicant; 2); "");
#If(#IsError(temp);"";temp)
Is it a system bug? Can anybody help please.
Regards,
Priya
Lotus Notes is more than 20 years old, and extremely well-tested. It is very unlikely that you have found a "system bug". There are any number of possible problems here, and you need to carefully rule them out until you find the actual problem.
The first thing you should do is take the #IsError out of the formula (temporarily). By having it there, you are suppressing a potentially useful error message. Ok... admittedly the error messages are usually not that helpful, but sometimes they are. If you don't want to take it out of your formula, just add another computed-for-display field with just the #DbLoookup -- and follow Ken's advice about hard-coding everything.
Then review all of the following:
Is "mast\staff.nsf" the correct path for the database?
Do you have access to the database?
Is "ByApplicant" the correct name for the view? (Spelling errors happen!)
Do you have access to the view?
Do you have access to the documents in the view?
As Ken mentioned, is the first column in the ByApplicant view sorted?
Is the name value you are passing for Applicant in the exact same format that appears in the view column? (I.e, if it appears in abbreviated form in the view column, make sure that you are passing it to #DbLookup in abbreviated format.)
Does the second column of the view contain the value that you are trying to read? (Check out the rules for counting columns in the documentation for #DbLookup.)
A few thoughts:
The ByApplicant view needs to have its first column sorted alphabetically and that column should be the list of applicant names you are matching on
Try hard coding the value for applicant in the #DBLookup to see if it works, and to rule it out as the problem.
This does not work on the web, only on the client (I believe)
I have a calculated column in a custom SharePoint 2007 list, with the following formula:
=CONCATENATE("IR-",[ID],"-",LEFT(UPPER([Title]),25))
If an item is created in the list, everything is fine, however, when an item is updated the [ID] column is no longer in the calculated column for that item.
So, on creation: "IR-40-TheTitleIsHere", but after edit, it is, "IR--TheTitleIsHere".
Anyone have some insight on why this would be happening?
I confirm the behavior mentioned above. Any Add/Edit will wipe out the [ID] portion. If you edit the column in the list and update the formula, it will update ALL list items to be correct (until you do an edit on the item).
I found this post that mentions the same problem.
Sounds like the only solution would be to make a simple workflow using SharePoint Designer that would update a text field in your list.
I had an issue similar a while back. Through other blogs and experts, I discovered that the [ID] column should not be used in a calculated column because it wreaks havoc and causes many errors. Sorry - remove the ID column and you should be fine.
This question is a little old, but I had the same issue and found a solution for it. It is a pretty specific fix and won't help everyone -- it involves using javascript in a content editor web part to update the calculated field.
This site -- http://blog.pathtosharepoint.com/2008/09/01/using-calculated-columns-to-write-html/ -- gives an example of how to use javascript in the same manner that I used it.. the important block of code is the first while loop. The point is to grab the out of box ID column from the list and update whatever calculated field needs the ID.
In my case I had a URL in a calculated field that required the ID as a parameter.. of course that wouldn't work normally because you can't put the ID in a calculated field. What I did was I put "?ID=null" in the ID parameter of my calculated field's url, I then replaced that with the ID that was retrieved using javascript.. so whenever the page is loaded, the js kicks off and updates all of the URLs to have the correct ID.
I know this is very old but I couldn't find a newer version of the question anywhere else and the answer above from ferr solved the problem for me but isn't very clear so I thought I'd update it.
This assumes that you want to use the ID in the output HTML (for example within a link), I think this is fairly common.
Using the javascript from the pathtosharepoint link I added in the following to get the id with an if statement for safety:
if (HTMLregexp.test(CellContent)) { //original pathtosharepoint line
if (NodeSet[i].parentNode.getAttribute("iid")){
var SPID = NodeSet[i].parentNode.getAttribute("iid").split(",")[1];
CellContent = CellContent.replace("SPIDReplace", SPID)
}
NodeSet[i].innerHTML = CellContent; //original pathtosharepoint line
This is put in the while loop of the latest pathtosharepoint fix at time of writing. This works for me on SharePoint 2010.
Note: Include the string "SPIDReplace" in your calculated column to get it replaced by the item ID.
pathtosharepoint page: http://blog.pathtosharepoint.com/category/calculated-columns/
pathtosharepoint code: http://pathtosharepoint.com/Downloads
Has anyone ever made a sharepoint lookup column that allows fill inn choices and does writeback to the list it does lookup from? what would it take to make such a column?
If a 3.rd party solution is arround that would be realy great to :)
Cheers!
You'll need to create a custom field type:
http://msdn.microsoft.com/en-us/library/ms446361.aspx
On a project i've worked on we used a TagControl FieldType, with an entry field and a multiple select field. A user could enter a new Tag or select an existing one. If you are interested, i could send you the code.