I am unable to insert a pointer to a rack object using INSERT INTO in a script.
I have assigned pointer data to the 'Rack' column...
In my script, I have a valid reference to a rack object. Here is a snippet...
Array myracks = ["Rack_D40_A"]; // cycle thru array of racks for (int i = 1; i <= myracks.length; i++) { Storage.Object rack = Model.find(myracks[i]);
later in the script, I attempt to insert a pointer to the 'rack' object..
Table.query("INSERT INTO RackVolumeTable2 (Rack) VALUES ( " + rack + " )" );
but get these errors..
I've even tried hard coding the object...
Table.query("INSERT INTO RackVolumeTable2 (Rack) VALUES ( " + Model.find("Rack_D40_A") + ")" );
but get same errors.
If I assign the column as string data, I can successfully insert the name like this..
Table.query("INSERT INTO RackVolumeTable2 (Rack) VALUES (' " + rack.name + " ')");
However, I prefer to insert a pointer to the object itself. I believe part of the issue is that 'rack' is a Storage.object and not a node (?), but hard coding the object using Model.find should have worked. What am I missing?? - Stan