MySQL Possible to use a Flat File type of Primary Key in RDBMS tables

2012-10-08  Source: Original Site  Category:MySQL  Views:0 

Advertisement

I want to craete my tables by using a unique type of PK, e.g. the explanation below explains how I want to put the key(s) together. My question is, would MySQL beable to handle such a key and what impact would it have on my processing.Any help would be appreciated.

Primary Key Definition per table

Organisation table: Independent Primary Key (iPK) constructed as follows:
• INT(07) - auto-increment: number starting at 1,
e.g. 0000001

Individual table : Dependent Primary Key (dPK) constructed as follows:
• Organisation PRIMARY Key
• “I” + INT(07) - auto-increment number starting at 1,
e.g 0000001I0000001

Outcome table: Dependent Primary Key constructed as follows:
• Organisation Primary Key
• “O” + INT(07) - auto-increment number starting at 1,
e.g 0000001I00000010000001

Function table: Dependent Primary Key constructed as follows:
• Outcome Primary Key
• “F” + INT(07) - auto-increment number starting at 1.
e.g 0000001I00000010000001F0000001

Activity table: Dependent Primary Key constructed as follows:
• Function Primary Key
• “A” + INT(07) - auto-increment number starting at,
e.g 0000001I00000010000001F0000001A0000001.

The more tables added that links to each other, the longer the key. The benefit though is that processing occurs like for flat files and no JOINS are necessary.

Related articles
  • MySQL Possible to use a Flat File type of Primary Key in RDBMS tables 2012-10-08

    I want to craete my tables by using a unique type of PK, e.g. the explanation below explains how I want to put the key(s) together. My question is, would MySQL beable to handle such a key and what impact would it have on my processing.Any help would

  • Perl How to use DBI module to retrive the primary key of any table 2014-02-18

    I am trying to automate the use of several programs, so that I can build it one time and the when we plug in other 'methods' to the members the programming can still work without additional work needing to be done. My last problem is trying to recove

  • MySQL get max value of primary key from each table 2014-10-24

    I am using this function to get the primary keys of each table in a schema: SELECT column_name,table_name FROM information_schema.key_column_usage where table_schema = 'xxxx' group by table_name; how do i get the max value of each primary key?

  • a data repository project using a flat file needs advice on editing records 2013-09-19

    I am a wannabe programmer and decided to attempt a small project in php that I could use for an organization that I am affiliated with. It is a repository for name, address, phone number, registration number, etc. About 20 fields in all. It will only

  • Conversion problem of High values using Complex flat file stage 2012-04-04

    Please help me handling HIGH values in Complex flat file stage. I am reading a cobol file using complex flat file stage and writing to sequential file. one field got defined as PIC X and got HIGH values in the source mainframe file. I am getting Junk

  • What is the difference between Mysql coding and that of flat file 2015-06-13

    just a quick question What is the difference between Mysql coding and that of flat file (based systems)? Yep im a newbie........... Also which do you prefer out of them 2....

  • Oracle How to use non-unique indexes to enforce primary key 2012-06-04

    Can anyone tell me how to use non-unique index to enforce primary key?

  • MySQL add primary keys to a table one-time and there are already 2014-01-27

    Is it possible to add primary keys to a table one-time and there are already multiple primary key defined? I have to change sp_id, so_id as primary keys to the existing primary keys dn_slot_id and dn_mm_id. I tried several times but all failed: 1. al

  • MySQL primary key and nested tables 2015-01-23

    Could any one please tell me if there is an upper limit on the number of columns that can be combined to make up a primary key for a table... i want a table where the combination of 14 columns make up the primary key... if yes, then can some of the c

  • MySQL extracting unicode form a flat file to insert in db 2012-08-13

    i am trying to extract unicode form a flat file that i wiould like to insert in a mysql database. however, i am not usre how to exactly excract the data properly. each line in the text file contains on name in arabic for ex: معالم السلوك للمرأة المسل

  • MySQL possible to use non-sql function in HAVING? 2012-12-25

    i would like to ask whether it is possible to use an non sql aggregate function in HAVING clause. the function i am refering to is available through an extension on sql server for spatial data. when i try to use it in HAVING clause i get an error. is

  • Ubuntu customize what program to use for certain file types 2013-11-30

    is there any way to set it so when you double click on a file of a certain file type, it will launch with a certain program? for example when i click on a .RAR file, is there a way to make it open with ark? and movie files use VLC?

  • Getting IP using a flat file wont work properly 2013-06-25

    I've Install this script to my site but It won't function that well Here's the code, which logs client side IP in a flat file or *.txt <?php$filename = "uniqueLogs.txt"; $file = file($filename);$file = array_unique($file);$hits = count($file);echo

  • Oracle Is it possible to upload a xls file into an application and store in table. 2012-02-18

    I just want to know whether its possible to upload a xls file into application in Oracle 10g . i.e. have a separate xls file stored in computer then in the application just have a browse button to upload that xls file and that data should be inserted

  • Flat file array, replace 3rd key value based on itself. 2014-09-12

    Good day to all of you, Him working of a login script and him stopped at the display of the member. The script is easy and it's text(flat) file based. My problem is at the 3rd array level, when I try to display it, I need to change the value based on

  • MySQL Is data file ordered by primary key ? 2013-05-12

    When you add a primary key to a MyISAM table with ALTER TABLE ADD PRIMARY KEY, does the data file get sorted according to the primary key, or is it the data file left alone? I remember seeing somewhere (can't find it, though) that the data file gets

  • changing type of primary key 2012-03-12

    gota a quick question ok.. lets say.. i have mysql database.. and in that database.. i gota table .. in that table i got a primary key seq_id which is int.. and then i got another table.. and it also has the same key seq_id which is int as well.. and

  • Oracle object type as primary key / indexed column? 2014-02-06

    In general, UDTs can be used just as any other datatype. They even have a reasonable default implementation for equality: field-by-field. So I wonder why can't I use the UDT as primary key and have it be equivalent to a composite PK? Example: create

  • MySQL statement to save the secondary key, to match primary key in other table 2012-05-04

    Now Reaaaaly close to finishing my project =), had a bit of scope creep with the person we are doing the project for. uffff, yea i know... so now im saving all the details to my mysql database. like this field. "name" of the person, i would save it l

  • Using primary keys from two tables 2012-05-25

    I need to update attendance for a group. This group comprises of two different entities the patients and the clietns , each are held in seperate tables with different atuonumber primary keys. However, both entities can attend the same group my proble