Ultraedit on Mac - delete key is same as backspace; how do you delete to right instead? - keyboard-shortcuts

In my installation of Ultraedit, the delete key does the same as the backspace key. That is, it deletes to the left. How do you make the delete key delete to the right? Or what other way can that be done?

Related

Defining ON DELETE CASCADE in pgAdmin 3

I can't find how to add ON DELETE CASCADE rule in pgAdmin 3. I want to achieve that if a record in the parent table is deleted, then the corresponding records in the child table will automatically be deleted.
Still, I can't find this option when creating tables visually in pgAdmin.
I can see something like this:
But none of this seems to offers option to achieve what I want... Any ideas how to do it through pgAdmin?
Oh, I just found it, it was simple, but still I will post it for future readers with a same question. When creating foreign key constraint there is Action tab and from there it is possible to define what you want to happen on update, or on delete:

SQLServer foreign key wont let me add constraint with cascade (on delete or update)

I have a simple datamodel in my database with three tables:
State
Ticket
SubTicket
One ticket can have zero to multiple subtickets.
Every ticket and every tubticket can have one state.
So my database looks like this:
between: xTicket and xState i have the constraint:
on update cascade / on delete no action (updating the StateID in xTicket when changed, probihit deleting the entry in xTicket)
between: xSubTicket and xTicket I have the constraint:
on update cascade / on delete cascade (updating the TicketID in xSubTicket and deleting an entry when an entry in xTicket is deleted)
but when I want to the same constraint as for xTicket and xState for:
on update cascade / on delete no action I get the following message:
Foreign key constraint may cause cycles or multiple cascade paths
the foreign key will only let me set the constraint ON UPDATE CASCADE to either between xTicket and xState or between xSubTicket and xState.
so far I have found other questions about the same issue, where I got to know: either change the database design properly or the use of INSTEAD OF Triggers. - I actually want to know why this design is not acceptable, what am I doing wrong? How do I do it correctly?
thanks for any suggestion in advance
I actually want to know why this design is not acceptable,
Why do you think ti is not acceptable? This is merely a limitation of SQL Server. An inconvenient one.
You are free to code around it and use triggers to do the cascading operations.
I would ague your design is broken because hard deleting states should never happen and you try to do the database do cleanup that may well be more complex. I would go for a soft delete (marking a state as not available for new objects) so the cascade operations make no sense there. But that is another discussion and outside of the topic of your question.

Delete row with foreign key constraints and no cascade deleting SQL

Trying to figure out how to delete a row in a SQL table that has multiple foreign keys pointing to it, and more keys pointing to those, etc, etc. Cascading Deletes aren't turned on (I have no control to turn them on), and I'm trying to avoid performing a delete on EVERY single row that is affected by this one delete.
So if I have table XXX, with columns YYY and ZZZ, where YYY is the primary key and ZZZ is a column that has multiple foreign keys pointing to it, how would I go about deleting a row based on the primary key value?
Syntax would be:
DELETE FROM XXX
WHERE YYY = some_value
Is this even possible (without performing a ton of individual deletes)? And if so, how would I do it?
No.
Either you need the foreign key constraints to cascade the delete (something I'm not terribly fond of, it makes it too easy for some application/ developer to think they can delete and re-insert some data rather than updating it in place without inadvertently causing all the child rows to be deleted) or you have to delete the child rows before you delete the parent.
Normally, if you want to delete the data from the child tables, it is easier to just manually write the various DELETE statements. It would be possible to query the data dictionary (dba_constraints, dba_cons_columns, etc.) and dynamic SQL to walk all the constraints and generate the appropriate DELETE statements. In the vast majority of cases, it wouldn't make sense to do that unless you're trying to generate delete statements for a large number of tables.
How about turning off the foreign key constraint check?
SET FOREIGN_KEY_CHECKS = 0;
Then turning it on back when you delete the row?
SET FOREIGN_KEY_CHECKS = 1;

Test whether record is referenced as foreign key before delete

Is there an easy way to test whether the primary key of a record is referenced in any other table in the database without going and searching for said primary key in all the applicable tables?
I want to know before I get to the exception, and disable a delete button.
The way I normally deal with this foreign keys and references are by using EXISTS (Transact-SQL). By doing it this way, you have to use one EXISTS for every foreign key you want to check.
Another way of dealing with it is just to catch the exception and handling it in the code.

Changing a record in a table (sql server) that has foreign keys?

Does anyone know if there is a quicker way of editing a record that has foreign keys in a table (in sql server).. i will explain.. i have approx 5 tables that have there own ID but are linked together using a foreign key...
Hence i needed to change the foreign key (the contract number in my case), but i had to copy each record to a new record and edit it that way...
As if i try to edit the contract number it gives me the standard error of being associated and violates a foreign key etc
Surly there must be a better way?
ANy ideas?
are you talking about changing the PK and then updating all the Fks? In that case enable cascade updates and this will be done automagically
same with deletes, you enable cascade deletes
ON DELETE CASCADE
Specifies that if an attempt is made to delete a row with a key referenced by foreign keys in existing rows in other tables, all rows containing those foreign keys are also deleted. If cascading referential actions have also been defined on the target tables, the specified cascading actions are also taken for the rows deleted from those tables.
ON UPDATE CASCADE
Specifies that if an attempt is made to update a key value in a row, where the key value is referenced by foreign keys in existing rows in other tables, all of the foreign key values are also updated to the new value specified for the key. If cascading referential actions
I'm not an SQL expert, but can't you set something like ON UPDATE CASCADE to automatically update the foreign key when the primary key is changed?
Or try disabling the integrity constraint, do your changes and attempt to re-enable the constraint. Basically, if you didn't do it right you will get an error then (can't enable a constraint that would be violated).