data-integrity

How to overcome Netezza's lack of unique constraint/referential integrity enforcement?

删除回忆录丶 提交于 2019-12-18 07:06:54
问题 It appears that the lack of support for enforcing 2 basic constraints (unique and foreign key), is a reason for loss of many man-hours debugging and troubleshooting difficult problems. What starts as a trivial, easy-to-fix problem (dup rows /inconsistent primary-detail tables) goes un-noticed, grows and raises complex edge-scenarios in our application, or even in our hardware (e.g. self-join with dups can cause inflation and storage exhaustion). Netezza serves multiple purposes in our

Can Foreign Key be null? [duplicate]

大城市里の小女人 提交于 2019-12-17 22:42:52
问题 This question already has answers here : Can a foreign key be NULL and/or duplicate? (11 answers) Closed 5 years ago . In our database project we have a table Sale that has an primary key and two exclusive foreign keys: Vehicle_ID and Piece_ID . For example if we sell a vehicle we need Vehicle_ID as a foreign key but not Piece_ID . Can we put NULL to Piece_ID , could a foreign key be null? Or is there a way to do this job? Thanks. 回答1: The column (or columns) of a primary key must be NOT NULL

How to perform checksums during a SFTP file transfer for data integrity?

断了今生、忘了曾经 提交于 2019-12-17 04:35:18
问题 I have a requirement to perform checksum (for data integrity) for SFTP. I was hoping this could be done during the SFTP file transfer - I realize this could be product dependent (FYI: using CLEO VLTrader), but was wondering if this is customary? I am also looking for alternative data integrity checking options that are as good (or better) than using a checksum algorithm. Thanks! 回答1: With the SFTP, running over an encrypted SSH session, there's negligible chance the file contents could get

How to enforce foreign key constraint from unrelated tables in Mysql?

扶醉桌前 提交于 2019-12-14 02:43:54
问题 this is my DB structure. this is the script I used to create the tables use for_stkoverflow; CREATE TABLE UserGroup ( groupid MEDIUMINT NOT NULL AUTO_INCREMENT, groupname VARCHAR(100), PRIMARY KEY (`groupid`) ); CREATE TABLE User_det ( Usrid MEDIUMINT NOT NULL AUTO_INCREMENT, usrname VARCHAR(255), groupid MEDIUMINT, PRIMARY KEY (`Usrid`), Foreign Key (groupid) references UserGroup (groupid) ); CREATE TABLE Accounts ( acid MEDIUMINT NOT NULL AUTO_INCREMENT, groupid MEDIUMINT, acname VARCHAR

migrate the large data from xml file to the database

↘锁芯ラ 提交于 2019-12-13 15:29:47
问题 Q: I face the following problem two weeks ago , and i don't know how to handle it taking the performance issues , the data integrity in consideration. What I do is: I wanna to migrate the data from the XML file to its similar tables in my database . for example : i have two nodes (XML file): courses , teachers Two tables (database) courses , teachers . I allow the user to upload the XML file to a folder on my server and i begin to read the XML file and insert the data into my database . The

How to provide constraint to an associative table relating to two source tables with a common foreign key?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-13 02:24:26
问题 Example scenario. In a flight schedule system, there are a pilot table which refers to a plane_type table indicating the planes the pilot is able to fly (assuming that is a many-to-one relation). There are also a plane table and it refers to the plane_type table to indicate the plane's type (also many-to-one relation). Now there is an associative table flight_plan which assigns a pilot to a plane for a given flight. How do I make sure the pilot 's qualification do match the plane 's type for

Multiple ViewModels request same domain object, should I give them the same/different instance(s)?

萝らか妹 提交于 2019-12-11 05:35:09
问题 newbie here, sorry if this is an obvious question, and sorry for my English. I tried to Google but didn't find an answer to my question. I'm using Visual Studio, Autofac, EF CTP5 code only (maybe later will switch to HHibernate due to EF CTP5 does not support IoC container), and trying to use the following patterns: MVVM, DI, DDD. My question is: When multiple ViewModels request the same domain-object from the repository, should I give them the same instance or create a new instance for each

Why does this select for update example work?

為{幸葍}努か 提交于 2019-12-11 01:34:53
问题 I'm running some simple scripts to test possible solutions for an integrity problem I'm solving. Suppose I have a table my_table |foo | |1 | And I have these two snippets: // db_slow.php <?php $db = new PDO('mysql:host=localhost;dbname=my_playground;charset=utf8', 'root', ''); echo 'starting transaction<br />'; $db->beginTransaction(); $stmt = $db->query('select * from my_table for update'); $rows = $stmt->fetchAll(); echo 'count tables: ', count($rows), '<br />'; if (count($rows) == 1) {

Checking rule violations before deleting a record

做~自己de王妃 提交于 2019-12-10 16:35:01
问题 I would like to implement a "soft-delete" scheme for a number of entities in my SQL Server 2005 database. By this, I mean I would like to delete an row from a table if there are no referential integrity rule violations, otherwise I will set a flag on the record to signify it has been deleted. The table I wish to enforce this "soft-delete" pattern must have "No Action" applied as the "Insert/Update Specification". How can I check to see if the delete I want to run will violate foreign key

Does a git commit hash equal a repository state?

假如想象 提交于 2019-12-10 15:56:37
问题 Each git commit is attributed a hash which "signs" its content. Does it also sign where the commit came from or is it just the commit data itself which is used for the hash calculation? Differently phrased: is it impossible (apart from hash collisions) to forge a second repository with its head commit having the exact same hash and same content but the rest of the tree differing? 回答1: The answer to the second question is yes (it is impossible, etc). The first question is not as well formed as