enable-update-delete-insert a row when radio buttons pressed - oracleforms

I had tabular with 10 number of display items which is disabled update delete insert property and also the text_items so at initialization of form most likely are disabled. I tried to add radio button so when user select a row only selected row will be enabled its
text_items and update delete insert property when user move to another record
it will disabled again but I am getting this error message
ORA-00904: "RADIO_GROUP33": invalid identifier
SELECT ROWID,column1,column2,column3,RADIO_GROUP33 FROM table1

Just for sharing my problem that I was navigating through multiple forms using
OPEN_FORMS which is by default has NO_SHARE_DATA_LIBRARY I had replace it with
CALL_FORM which is has same parameters as OPEN_FORMS but it is allow forms to do update insert and delete transactions for more understanding Please refer to oracle forms builder help search for OPEN_FORM AND CALL_FORM key words
Thanks

Related

MSACCESS, how to edit a record after insert using the "after insert" trigger

MS Office 365 ProPlus, Access 2007 - 2016
I'm trying/failing to change the value of a field in a table after it is inserted using the "after insert" trigger. Something like this...
EditRecord
SetField
Name orig_id
Value = [mytable].[id]
End EditRecord
This doesn't seem to work.
USysApplicationLog gives...
SourceObject = mytable.AfterInsert
DataMacro InstanceID = {489D5697-5247-44A8-AE3C-3773A25F72E5}
Error Number = -20335
Category = Execution
Object Type = Macro
Description = EditRecord failed because the default alias represents a record which is read only.
The field is not read only. After the fact I can edit it just fine. I don't know what the "default alias" is nor what that even means.
If the trigger can't do this, can you think of another way to accomplish the same thing ?
You don't want to use the AfterInsert, since then the record is already saved, and tucked away nicely, and everything you need to change in that record is assumed to have been done. In fact, the default context will cause the record in question to be read only. You CAN get around this by pulling the record again, (looking up a record), but if you modify it again then all of the triggers for that record will fire again.
So I ONLY suggest you use this event to sum() or add/edit OTHER tables, but not the record that was just edited and saved.
If you need/want to update this current record, then move your "edit" or "modify" code to the "BeforeChange". This event not only lets you edit/modify right before the save (and thus preventing endless loops in which the update triggers fire again and again), but the CURRENT record is in full context, and you don't even need any "edit record" command, since you have the fresh un-saved record right in context. You thus can use SetField without the need for EditRecord.
So, the AfterInsert is really too late here, and if you could modify the record in that event, you will cause the AfteUpdate event to fire again if you do use a workaround.
Now, if you use BeforeChange, it will fire for both insert and edits (change). So, if your code really only needs to run when inserting, you can check this status by using
If [isinsert] = True then
Edit
Also, it looks like your code is attempting to save (capture) the previous value, and if it is, then you can use:
[old].[id]
Of course this does not make too much sense for "id", since that is usually an autonumber PK column, but for grabbing other values during an update in the BeforeChange event, you can certainly test + inspect the previous (old) values.

Google App Maker - autofill textbox depending on dropdown selected option from an external database

What I'm currently doing is that on the Property Editor of my dropdown widget, on the Event Section using the onValueEdit function, I'm trying to create a custom action script which will give a value to my textbox (using widget.root.descendants.NameOfMyTextbox.value) depending on the selected value of my dropdown.
The values of my dropdown are the IDs stored in my MySql database table Process, for example: ID = 1, name = Assembly, manager = George. For the textbox, I would like to get another table field value depending on the selected value of my dropdown through a select statement (like getting the manager value). What kind of app maker queries or functions should be useful in this case?
If your dropdown option binding is #datasources.Process.items then your onValueEdit event simply needs to be:
widget.root.descendants.NameOfMyTextbox.value = newValue.manager;
This would be the only way to set this up however, because this way the options are pointing to your entire record in the Process table and upon selection you can get any other field from that record using newValue.YourField.

How to update a value in DB without calling edit method in rails4

so I'm trying to update a date field from a page which has form_for tag
In db I have a table with one row & one column
So basically I want to update the date field in that first row rather than adding new every time
I am able to do this using 2 different page like:
Which has link to edit that particular record
To edit value and updates the value in db
Now I don't want to click on edit and then able to update, I want to directly update it right from the first page it self
If I use form_for tag in my index.html.erb I'm getting error that First argument in form cannot contain nil or be empty but the same I am able to access from edit.html.erb
Thats because your index and update action has different parameters.
For the update action, you have the model object for form_forset. Hence it works. But in index action, it has the list of all records.
You need to iterate over a each model object and create a form for it.
best_in_place gem does exactly what you are trying to achieve

Dynamically selecting MySQL updates

This is more of a theory question. I have a page with a bunch of various textfields, dropdown boxes, etc. Each user has his/her "own page" that can be updated via this update page that I am referring to. He updates the fields at his choosing. It passes about 30 variables (if every field is inputted) to a "preview page". If the person likes the preview page, then they click an "update" button at the bottom of the preview page and all the various variables are updated into the appropriate MySQL table and their "own page" that others see is updated dynamically. (let me know if this explanation isn't clear).
Inserting this information for the first time is easy. However, when a user wants to update only a few of the fields for his page later, this is where I am confused. How do I make the MySQL update query dynamic to recognize an update to ONLY the fields on the page that the user wants to update (while he leaves the other fields blank, thus leaving the old information intact for those columns, and they are disregarded in the update query).
Let me know if what I'm asking doesn't make sense and I'll try again.
Thanks for your help.
The easiest way to do this would be
UPDATE MyTable m SET m.f1 = COALESCE(input1,m.f1), m.f2 = COALESCE(input2,m.f2), ....
WHERE m.id = key;
The COALESCE will return the first non-null value (or null if all values are null).
Note that you can insert a default value after the existing field value if you want to force a default.
Like so:
UPDATE MyTable m SET m.f1 = COALESCE(input1,m.f1,default1), m.f2 = COALESCE(input2,m.f2,default2), ....
WHERE m.id = key;
See: MySQL: how to use COALESCE
http://dev.mysql.com/doc/refman/5.0/en/comparison-operators.html#function_coalesce

Does LINQ to SQL support Single Unit of work only or can I persist the Context and do Next operation?

I have a windows application. I am trying to insert a record through a DataContext. It has Unique identifier in the table. Even I am executing a trigger after insertion. So I am making a select query in the end of the trigger to get the auto generator number and to avoid auto-sync error. As it's a windows application I can keep the Context for longtime. When I create a new object ( for example order) and do the same previous operation, upon SubmitChanges operation, it shows cannot have duplicate key. Why can't I use this same Context to Insert the second record? Or do I need to create a new Context to insert a new Record?(Does this Unit of work Concept comes here?). Creating new Context is bad idea as I need to load all data again..
Any thought?
Some code sample to explain my situation:
CallCenterLogObjCotext = (CallCenterLogObjCotext == null ? (new CallcenterLogContext) : (CallCenterLogObjCotext));
CallDetail newCallDetailsOpenTicket = new CallDetail();
newCallDetailsOpenTicket.CallPurpose = (from callpuposelist in CallCenterLogObjCotext.CallPurposes
where callpuposelist.CallPurposeID == ((CallPurpose)(cbcallpurpose.SelectedItem)).CallPurposeID
select callpuposelist).FirstOrDefault();
Lots of settings like this ...
CallCenterLogObjCotext.CallDetails.InsertOnSubmit(newCallDetailsOpenTicket);
CallCenterLogObjCotext.SubmitChanges();
As I mentioned above, this is a click on Open Ticket button on windows form. I change the values of fname, lname and all in the textboxes available on that form and clicked the same button.
So it will call the same method again. I get the below specified error:
System.Data.Linq.DuplicateKeyException: Cannot add an entity with a key that is already in use.
You can insert more than one row with the same context object, see http://weblogs.asp.net/scottgu/archive/2007/05/19/using-linq-to-sql-part-1.aspx, http://msdn.microsoft.com/en-us/library/bb425822.aspx, and other numerous online examples. The duplicate key issue could be a linq to sql configuration issue, or a database integrity error, i.e. such as if you have a natural primary key on a table and are trying to insert a row with the same natural primary key more than once.