Search Results

Search found 19103 results on 765 pages for 'foreign key'.

Page 5/765 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Merge replication server side foreign key violation from unpublished table

    - by Reiste
    We are using SQL Server 2005 Merge Replication with SQL CE 3.5 clients. We are using partitions with filtering for the separate subscriptions, and nHibernate for the ORM mapping. There is automatic ID range management from SQL Server for the subscriptions. We have a table, Item, and a table with a foreign key to Item - ItemHistory. Both of these are replicated down, filtered according to the subscription. Item has a column called UserId, and is filtered per subscription with this filter: WHERE UserId IN (SELECT... [complicated subselect]...) ItemHistory hangs off Item in the publication filter articles. On the server, we have a table ItemHistoryExport, which has a foreign key to ItemHistory. ItemHistoryExport is not published. Entries in the Item and ItemHistory tables are never deleted, on the server or the client. However, the "ownership" of items (and hence their ItemHistories) MAY change, which causes them to be moved from one client subscription/partition to another from time to time. When we sync, we occasionally get the following error: A row delete at '48269404 - 4108383dbb11' could not be propagated to 'MyServer\MyInstance.MyDatabase'. This failure can be caused by a constraint violation. The DELETE statement conflicted with the REFERENCE constraint "FK_ItemHistoryExport_ItemHistory". The conflict occurred in database "MyDatabase", table "dbo.ItemHistoryExport", column 'ItemHistoryId'. Can anyone help us understand why this happens? There shouldn't ever be a delete happening on the server side.

    Read the article

  • Can I use foreign key restrictions to return meaningful UI errors with PHP

    - by Shane
    I want to start by saying that I am a big fan of using foreign keys and have a tendency to use them even on small projects to keep my database from being filled with orphaned data. On larger projects I end up with gobs of keys which end up covering upwards of 8 - 10 layers of data. I want to know if anyone could suggest a graceful way of handling 'expected errors' from the MySQL database in a way that I can construct meaningful messages for the end user. I will explain 'expected errors' with an example. Lets say I have a set of tables used for basic discussions: discussion questions responses users Hierarchically they would probably look something like this: -users --discussion ---questions ----responses When I attempt to delete a user the FKs will check discussions and if any discussion exist the deletion is restricted, deleting discussion checks questions, deleting questions checks responses. An 'expected error' in this case would be attempting to delete a user--unless they are newly created I can anticipate that one or more foreign keys will fail causing an error. What I WANT to do is to catch that error on deletion and be able to tell the end user something like 'We're sorry, but all discussions must be removed before you can delete this user...'. Now I know I can keep and maintain matching arrays in PHP and map specific errors to messages but that is messy and prone to becoming stagnant, or I could manually run a set of selects prior to attempting the deletion, but then I am doing just as much work as without using FKs. Any help here would be greatly appreciated, or if I am just looking at this completely wrong then please let me know. On a side note I generally use CodeIgniter for my application development, so if that would open up an avenue through that framework please consider that in your answers. Thanks in Advance

    Read the article

  • Sort queryset by a generic foreign key (django)?

    - by thornomad
    I am using Django's comment framework which utilizes generic foreign keys. Question: How do I sort a given model's queryset by their comment count using the generic foreign key lookup? Reading the django docs on the subject it says one needs to calculate them not using the aggregation API: Django's database aggregation API doesn't work with a GenericRelation. [...] For now, if you need aggregates on generic relations, you'll need to calculate them without using the aggregation API. The only way I can think of, though, would be to iterate through my queryset, generate a list with content_type and object_id's for each item, then run a second queryset on the Comment model filtering by this list of content_type and object_id ... sort the objects by the count, then re-create a new queryset in this order by pulling the content_object for each comment ... This just seems wrong and I'm not even sure how to pull it off. Ideas? Someone must have done this before. I found this post online but it requires me handwriting SQL -- is that really necessary ?

    Read the article

  • List all foreign key constraints that refer to a particular column in a specific table

    - by Sid
    I would like to see a list of all the tables and columns that refer (either directly or indirectly) a specific column in the 'main' table via a foreign key constraint that has the ON DELETE=CASCADE setting missing. The tricky part is that there would be an indirect relationships buried across up to 5 levels deep. (example: ... great-grandchild- FK3 = grandchild = FK2 = child = FK1 = main table). We need to dig up the leaf tables-columns, not just the very 1st level. The 'good' part about this is that execution speed isn't of concern, it'll be run on a backup copy of the production db to fix any relational issues for the future. I did SELECT * FROM sys.foreign_keys but that gives me the name of the constraint - not the names of the child-parent tables and the columns in the relationship (the juicy bits). Plus the previous designer used short, non-descriptive/random names for the FK constraints, unlike our practice below The way we're adding constraints into SQL Server: ALTER TABLE [dbo].[UserEmailPrefs] WITH CHECK ADD CONSTRAINT [FK_UserEmailPrefs_UserMasterTable_UserId] FOREIGN KEY([UserId]) REFERENCES [dbo].[UserMasterTable] ([UserId]) ON DELETE CASCADE GO ALTER TABLE [dbo].[UserEmailPrefs] CHECK CONSTRAINT [FK_UserEmailPrefs_UserMasterTable_UserId] GO The comments in this SO question inpire this question.

    Read the article

  • What does this ssh error mean?

    - by kevin
    This is my last resort. I've been trying to figure out the problem here for hours. Here's the deal: I have copied my private key from machine #1 onto machine #2. Machine #1 is able to connect via ssh to a server with my public key just fine, but machine #2 gives the following output, when trying to connect to the server: $ ssh -vvv -i /home/kevin/.ssh/kev_rsa [email protected] -p 22312 OpenSSH_5.3p1 Debian-3ubuntu6, OpenSSL 0.9.8k 25 Mar 2009 debug1: Reading configuration data /etc/ssh/ssh_config debug1: Applying options for * debug2: ssh_connect: needpriv 0 debug1: Connecting to 192.168.1.244 [192.168.1.244] port 22312. debug1: Connection established. debug3: Not a RSA1 key file /home/kevin/.ssh/kev_rsa. debug2: key_type_from_name: unknown key type '-----BEGIN' debug3: key_read: missing keytype debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace ... Permission denied (publickey). There is obviously more debug output that I have omitted, and I can provide upon request. I am convinced however that it doesn't like my private key file. I also had a suspicion that it has to do with how I copied it from machine #1 to machine #2. I copy/pasted the text from the private key onto a flash drive. This might be the problem, however, when I duplicated this method on another working private key file, and did a diff on the original, to the copy/pasted one, they are identical. I've been struggling with this. If I could just get a little more information on why it doesn't like my key, I could fix it I'm sure. Anyone have any ideas on this? Is there some meta-data somewhere that tells ssh that a file is in fact an RSA key?

    Read the article

  • [rails] do we need database level constraints

    - by shrimpy
    i have the same problem as in the following post http://stackoverflow.com/questions/1451570/ruby-on-rails-database-migration-not-creating-foreign-keys-in-mysql-tables so i am wondering, why rails do not support generate foreign key by default??? it is not necessary??? or we suppose to do it manually?

    Read the article

  • Ubuntu 12.04 + Eclipse 64 bits key binding error

    - by user110933
    The text is quite extense so, this is just a part of it: !SESSION 2012-11-23 10:15:52.442 ----------------------------------------------- eclipse.buildId=I20120608-1200 java.version=1.7.0_09 java.vendor=Oracle Corporation BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_US Command-line arguments: -os linux -ws gtk -arch x86_64 !ENTRY org.eclipse.jface 2 0 2012-11-23 10:16:06.408 !MESSAGE Keybinding conflicts occurred. They may interfere with normal accelerator operation. !SUBENTRY 1 org.eclipse.jface 2 0 2012-11-23 10:16:06.408 !MESSAGE A conflict occurred for ALT+SHIFT+R: Binding(ALT+SHIFT+R, ParameterizedCommand(Command(oracle.eclipse.tools.common.services.ui.refactor.rename.command,Rename, Rename the selected text., Category(org.eclipse.jdt.ui.category.refactoring,Refactor - Java,Java Refactoring Actions,true), oracle.eclipse.tools.common.services.ui.refactor.internal.ArtifactRefactoringCommandHandler, ,,true),null), org.eclipse.ui.defaultAcceleratorConfiguration, org.eclipse.ui.contexts.window,,,system) Binding(ALT+SHIFT+R, ParameterizedCommand(Command(org.eclipse.jdt.ui.edit.text.java.rename.element,Rename - Refactoring , Rename the selected element, Category(org.eclipse.jdt.ui.category.refactoring,Refactor - Java,Java Refactoring Actions,true), , ,,true),null), org.eclipse.ui.defaultAcceleratorConfiguration, org.eclipse.ui.contexts.window,,,system) !ENTRY org.eclipse.ui.workbench 4 0 2012-11-23 10:16:10.409 !MESSAGE An unexpected exception was thrown. !STACK 0 java.lang.NullPointerException at org.eclipse.ui.internal.WorkbenchWindow.putToolbarLabel(WorkbenchWindow.java:1697) at org.eclipse.ui.internal.menus.MenuAdditionCacheEntry.createToolBarAdditionContribution(MenuAdditionCacheEntry.java:208) at org.eclipse.ui.internal.menus.MenuAdditionCacheEntry.createContributionItems(MenuAdditionCacheEntry.java:177) at org.eclipse.ui.internal.menus.TrimContributionManager.update(TrimContributionManager.java:224) at org.eclipse.ui.internal.WorkbenchWindow.updateLayoutDataForContents(WorkbenchWindow.java:3874) at org.eclipse.ui.internal.WorkbenchWindow.setCoolBarVisible(WorkbenchWindow.java:3675) at org.eclipse.ui.internal.ViewIntroAdapterPart.setBarVisibility(ViewIntroAdapterPart.java:203) at org.eclipse.ui.internal.ViewIntroAdapterPart.dispose(ViewIntroAdapterPart.java:106) at org.eclipse.ui.internal.WorkbenchPartReference.doDisposePart(WorkbenchPartReference.java:737) at org.eclipse.ui.internal.ViewReference.doDisposePart(ViewReference.java:107) at org.eclipse.ui.internal.WorkbenchPartReference.dispose(WorkbenchPartReference.java:684) at org.eclipse.ui.internal.WorkbenchPage.disposePart(WorkbenchPage.java:1801) at org.eclipse.ui.internal.WorkbenchPage.partRemoved(WorkbenchPage.java:1793) at org.eclipse.ui.internal.ViewFactory.releaseView(ViewFactory.java:257) at org.eclipse.ui.internal.Perspective.dispose(Perspective.java:292) at org.eclipse.ui.internal.WorkbenchPage.dispose(WorkbenchPage.java:1872) at org.eclipse.ui.internal.WorkbenchWindow.closeAllPages(WorkbenchWindow.java:894) at org.eclipse.ui.internal.WorkbenchWindow.hardClose(WorkbenchWindow.java:1729) at org.eclipse.ui.internal.WorkbenchWindow.busyClose(WorkbenchWindow.java:730) at org.eclipse.ui.internal.WorkbenchWindow.access$0(WorkbenchWindow.java:715) at org.eclipse.ui.internal.WorkbenchWindow$6.run(WorkbenchWindow.java:867) at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) at org.eclipse.ui.internal.WorkbenchWindow.close(WorkbenchWindow.java:865) at org.eclipse.jface.window.WindowManager.close(WindowManager.java:109) at org.eclipse.ui.internal.Workbench$18.run(Workbench.java:1114) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) at org.eclipse.ui.internal.Workbench.busyClose(Workbench.java:1111) at org.eclipse.ui.internal.Workbench.access$15(Workbench.java:1040) at org.eclipse.ui.internal.Workbench$25.run(Workbench.java:1284) at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) at org.eclipse.ui.internal.Workbench.close(Workbench.java:1282) at org.eclipse.ui.internal.Workbench.close(Workbench.java:1254) at org.eclipse.ui.internal.WorkbenchWindow.busyClose(WorkbenchWindow.java:727) at org.eclipse.ui.internal.WorkbenchWindow.access$0(WorkbenchWindow.java:715) at org.eclipse.ui.internal.WorkbenchWindow$6.run(WorkbenchWindow.java:867) at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) at org.eclipse.ui.internal.WorkbenchWindow.close(WorkbenchWindow.java:865) at org.eclipse.jface.window.Window.handleShellCloseEvent(Window.java:741) at org.eclipse.jface.window.Window$3.shellClosed(Window.java:687) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:98) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1276) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1300) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1285) at org.eclipse.swt.widgets.Shell.closeWidget(Shell.java:617) at org.eclipse.swt.widgets.Shell.gtk_delete_event(Shell.java:1191) at org.eclipse.swt.widgets.Widget.windowProc(Widget.java:1750) at org.eclipse.swt.widgets.Control.windowProc(Control.java:5116) at org.eclipse.swt.widgets.Display.windowProc(Display.java:4369) at org.eclipse.swt.internal.gtk.OS._gtk_main_do_event(Native Method) at org.eclipse.swt.internal.gtk.OS.gtk_main_do_event(OS.java:8295) at org.eclipse.swt.widgets.Display.eventProc(Display.java:1192) at org.eclipse.swt.internal.gtk.OS._g_main_context_iteration(Native Method) at org.eclipse.swt.internal.gtk.OS.g_main_context_iteration(OS.java:2332) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3177) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2701) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2665) at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2499) at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:679) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:668) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:124) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:353) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:629) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584) at org.eclipse.equinox.launcher.Main.run(Main.java:1438) at org.eclipse.equinox.launcher.Main.main(Main.java:1414) !SESSION 2012-11-23 10:36:07.863 ----------------------------------------------- eclipse.buildId=I20120608-1200 java.version=1.7.0_09 java.vendor=Oracle Corporation BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_US Command-line arguments: -os linux -ws gtk -arch x86_64 !ENTRY org.eclipse.jface 2 0 2012-11-23 10:36:13.181 !MESSAGE Keybinding conflicts occurred. They may interfere with normal accelerator operation. !SUBENTRY 1 org.eclipse.jface 2 0 2012-11-23 10:36:13.181 !MESSAGE A conflict occurred for ALT+SHIFT+R: Binding(ALT+SHIFT+R, ParameterizedCommand(Command(oracle.eclipse.tools.common.services.ui.refactor.rename.command,Rename, Rename the selected text., Category(org.eclipse.jdt.ui.category.refactoring,Refactor - Java,Java Refactoring Actions,true), oracle.eclipse.tools.common.services.ui.refactor.internal.ArtifactRefactoringCommandHandler, ,,true),null), org.eclipse.ui.defaultAcceleratorConfiguration, org.eclipse.ui.contexts.window,,,system) Binding(ALT+SHIFT+R, ParameterizedCommand(Command(org.eclipse.jdt.ui.edit.text.java.rename.element,Rename - Refactoring , Rename the selected element, Category(org.eclipse.jdt.ui.category.refactoring,Refactor - Java,Java Refactoring Actions,true), , ,,true),null), org.eclipse.ui.defaultAcceleratorConfiguration, org.eclipse.ui.contexts.window,,,system) !ENTRY org.eclipse.osgi 2 1 2012-11-23 10:39:04.681 !MESSAGE NLS unused message: CacheManager_CannotLoadNonUrlLocation in: org.eclipse.equinox.internal.p2.repository.messages !SESSION 2012-11-23 15:14:12.933 ----------------------------------------------- eclipse.buildId=I20120608-1200 java.version=1.7.0_09 java.vendor=Oracle Corporation BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_US Command-line arguments: -os linux -ws gtk -arch x86_64 !ENTRY org.eclipse.jface 2 0 2012-11-23 15:14:23.380 !MESSAGE Keybinding conflicts occurred. They may interfere with normal accelerator operation. !SUBENTRY 1 org.eclipse.jface 2 0 2012-11-23 15:14:23.380 !MESSAGE A conflict occurred for ALT+SHIFT+R: Binding(ALT+SHIFT+R, ParameterizedCommand(Command(oracle.eclipse.tools.common.services.ui.refactor.rename.command,Rename, Rename the selected text., Category(org.eclipse.jdt.ui.category.refactoring,Refactor - Java,Java Refactoring Actions,true), oracle.eclipse.tools.common.services.ui.refactor.internal.ArtifactRefactoringCommandHandler, ,,true),null), org.eclipse.ui.defaultAcceleratorConfiguration, org.eclipse.ui.contexts.window,,,system) Binding(ALT+SHIFT+R, ParameterizedCommand(Command(org.eclipse.jdt.ui.edit.text.java.rename.element,Rename - Refactoring , Rename the selected element, Category(org.eclipse.jdt.ui.category.refactoring,Refactor - Java,Java Refactoring Actions,true), , ,,true),null), org.eclipse.ui.defaultAcceleratorConfiguration, org.eclipse.ui.contexts.window,,,system) !ENTRY org.springframework.ide.eclipse.uaa 4 2 2012-11-23 15:14:32.800 !MESSAGE Problems occurred when invoking code from plug-in: "org.springframework.ide.eclipse.uaa". !STACK 0 java.lang.NullPointerException at org.springframework.ide.eclipse.internal.uaa.monitor.CommandUsageMonitor.startMonitoring(CommandUsageMonitor.java:61) at org.springframework.ide.eclipse.uaa.UaaPlugin$1$1.run(UaaPlugin.java:91) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) at org.springframework.ide.eclipse.uaa.UaaPlugin$1.run(UaaPlugin.java:85) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) !SESSION 2012-11-23 15:15:21.833 ----------------------------------------------- eclipse.buildId=I20120608-1200 java.version=1.7.0_09 java.vendor=Oracle Corporation BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_US Command-line arguments: -os linux -ws gtk -arch x86_64 !ENTRY org.eclipse.jface 2 0 2012-11-23 15:15:27.283 !MESSAGE Keybinding conflicts occurred. They may interfere with normal accelerator operation. !SUBENTRY 1 org.eclipse.jface 2 0 2012-11-23 15:15:27.283 !MESSAGE A conflict occurred for ALT+SHIFT+R: Binding(ALT+SHIFT+R, ParameterizedCommand(Command(oracle.eclipse.tools.common.services.ui.refactor.rename.command,Rename, Rename the selected text., Category(org.eclipse.jdt.ui.category.refactoring,Refactor - Java,Java Refactoring Actions,true), oracle.eclipse.tools.common.services.ui.refactor.internal.ArtifactRefactoringCommandHandler, ,,true),null), org.eclipse.ui.defaultAcceleratorConfiguration, org.eclipse.ui.contexts.window,,,system) Binding(ALT+SHIFT+R, ParameterizedCommand(Command(org.eclipse.jdt.ui.edit.text.java.rename.element,Rename - Refactoring , Rename the selected element, Category(org.eclipse.jdt.ui.category.refactoring,Refactor - Java,Java Refactoring Actions,true), , ,,true),null), org.eclipse.ui.defaultAcceleratorConfiguration, org.eclipse.ui.contexts.window,,,system) !ENTRY org.eclipse.jface 2 0 2012-11-23 15:18:41.265 !MESSAGE Keybinding conflicts occurred. They may interfere with normal accelerator operation. !SUBENTRY 1 org.eclipse.jface 2 0 2012-11-23 15:18:41.265 !MESSAGE A conflict occurred for ALT+SHIFT+E: Binding(ALT+SHIFT+E, ParameterizedCommand(Command(oracle.eclipse.tools.common.services.ui.refactor.rename.command,Rename, Rename the selected text., Category(org.eclipse.jdt.ui.category.refactoring,Refactor - Java,Java Refactoring Actions,true), oracle.eclipse.tools.common.services.ui.refactor.internal.ArtifactRefactoringCommandHandler, ,,true),null), org.eclipse.ui.emacsAcceleratorConfiguration, org.eclipse.ui.contexts.window,,,user) Binding(ALT+SHIFT+E, ParameterizedCommand(Command(org.eclipse.jdt.ui.edit.text.java.rename.element,Rename - Refactoring , Rename the selected element, Category(org.eclipse.jdt.ui.category.refactoring,Refactor - Java,Java Refactoring Actions,true), , ,,true),null), org.eclipse.ui.emacsAcceleratorConfiguration, org.eclipse.ui.contexts.window,,,user) Binding(ALT+SHIFT+E, ParameterizedCommand(Command(org.eclipse.wst.jsdt.ui.edit.text.java.rename.element,Rename - Refactoring , Rename the selected element, Category(org.eclipse.wst.jsdt.ui.category.refactoring,Refactor - JavaScript,JavaScript Refactoring Actions,true), , ,,true),null), org.eclipse.ui.emacsAcceleratorConfiguration, org.eclipse.ui.contexts.window,,,user) !SESSION 2012-11-23 15:18:56.267 ----------------------------------------------- eclipse.buildId=I20120608-1200 java.version=1.7.0_09 java.vendor=Oracle Corporation BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_US Command-line arguments: -os linux -ws gtk -arch x86_64 !ENTRY org.eclipse.jface 2 0 2012-11-23 15:19:01.605 !MESSAGE Keybinding conflicts occurred. They may interfere with normal accelerator operation. !SUBENTRY 1 org.eclipse.jface 2 0 2012-11-23 15:19:01.605 !MESSAGE A conflict occurred for ALT+SHIFT+E: Binding(ALT+SHIFT+E, ParameterizedCommand(Command(org.eclipse.wst.jsdt.ui.edit.text.java.rename.element,Rename - Refactoring , Rename the selected element, Category(org.eclipse.wst.jsdt.ui.category.refactoring,Refactor - JavaScript,JavaScript Refactoring Actions,true), , ,,true),null), org.eclipse.ui.emacsAcceleratorConfiguration, org.eclipse.ui.contexts.window,,,user) Binding(ALT+SHIFT+E, ParameterizedCommand(Command(org.eclipse.jdt.ui.edit.text.java.rename.element,Rename - Refactoring , Rename the selected element, Category(org.eclipse.jdt.ui.category.refactoring,Refactor - Java,Java Refactoring Actions,true), , ,,true),null), org.eclipse.ui.emacsAcceleratorConfiguration, org.eclipse.ui.contexts.window,,,user) Binding(ALT+SHIFT+E, ParameterizedCommand(Command(oracle.eclipse.tools.common.services.ui.refactor.rename.command,Rename, Rename the selected text., Category(org.eclipse.jdt.ui.category.refactoring,Refactor - Java,Java Refactoring Actions,true), oracle.eclipse.tools.common.services.ui.refactor.internal.ArtifactRefactoringCommandHandler, ,,true),null), org.eclipse.ui.emacsAcceleratorConfiguration, org.eclipse.ui.contexts.window,,,user)

    Read the article

  • Referencing surrogate key

    - by Arman
    I have a table that has an autoincrement surrogate key. I want to use it as a foreign key of my other table. The thing is, I cant figure out how I can reference it to that table, because it is nearly impossible to determine what I have to reference(the actual value of the surrogate key). Please be noted that what I am trying to do is adding a tuple/record through my program(outside the dbms). The process is: Add a new record in Table1 and generate an autoincrement key. Update Add a new record in Table2 and reference its foreign key to the primary key of Table1. Update My question is : HOW do I store the foreign key if I didnt know what is it?

    Read the article

  • Multiple foreign keys in one table to 1 other table in mysql

    - by djerry
    Hey guys, I got 2 tables in my database: user and call. User exists of 3 fields: id, name, number and call : id, 'source', 'destination', 'referred', date. I need to monitor calls in my app. The 3 ' ' fields above are actually userid numbers. now i'm wondering, can i make those 3 field foreign key elements of the id-field in table user? Thanks in advance...

    Read the article

  • Foreign Key Relationship in Rails

    - by Steve
    Hi...I am a beginner in Rails and I read that the Rails enforces the foreign key relationships at the model level and also at the database level in the migration file, while creating the table. Is it really necessary and what kind of advantage does it provide

    Read the article

  • Sqlite / SQLAlchemy: how to enforce Foreign Keys?

    - by Nick Perkins
    The new version of SQLite has the ability to enforce Foreign Key constraints, but for the sake of backwards-compatibility, you have to turn it on for each database connection separately! sqlite> PRAGMA foreign_keys = ON; I am using SQLAlchemy -- how can I make sure this always gets turned on? What I have tried is this: engine = sqlalchemy.create_engine('sqlite:///:memory:', echo=True) engine.execute('pragma foreign_keys=on') ...but it is not working!...What am I missing?

    Read the article

  • SQL DROP TABLE foreign key constraint

    - by Polly Hollanger
    If I want to delete all the tables in my database like this, will it take care of the foreign key constraint? If not, how do I take care of that first? GO IF OBJECT_ID('dbo.[Course]','U') IS NOT NULL DROP TABLE dbo.[Course] GO IF OBJECT_ID('dbo.[Student]','U') IS NOT NULL DROP TABLE dbo.[Student]

    Read the article

  • Drop all foreign keys in a table

    - by trnTash
    I had this script which worked in sql server 2005 -- t-sql scriptlet to drop all constraints on a table DECLARE @database nvarchar(50) DECLARE @table nvarchar(50) set @database = 'dotnetnuke' set @table = 'tabs' DECLARE @sql nvarchar(255) WHILE EXISTS(select * from INFORMATION_SCHEMA.TABLE_CONSTRAINTS where constraint_catalog = @database and table_name = @table) BEGIN select @sql = 'ALTER TABLE ' + @table + ' DROP CONSTRAINT ' + CONSTRAINT_NAME from INFORMATION_SCHEMA.TABLE_CONSTRAINTS where constraint_catalog = @database and table_name = @table exec sp_executesql @sql END It does not work in SQL Server 2008. How can I easily drop all foreign key constraints for a certain table? Does anyone have a better script?

    Read the article

  • How to store a public key in a machine-level RSA key container

    - by Andrew Kimball
    I'm having a problem using a machine level RSA key container when storing only the public key of a public/private key pair. The following code creates a public/private pair and extracts the public key from that pair. The pair and the public key are stored in separate key containers. The keys are then obtained from those key containers at which point they should be the same as the keys going into the containers. The code works when CspProviderFlags.UseDefaultKeyContainer is specified for CspParameters.Flags (i.e. the key read back out from the PublicKey container is the same), but when CspProviderFlags.UseMachineKeyStore is specified for CspParameters.Flags the key read back from PublicKey is different. Why is the behaviour different, and what do I need to do differently to retrieve the public key from a machine-level RSA key container? var publicPrivateRsa = new RSACryptoServiceProvider(new CspParameters() { KeyContainerName = "PublicPrivateKey", Flags = CspProviderFlags.UseMachineKeyStore //Flags = CspProviderFlags.UseDefaultKeyContainer } ) { PersistKeyInCsp = true, }; var publicRsa = new RSACryptoServiceProvider(new CspParameters() { KeyContainerName = "PublicKey", Flags = CspProviderFlags.UseMachineKeyStore //Flags = CspProviderFlags.UseDefaultKeyContainer } ) { PersistKeyInCsp = true }; //Export the key. publicRsa.ImportParameters(publicPrivateRsa.ExportParameters(false)); Console.WriteLine(publicRsa.ToXmlString(false)); Console.WriteLine(publicPrivateRsa.ToXmlString(false)); //Dispose those two CSPs. using (publicRsa) { publicRsa.Clear(); } using (publicPrivateRsa) { publicRsa.Clear(); } publicPrivateRsa = new RSACryptoServiceProvider(new CspParameters() { KeyContainerName = "PublicPrivateKey", Flags = CspProviderFlags.UseMachineKeyStore //Flags = CspProviderFlags.UseDefaultKeyContainer } ); publicRsa = new RSACryptoServiceProvider(new CspParameters() { KeyContainerName = "PublicKey", Flags = CspProviderFlags.UseMachineKeyStore //Flags = CspProviderFlags.UseDefaultKeyContainer } ); Console.WriteLine(publicRsa.ToXmlString(false)); Console.WriteLine(publicPrivateRsa.ToXmlString(false)); using (publicRsa) { publicRsa.Clear(); } using (publicPrivateRsa) { publicRsa.Clear(); }

    Read the article

  • Determine which software product a Microsoft Product Key activates

    - by druciferre
    Without a product key being labelled, is there is any way to identify what Microsoft software product a given product key is meant to activate? Let's say for example I had the product key ABCDE-FGHIJ-KLMNO-PQRST-UVWXY, but I had no clue if was meant for Windows 7 Ultimate, Windows 7 Home Premium, Vista Ultimate, or even Office 2010. Does Microsoft (or anyone for that matter) have any kind of tool that I could paste the key into and get a result that identifies the software product the key is meant for (or at least a good estimate)? Note: I have searched and searched many times on the Internet, but the only results I ever find are how to recover a lost product key by using something like Nirsoft ProduKey. This is not what I am looking for.

    Read the article

  • How to recover Windows Vista product key?

    - by empi
    Two years ago I've bought asus laptop with Windows Vista preinstalled. I also received recovery dvd with it. Now, I want to reinstall Windows and fully format the hard drive. However, the sticker with Windows product key under the laptop is unreadable. I tried recovering the key with ProduKey and similar software but they show another product key - it is different than the one from the sticker (I checked on another asus laptop and on my dell laptop). Do you know if I it is possible to reinstall the operating system with the product key obtained from ProduKey? If not, how can I retrieve the product key? It seems stupid that it was only placed on the sticker that is destroyed after some time if you frequently hold the laptop on your lap. I've tried ProduKey and Recover Keys and they show the same key. However, it's not the one from the sticker. Thanks in advance for help.

    Read the article

  • Preventing SSH RSA host key warnings for change of key vs IP address

    - by Adam M-W
    I have a network with DHCP enabled, and also a computer that dual boots operating systems and has different SSH keys on each (and yes, I would like to keep different keys on each rather than copying the same identity/private key to each). Because the IP address does not change between operating systems because the MAC address is the same, when connecting to ssh, even when not using the IP address but the hostname via DNS/mDNS, I get the warning: Warning: the RSA host key for 'hostname' differs from the key for the IP address '192.168.1.172' Offending key for IP in /Users/user/.ssh/known_hosts:37 Matching host key in /Users/user/.ssh/known_hosts:38 Are you sure you want to continue connecting (yes/no)? How can I surpress the warning when the hostname differs from the IP address for that hostname, but retain the ability to check host keys are the same for each hostname? (each OS has a unique hostname)

    Read the article

  • Finding the owner of an AWS access key + secret key pair

    - by nightw
    I would like to have a simple solution (possibly in 1-3 plain API calls to AWS) to find the owner of an AWS access key. I have the password of the "root" AWS account and of course I can manage the users and credentials through IAM, but we have a lot of users and I don't want to look at them one by one looking for the owner of the key. So basically I have a working access key + secret key pair (in fact a couple of them), but I do not know which user's key is it and what rights are on it. What is the easiest way to do this? Thank you in advance.

    Read the article

  • Rails Foreign key setup question.

    - by James P. Wright
    I'm just (re)starting playing around with Rails and I'm making a little card game app. I cannot seem to figure out my Foreign Key setups. Say I have 4 objects: - Game - Player - Hand - Card A Game has many Players, which have many Hands which have many Cards. But the cards are also independent of a Hand, Player and Game. For example, I have 6 Cards in my database (1 to 6). It is possible that Card 3 could be in 2 Players Hands in the same Game. How can I set up my keys for this? Should I just create another object for "CardInHand" to simplify it?

    Read the article

  • Delete all records that have no foreign key constraints

    - by Rodney Burton
    I have a SQL 2005 table with millions of rows in it that is being hit by users all day and night. This table is referenced by 20 or so other tables that have foreign key constraints. What I am needing to do on a regular basis is delete all records from this table where the "Active" field is set to false AND there are no other records in any of the child tables that reference the parent record. What is the most efficient way of doing this short of trying to delete each one at a time and letting it cause SQL errors on the ones that violate constraints? Also it is not an option to disable the constraints and I cannot cause locks on the parent table for any significant amount of time.

    Read the article

  • Filtering foreign keys with AJAX in Django admin

    - by cnobile
    I have most of this figured out already. I have AJAX returning the region/state/province when a country is selected. The correct foreign key is saved to the database, however, when the record is viewed afterwards the selected state is not shown in the select nor are any states for the selected country. I understand why this is happening as, the admin view is not aware of the relation between the state and the country. So here is the question. Is there a hook in the admin view that will allow me to load the correct states for the country and set the selected attribute on the option in the select tag? Or how can I override the admin view for any forms that require the country and region/state/province set? I am using jQuery and Djando-1.1. Thanks

    Read the article

  • Django: Set foreign key using integer?

    - by User
    Is there a way to set foreign key relationship using the integer id of a model? This would be for optimization purposes. For example, suppose I have an Employee model: class Employee(models.Model): first_name = models.CharField(max_length=100) last_name = models.CharField(max_length=100) type = models.ForeignKey('EmployeeType') and EmployeeType(models.Model): type = models.CharField(max_length=100) I want the flexibility of having unlimited employee types, but in the deployed application there will likely be only a single type so I'm wondering if there is a way to hardcode the id and set the relationship this way. This way I can avoid a db call to get the EmployeeType object first.

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >