Search Results

Search found 10804 results on 433 pages for 'attribute keys'.

Page 75/433 | < Previous Page | 71 72 73 74 75 76 77 78 79 80 81 82  | Next Page >

  • 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

  • Way to check for foreign key references before deleting in MySQL?

    - by Chad Johnson
    I'm working with a content management system, and users are prompted with a confirmation screen before deleting records. Some records are foreign key referenced in other tables, and therefore they cannot be deleted. I would like to display a message beside a given record if it has foreign key references. To know whether I should display the message for a record, I could just query the referencing table and see if there are references. But the problem is, there are about a dozen tables with records potentially referencing this record, and a lookup could take a "long" time. Is there an easy way to tell whether the record is delete-ready (ie. has no foreign key references)?

    Read the article

  • MYSQL inserting records form table A into tables B and C (linked by foreign key) depending on column values in table A

    - by Chez
    Hi All, Have been searching high and low for a simple solution to a mysql insert problem. The problem is as follows: I am putting together an organisational database consisting of departments and desks. A department may or may not have n number of desks. Both departments and desks have their own table linked by a foreign key in desks to the relevant record in departments (i.e. the pk). I have a temporary table which I use to place all new department data (n records long)...In this table n number of desk records for a department follow the department record directly below. In the TEMP table, if a column department_name has a value,it is a department, if it doesn't it will have a value for the column desk and therefore will be a desk which is related to the above department. As I said there maybe several desk records until you get to the next department record. Ok, so what I want to do is the following: Insert the departments into the departments table and its desks into the desks table , generating a foreign key in the desk record to the relevant departments id. In pseudo-ish code: for each record in TEMP table if Department INSERT the record into Departments get the id of the newly created Department record and store it somewhere else if Desk INSERT the desk into the desks table with the relevant departments id as the foreignkey note once again that all departments desks directly follow the department in the TEMP Table Many Thanks

    Read the article

  • Jump-To-Code-Line Eclipse Shortcuts

    - by scrr
    Hello, is it possible, in Eclipse, to mark certain lines with Shortcuts and be able to quickly jump to those lines? Example: Let's say I have maintenanceHeavyMethod() at line 120 in my class, gameLoop() at line 800 and some listener at line 1460. I'd like to f.ex. press CTRL-SHIFT-1, 2, 3 etc. to mark those positions, and then use f.ex. CTRL-1, 2, 3 to immediately jump to them. I don't like split-screens etc, but I need to jump around when writing. Is there such a feature? I'm using latest Eclipse to write Java-programs.

    Read the article

  • Django: getting the list of related records for a list of objects

    - by Silver Light
    Hello! I have two models related one-to many: class Person(models.Model): name = models.CharField(max_length=255); surname = models.CharField(max_length=255); age = models.IntegerField(); class Dog(models.Model): name = models.CharField(max_length=255); owner = models.ForeignKey('Person'); I want to output a list of persons below each person a list of dogs he has. Here's how I can do it: in view: persons = Person.objects.all()[0:100]; in template: {% for p in persons %} {{ p.name }} has dogs:<br /> {% for d in persons.dog_set.all %} - {{ d.name }}<br /> {% endfor %} {% endfor %} But if I do it like that, Django will execute 101 SQL queries which is very inefficient. I tried to make a custom manager, which will get all the persons, then all the dogs and links them in python, but then I can't use paginator (my another question: http://stackoverflow.com/questions/2532475/django-paginator-raw-sql-query ) and it looks quite ugly. Is there a more graceful way doing this?

    Read the article

  • How can I ask Hibernate to create an index on a foreign key (JoinColumn)?

    - by Kent Chen
    Hi, This is my model. class User{ @CollectionOfElements @JoinTable(name = "user_type", joinColumns = @JoinColumn(name = "user_id")) @Column(name = "type", nullable = false) private List<String> types = new ArrayList<String>(); } You can imagin there would be a table called "user_type", which has two columns, one is "user_id", the other is "type". And when I use hbm2ddl to generate the ddls, I can have this table, along with the foreign key constraint on "user_id". However, there is no index of this for this column. And I need this index. How can I let hibernate to generate this index for me? Thank you!

    Read the article

  • Why can't I SELECT a parent field that doesn't have a child?

    - by myaccount
    (rest_branches) is the table of restaurants. (phone_numbers) is another table which contains the restaurants phone_numbers, and it has a field called (branch_id) which references the restaurant id. When I try: SELECT * FROM rest_branches NATURAL JOIN phone_numbers I only get the restaurants which have a phone_number. What should I do to get all restaurants even if they don't have a phone number?

    Read the article

  • Amazon SimpleDB - Is there a way to list all Attributes in a Domain?

    - by beer-drinker
    Hi, I'm using C# and the AWSSDK library form Amazon to test a few things in SimpleDB. All going well so far. However, I am trying to come up with a neat way of retrieving all Attributes that are applicable to a Domain. This is proving to be tricky without having to retrieve an Item, and obviously I can get the list of attributes then. But what if I have 100,000 Items in a Domain. Let's say the first 70,000 Items in a "Person" Domain have: FirstName, LastName, Address And then I hit a Item that has FirstName, LastName, Address, Phone And then I hit another Item around the 80,000 mark which has: FirstName, LastName, Email, Phone In the above example, for the Person Domain, how would I get a list that contains: FirstName, LastName, Address, Email, Phone ...without performing a ridiculous number of select statements? Many thanks!

    Read the article

  • Python 3: list atributes within a class object

    - by MadSc13ntist
    is there a way that if the following class is created; I can grab a list of attributes that exist. (this class is just an bland example, it is not my task at hand) class new_class(): def __init__(self, number): self.multi = int(number) * 2 self.str = str(number) a = new_class(2) print(', '.join(a.SOMETHING)) * the attempt is that "multi, str" will print. the point here is that if a class object has attributes added at different parts of a script that I can grab a quick listing of the attributes which are defined.

    Read the article

  • MySql Query to return number of photos in each album

    - by GivenPie
    MY table is set up like this, all I need to do is call a query to my Photos table. I have PhotoID as the primary key and GalleryID as the foreign key to Gallery. How can I could the number of unique PhotoID's for each multiple GalleryIDs. So to speak there are may duplicate GalleryIDs because there are many photos in a gallery. So I just need to could the number of unique PhotoIDs associated with that GalleryID. Can it be done in one query?

    Read the article

  • Within headers, images with alt text vs. text

    - by Court
    Do search engines treat the alt text of an image placed within an h1 tag the same way they would treat regular text placed in an h1 tag? I gave a search through here looking for an answer to this question, but was only able to find information on image replacement and the infamous h1 debate. For example would: <h1><img src="#" alt="Contact Us" /></h1> Act the same as: <h1>Contact Us</h1> In the electronic eye of a search engine? This seems considerably less "CSS Hacky" than other image replacement techniques like negative text indents, display:none, height:0, or ridiculous z-index integers.

    Read the article

  • Generate Delete Statement From Foreign Key Relationships in SQL 2008 ?

    - by Element
    Is it possible via script/tool to generate a delete statement based on the tables fk relations. i.e. I have the table: DelMe(ID) and there are 30 tables with fk references to its ID that I need to delete first, is there some tool/script that I can run that will generate the 30 delete statements based on the FK relations for me ? (btw I know about cascade delete on the relations, I can't use it in this existing db) I'm using Microsoft SQL Server 2008

    Read the article

  • wxpython - Nested Notebooks

    - by madtowneast
    I have been trying to make my nested notebooks a little bit more appealing code wise. At the moment, I got this #!/usr/bin/env python import os import sys import datetime import numpy as np from readmonifile import MonitorFile from sortmonifile import sort import wx class NestedPanelOne(wx.Panel): #---------------------------------------------------------------------- # First notebook that creates the tab to select the component number #---------------------------------------------------------------------- def __init__(self, parent, label, data): wx.Panel.__init__(self, parent=parent, id=wx.ID_ANY) sizer = wx.BoxSizer(wx.VERTICAL) #Loop creating the tabs according to the component name nestedNotebook = wx.Notebook(self, wx.ID_ANY) for slabel in sorted(data[label].keys()): tab = NestedPanelTwo(nestedNotebook, label, slabel, data) nestedNotebook.AddPage(tab,slabel) sizer = wx.BoxSizer(wx.VERTICAL) sizer.Add(nestedNotebook, 1, wx.ALL|wx.EXPAND, 5) self.SetSizer(sizer) class NestedPanelTwo(wx.Panel): #------------------------------------------------------------------------------ # Second notebook that creates the tab to select the main monitoring variables #------------------------------------------------------------------------------ def __init__(self, parent, label, slabel, data): wx.Panel.__init__(self, parent=parent, id=wx.ID_ANY) sizer = wx.BoxSizer(wx.VERTICAL) nestedNotebook = wx.Notebook(self, wx.ID_ANY) for sslabel in sorted(data[label][slabel][data[label][slabel].keys()[0]].keys()): tab = NestedPanelThree(nestedNotebook, label, slabel, sslabel, data) nestedNotebook.AddPage(tab, sslabel) sizer.Add(nestedNotebook, 1, wx.ALL|wx.EXPAND, 5) self.SetSizer(sizer) class NestedPanelThree(wx.Panel): #------------------------------------------------------------------------------- # Third notebook that creates checkboxes to select the monitoring sub-variables #------------------------------------------------------------------------------- def __init__(self, parent, label, slabel, sslabel, data): wx.Panel.__init__(self, parent=parent, id=wx.ID_ANY) labels=[] chbox =[] chboxdict={} for ssslabel in sorted(data[label][slabel][data[label][slabel].keys()[0]][sslabel].keys()): labels.append(ssslabel) for item in list(set(labels)): cb = wx.CheckBox(self, -1, item) chbox.append(cb) chboxdict[item]=cb gridSizer = wx.GridSizer(np.shape(list(set(labels)))[0],3, 5, 5) gridSizer.AddMany(chbox) self.SetSizer(gridSizer) ######################################################################## class NestedNotebookDemo(wx.Notebook): #--------------------------------------------------------------------------------- # Main notebook creating tabs for the monitored components #--------------------------------------------------------------------------------- def __init__(self, parent, data): wx.Notebook.__init__(self, parent, id=wx.ID_ANY, style= wx.BK_DEFAULT ) for label in sorted(data.keys()): print label tab = NestedPanelOne(self,label, data) self.AddPage(tab, label) ######################################################################## class DemoFrame(wx.Frame): #---------------------------------------------------------------------- # Putting it all together #---------------------------------------------------------------------- def __init__(self,data): wx.Frame.__init__(self, None, wx.ID_ANY, "pDAQ monitoring plotting tool", size=(800,400) ) panel = wx.Panel(self) notebook = NestedNotebookDemo(panel, data) sizer = wx.BoxSizer(wx.VERTICAL) sizer.Add(notebook, 1, wx.ALL|wx.EXPAND, 5) panel.SetSizer(sizer) self.Layout() #Menu Bar to be added later ''' menubar = wx.MenuBar() file = wx.Menu() file.Append(1, '&Quit', 'Exit Tool') menubar.Append(file, '&File') self.SetMenuBar(menubar) self.Bind(wx.EVT_MENU, self.OnClose, id=1) ''' self.Show() #---------------------------------------------------------------------- if __name__ == "__main__": if len(sys.argv) == 1: raise SystemExit("Please specify a file to process") for f in sys.argv[1:]: data=sort.sorting(f) print data['stringHub'].keys() print data.keys() print data[data.keys()[0]].keys() print 'test' app = wx.PySimpleApp() frame = DemoFrame(data) app.MainLoop() print 'testend' and I would like to reduce this whole mess into something that only has three nested for loops, so something like for label in sorted(data.keys()): self.SubNoteBooks[label] = wx.Notebook(self.Notebook, wx.ID_ANY) self.Notebook.AddPage(self.SubNoteBooks[label], label) for slabel in sorted(data[label].keys()): self.SubNoteBooks[label][slabel] = wx.Notebook(self, wx.ID_ANY) self.SubNoteBooks[label].AddPage(self.SubNoteBooks[label][slabel], slabel) for sslabel in sorted(data[label][slabel][data[label][slabel].keys()[0]].keys()): self.SubNoteBooks[label][slabel][sslabel] = wx.Notebook(self.Notebook, wx.ID_ANY) self.Notebook.AddPage(self.SubNoteBooks[label][slabel][sslabel], sslabel) I have been trying to fiddle this around but the problem seems to be the line self.SubNoteBooks[label][slabel] = wx.Notebook(self, wx.ID_ANY) I get the error: Traceback (most recent call last): File "./reducelinenumbers.py", line 162, in <module> frame = DemoFrame(data) File "./reducelinenumbers.py", line 126, in __init__ self.SubNoteBooks[label][slabel] = wx.Notebook(self, wx.ID_ANY) TypeError: 'Notebook' object does not support item assignment I understand why notebook is being type raises a TypeError here. Is there a way around this? Thanks a bunch in advance.

    Read the article

  • How do I make Home / End keys behave Windows/Linux like in Terminal.app on Mac OS on Mac Pro laptop?

    - by Nick Gorbikoff
    Hello. I was wondering if somebody knows how to use home/end keys behave in a Windows/ Linux fashion. What I mean is that when I press Apple + Left (Home combo on a mac book pro laptop) it should go to the beginning of the line, and Apple + Right to the end of the line. Right now they change focus to the top of the scroll history. Drives me crazy. Home / End keys behave as expected in TextMate and such but not in terminal, which makes me think it's that app specific. I found some page saying that I need to remap key bindings but I can't do that on every mac i touch. So is there another shorcut in Mac I can use or how do I make Home/End keys behave as expected? Thank you

    Read the article

  • How to use Active Directory's homeDirectory attribute for Samba?

    - by Shiroi98
    I currently have a Samba share setup where I would like to share Unix folders with Windows users, with Active directory as the backend. I see that there is an attribute called homeDirectory in Active Directory, but no matter what I set, Samba refuses to use that attribute (verified by doing "getent passwd") Additionally, I tried the template homedir = /home/%u in /etc/samba/smb.conf, but the problem is, some users have /home_abc/[username] while others have /home_def/[username]. That sets ALL users to /home/[username]. If I don't use the template homedir, by default it is set to /home/[DOMAIN]/[username]. Bottomline: How can I use Active directory's homeDirectory attribute to set users Home Directory in Unix/Samba? Any help greatly appreciated! :)

    Read the article

  • Stop ssh client from offering all the public keys it can find?

    - by Rory McCann
    Like most sysadmins I use openssh all the time. I have about a dozen ssh keys, I like to have a different ssh key for each host. However this causes a problem when I am connecting to a host for the first time, and all I have is a password. I want to just connect to the host using a password, no ssh key in this case. However the ssh client will offer all the public keys in my ~/.ssh/ (I know this from looking at the output of ssh -v). Since I have so many, I will get disconnected for too many authentication failures. Is there some way to tell my ssh client to not offer all the ssh keys?

    Read the article

  • OS X: What does the '@' attribute on a file mean?

    - by claytontstanley
    On a Snow Leopard machine, at the Terminal: la ~/src/rmcl/ | grep RMCL -rw-r--r--@ 1 claytonstanley staff 6766167 Nov 13 2009 RMCL What is that '@' attribute? This file is part of an older OS X program that runs under Rosetta. I'm having issues where some older programs running under Rosetta require the @ attribute when opening files. But I'm not sure what that attribute is, so I have no way to know how to add/remove it. I did try a thorough Google search on this, but I wasn't able to find the answer. I would have thought this would be an easy one to find. Maybe the Google query isn't acting properly because of the single @ special character. Any info. is much appreciated. Thanks!

    Read the article

  • Should I add a "nofollow" attribute to download links, or disallow the URLs in robots.txt?

    - by Laurent
    I have a download link very similar to Opera's one - it's just a script that sends the file. It doesn't have an extension and there's no obvious way to tell that it's actually a download link. So since I don't want robots to crawl this link, do I need to add it to robots.txt or maybe add a "nofollow" attribute to it? I see that on Opera's website they didn't do either of this, so perhaps it's not necessary?

    Read the article

  • How to turn off MVC.NET version 2's RequireHttps attribute?

    - by Bob
    I see that version 2 of MVC.NET now has a RequireHttps attribute, which works great for me. However, what's a good strategy for turning the effect off? For example, I want to use Https on some pages, but regular Http on others. Should I create my own RequireHttp attribute? EDIT: I'm using my own RequireHttp attribute, and it works fine, but I'm wondering if there's some built-in functionality in MVC.NET Version 2 that I'm missing. EDIT 2: I must not have been clear. My question concerns the following: if you use RequireHttps, then any requests after that will be over Https even if the Controller or Action is not decorated with RequireHttps. Unless I'm mistaken, you need a 2nd attribute such as RequireHttp to redirect requests to Http instead of Https.

    Read the article

  • Why "alt" attribute for <img> tag has been considered mandatory by the HTML validator .. ?

    - by infant programmer
    Is there any logical or technical reason (with the W3C validation) for making alt as required attribute .. This is my actual problem:though my page is perfect enough with respect to W3C validation rules .. Only error I am getting is line XX column YY - Error: required attribute "ALT" not specified I know the significance of "alt" attribute and I have omitted that where it is unnecessary .. (to be more elaborate .. I have added the image to increase the beauty of my page and I don't want alt attribute to show irrelevant message to the viewer) getting rid of the error is secondary .. rather I am curious to know whether is it a flaw with validation rules .. ?? I thank stackOverflow and all the members who responded me .. I got my doubt clarified .. :-)

    Read the article

  • How do I ADD an Attribute to the Root Element in XML using XSLT?

    - by kunjaan
    I want to match a root Element “FOO” and perform the transformation (add a version attribute) to it leaving the rest as it is. The Transformation I have so far looks like this: <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://schemas.foo.com/fooNameSpace"> <xsl:template match="//FOO"> <xsl:choose> <xsl:when test="@version"> <xsl:apply-templates select="node()|@*" /> </xsl:when> <xsl:otherwise> <FOO> <xsl:attribute name="version">1</xsl:attribute> <xsl:apply-templates select="node()|@*" /> </FOO> </xsl:otherwise> </xsl:choose> </xsl:template> However this does not perform any transformation. It doesn't even detect the element. So I need to do add the namespace in order to make it work: <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fd="http://schemas.foo.com/fooNameSpace"> <xsl:template match="//fd:FOO"> … But this attaches a namespace attribute to the FOO element as well as other elements: <FOO xmlns:fd="http://schemas.foo.com/fooNameSpace" version="1" id="fooid"> <BAR xmlns="http://schemas.foo.com/fooNameSpace" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> Is there a way to say that the element is using the default namespace? Can we match and add elements in the default name space? Here is the original XML: <?xml version="1.0" encoding="UTF-8"?> <FOO xmlns="http://schemas.foo.com/fooNameSpace" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <BAR> <Attribute name="HEIGHT">2067</Attribute> </BAR> </FOO>

    Read the article

  • How to make a loop over all keys of a HashMap?

    - by Roman
    I try to do it in the following way: public String getValue(String service, String parameter) { String inputKey = service + ":" + parameter; Set keys = name2value.keySet(); Iterator itr = keys.iterator(); while (itr.hasNext()) { if (inputKey.equal(itr.next())) { return name2value.get(inputKey); } return ""; } } And I get an error message: cannot find symbol method.equal(java.lang.Object). I think it is because itr.next() is not considered as a string. How can I solve this problem? I tried to replace Set keys by Set<String> keys. It did not help.

    Read the article

< Previous Page | 71 72 73 74 75 76 77 78 79 80 81 82  | Next Page >