How to create composit key ??

Hello Friends!
i need your help. I have to create composit key.
I have 2 tables. Table 1 contains 9 colums and table 2 contains 3 colums. I am writing down just related colums of table1
Table1: SID (pk) , Bytes_convert_test , Operator , Value , offset_test , Bytes_convert_jump , offset_jump
Table2: SID (fk) , value , type , ID (pk)
in table2 type represents the 2 colums in table 1 (Bytes_convert_test and Bytes_convert_jump). Type colum could be anyone of them may be for one record it is Bytes_convert_test or for another record bytes_convert_jump. values
Value colum in table2 having different values or may be same values for both records. but my task is that i have to store record like if the type in table2 is bytes_to_convert then the values colum stores values for bytes to convert record. In short i have to separate values according to type. I am not sure that i need SID as fk in table2.
Remember value colum in table1 containing different entries.
Waiting for quick reply.
BR,
Zeeshan
Edited by: user10899712 on 2009-apr-20 03:42

Hello Zeeshan,
You are saying you want to use Type and Value fields in Table2 as foreign keys to Table1 and based on logical operations,Type maps to Bytes_convert_test and/or Bytes_convert_jump in Table1. This means that there is no way to do a straight join between Table1 and Table2 that I can see. Unless you have some simple logic you can add to a query to get the joins to work consistently, I would strongly recommend you use a simple foreign key in Table2.
Using a simple foreign key that goes to Table1's primary key not only makes the table joins easier, it also will reduce database hits - since now the primary key can be used when traversing relationships to search the cache instead of having to always go to the database.
Best Regards,
Chris

Similar Messages

  • How to created Costing Key

    Hi,
    How to create costing key and wwhere to assign for value fields.Kindly provide me the Tcodes for the same.
    I will assgin poiints
    Thanks
    Sunitha

    Hi,
    The tcode to create costing key: KE40
    The tcode to assign value fields: KE4R

  • How to create AES keys?

    How to create AES keys in Java Card SDK 2.2.1?
    The manual is confusing.

    The oncard building of an AES key is somehow similar to an DES key.
    On applet installation build an AES key by:
    AESKey key = (AESKey) KeyBuilder.buildKey(KeyBuilder.TYPE_AES,KeyBuilder.LENGTH_AES_128,false);
    //Now you can fill the key with random data.
    key.setKey(randomDataof128bitLength,(short)0);For generationg random data see RandomData.
    But you should keep in mind that most JavaCards only support DES /3DES as symmetric cipher. I only know two card that support AES (g&d SmartCafe Expert 64 and Axalto Cyberflex Access 64 K).
    Jan

  • How to create a key figure in SNP plannignbook which generate FA type order

    Hello
    trying to create a Key Figure in SNP planning book which generates FA type orders
    could kindly suggest how to do it?
    thanks
    elena

    Hi,
    You would be having different key figures in SNP. The type of orders that you see in Key figure is driven by type of categories or category group that you assign in planning area to each key figure. You can modifiy these cateogry groups in IMG settings.
    When you manually create a forecast through a report then automatically you will see those orders in key figures where you have assigned the category FA.
    Hope this helps.
    Regards
    Alhad

  • ActionsScript 3 how to create on key down function?

    Ok so I understand that you make an event listener and an
    event handler, but I do not understand how to create a function
    were I can hold down a key and the object keeps moving until the
    key is up.
    With the following function it only moves it every time I
    press a certain key. I need to move while the key is held down
    until released. I looked around with google and couldn't really
    find anything other than how to do this in AS2, which isn't
    helpful. Please help! :D
    stage.addEventListener(KeyboardEvent.KEY_DOWN, jumpEvent);
    private function jumpEvent(event:KeyboardEvent):void
    if(event.keyCode == 17)
    nissanZ.x += 10;

    hey thanks a bunch vario pegged!
    its working pretty well :D

  • How to create Basic Key Figure, Key Figure and Characteristic

    Hello Gurus,
    I have copied a standard layout of KP06, named it as a Z- layout and made changes to it, like defined the plan data upload field as Object Currency enabled.
    However I want to add a Z-Field , tax holiday unit as a column to this layout which I am not being able to do. The reason is when I go to Insert a new element from Edit > Element > Insert Element and click on 'Key figure with Characteristics' I do not get the Z-Field as a key figure.
    I want to define the Z-field as a key figure, so that I can add it as an element.
    Would be really nice of you if you can let me know the t-code/menu path to do that.
    Regards.

    Hello Gurus,
    I wanted to share this information with you, hoping this will help you to help me.
    I also tried to create a Key Figure in t-code GS32. In the table I mention --> FAGLFLEXR and hit enter. It says no Key figure has been defined for FAGLFLEXR. Then I put the cursor on the 'Reference Entry'and click on copy. Then give the name of the Key Field I want to create.
    'Create Key Figure' dialog box appears. When I input the 'Row Text' 'Column Text' and click enter, I am getting an error 'The basic key figure  entered for table FAGL is not defined'. I go back and do an F4 on 'Basic Key Figure' field, then I do not get any options.
    I would be highly grateful if you can let me know how to create this 'Basic Key Figure' for table FAGLFLEXR.

  • How to Create ACCESS key for different users

    How to create or generate an ACCESS KEY which is required to make changes to the table V_FAGL_ACTIVEC (For New General ledger) for IDES 6.0. Is it created in table DEVACCESS, if so where or is it created in SU01 where user id's are maintained. Since I am working on IDES, I thought probably we can create it for each user in SU01, but dont know the steps to do it. Please help me. It is urgent.

    Hi
    ACCESS KEY - First of all its provided by SAP. You can get the key from http://service.sap.com -> SAP SUPPORT PORTAL -> Keys & Requests -> SCCR Keys -> Registration. Here u can register a DEVELOPER or an OBJECT, by this time SAP will give the ACCESS KEYS.
    **Note : To access http://service.sap.com u should have S number login or like that.
    Only after obtaining that ACCESS KEY, SAP will allow the DEVELOPER to create some objects or change or modify Delivered objects.
    Why ACCESS KEY - For creating or accessing any object some one should be responsible. Suppose, any issue arises with an object then can easily track the details who has created or modified.
    Reward with suitable points

  • How to create manual key for AES with 256 key size

    we are just finding Different Approch for secure Key Genration and Store.
    For security purpose which way would be secure to store key in database and retrive that key.
    And can u tell me how to create secure maual key.
    Database user has access they should not able to find the what key we are using .
    Anybody has idea.

    1) Use 'keytool' with option -genseckey
    2) Use SecureRandom and store in a Java Keystore.
    3) Use a Secure Random with something like http://www.strongkey.org/
    4) Use hardware encryption such as produced by nCipher and others.
    There are many other approaches and I would suggest that you bring in an expert to advise you.

  • How to create HMAC256 Key from Key Manager (SAP SWIFT Integration Package)

    Hi,
    I am not sure how to create key HMAC Key. There is 2 input
    Key id = .............
    Key value = .................
    I have tried many times but still having below errors message.
    com.sapcons.xi.swift.CryptServiceException: Parameter key Value is invalid
    Is there any documentation on this ?
    Thank You and Best Regards
    Hidayat

    Solved.
    Key Value Length must be 32 bytes.
    The first 16 digit must be at least 1 number, 1 upper case, 1 lower case.
    The seconds 16 digit also the same.
    each character cannot repeated more than 7 times per each halft.
    There is no documentation about this, i just extract the SCA file and check the program logic.

  • How to create hot key?

    Hi all,
    I'm creating an application by using the J2SE v 1.4.2_10 SDK with NetBeans 4.1 Bundle. I have created 4 button and handles event each. I would like to create a hotkey for each button, "F2" key for jButtton2, "F3" key for jButton3, "F8" key for jButton4, "F1" key for jButton5, once i click on the key, the event will be triggered and the coding inside will be executed.
    Actually I have read through a few including How to Write a Key Listener, How to Write a Component Listener, How to Write an Action Listener, How to Use Actions, How to Use Key Bindings... but i really not so clear about that and don't know how to apply that into my task... Hope someone can help me...Thanks
    The following is part of my coding...
    * RegisterStudent_ADD.java
    * Created on November 15, 2005, 11:12 PM
    import java.awt.*;
    import java.sql.*;
    import javax.swing.*;
    import java.lang.*;
    public class RegisterStudent_ADD extends javax.swing.JFrame {
        /** Creates new form RegisterStudent_ADD */
        public RegisterStudent_ADD() {
            initComponents();
        /** This method is called from within the constructor to
         * initialize the form.
         * WARNING: Do NOT modify this code. The content of this method is
         * always regenerated by the Form Editor.
        // <editor-fold defaultstate="collapsed" desc=" Generated Code ">
        private void initComponents() {
            jDialog1 = new javax.swing.JDialog();
            jOptionPane1 = new javax.swing.JOptionPane();
            jLabel7 = new javax.swing.JLabel();
            jLabel6 = new javax.swing.JLabel();
            jLabel5 = new javax.swing.JLabel();
            jLabel4 = new javax.swing.JLabel();
            jLabel2 = new javax.swing.JLabel();
            jLabel8 = new javax.swing.JLabel();
            jTextField2 = new javax.swing.JTextField();
            jTextField3 = new javax.swing.JTextField();
            jTextField4 = new javax.swing.JTextField();
            jTextField5 = new javax.swing.JTextField();
            jButton5 = new javax.swing.JButton();
            jSeparator2 = new javax.swing.JSeparator();
            jLabel1 = new javax.swing.JLabel();
            jSeparator1 = new javax.swing.JSeparator();
            jButton2 = new javax.swing.JButton();
            jButton3 = new javax.swing.JButton();
            jButton4 = new javax.swing.JButton();
            jLabel3 = new javax.swing.JLabel();
            jDialog1.getContentPane().setLayout(null);
            jDialog1.getContentPane().add(jOptionPane1);
            jOptionPane1.setBounds(0, 0, 262, 90);
            getContentPane().setLayout(null);
            setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
            setTitle("Register Student - ADD");
            jLabel7.setText("Student Phone No");
            getContentPane().add(jLabel7);
            jLabel7.setBounds(5, 180, 150, 14);
            jLabel6.setText("Student Address");
            getContentPane().add(jLabel6);
            jLabel6.setBounds(5, 155, 150, 14);
            jLabel5.setText("Student IC# ");
            getContentPane().add(jLabel5);
            jLabel5.setBounds(5, 130, 150, 14);
            jLabel4.setText("Student Name");
            getContentPane().add(jLabel4);
            jLabel4.setBounds(5, 105, 150, 14);
            jLabel2.setText("Student Code");
            getContentPane().add(jLabel2);
            jLabel2.setBounds(5, 80, 150, 14);
            jLabel8.setBorder(new javax.swing.border.BevelBorder(javax.swing.border.BevelBorder.LOWERED));
            getContentPane().add(jLabel8);
            jLabel8.setBounds(130, 75, 160, 19);
            jTextField2.setColumns(8);
            jTextField2.setName("");
            getContentPane().add(jTextField2);
            jTextField2.setBounds(130, 100, 160, 19);
            jTextField3.setColumns(8);
            jTextField3.setName("");
            getContentPane().add(jTextField3);
            jTextField3.setBounds(130, 125, 160, 19);
            jTextField4.setColumns(8);
            jTextField4.setName("");
            getContentPane().add(jTextField4);
            jTextField4.setBounds(130, 150, 340, 19);
            jTextField5.setColumns(10);
            jTextField5.setName("");
            getContentPane().add(jTextField5);
            jTextField5.setBounds(130, 175, 160, 19);
            jButton5.setText("F1-Retry");
            jButton5.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    jButton5ActionPerformed(evt);
            getContentPane().add(jButton5);
            jButton5.setBounds(5, 34, 90, 23);
            getContentPane().add(jSeparator2);
            jSeparator2.setBounds(0, 30, 800, 2);
            jLabel1.setText("Register Student");
            getContentPane().add(jLabel1);
            jLabel1.setBounds(5, 10, 150, 14);
            getContentPane().add(jSeparator1);
            jSeparator1.setBounds(0, 60, 800, 2);
            jButton2.setText("F2-NxRec");
            jButton2.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    jButton2ActionPerformed(evt);
            getContentPane().add(jButton2);
            jButton2.setBounds(100, 34, 90, 23);
            jButton3.setText("F3-PreRec");
            jButton3.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    jButton3ActionPerformed(evt);
            getContentPane().add(jButton3);
            jButton3.setBounds(195, 34, 90, 23);
            jButton4.setText("F8-Save");
            jButton4.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    jButton4ActionPerformed(evt);
            getContentPane().add(jButton4);
            jButton4.setBounds(290, 34, 90, 23);
            jLabel3.setText("mode : ADD");
            jLabel3.setBorder(new javax.swing.border.TitledBorder(""));
            getContentPane().add(jLabel3);
            jLabel3.setBounds(680, 3, 100, 25);
            setBounds(0, 0, 800, 600);
        // </editor-fold>
        private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) {
    ......//some coding here.
        private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {                             
    ......//some coding here.
        private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {                                        
    ......//some coding here.
        private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {                                        
    ......//some coding here.
         * @param args the command line arguments
        public static void main(String args[]) {
            java.awt.EventQueue.invokeLater(new Runnable() {
                public void run() {
                    new RegisterStudent_ADD().setVisible(true);
        // Variables declaration - do not modify
        private javax.swing.JButton jButton2;
        private javax.swing.JButton jButton3;
        private javax.swing.JButton jButton4;
        private javax.swing.JButton jButton5;
        private javax.swing.JDialog jDialog1;
        private javax.swing.JLabel jLabel1;
        private javax.swing.JLabel jLabel2;
        private javax.swing.JLabel jLabel3;
        private javax.swing.JLabel jLabel4;
        private javax.swing.JLabel jLabel5;
        private javax.swing.JLabel jLabel6;
        private javax.swing.JLabel jLabel7;
        public javax.swing.JLabel jLabel8;
        private javax.swing.JOptionPane jOptionPane1;
        private javax.swing.JSeparator jSeparator1;
        private javax.swing.JSeparator jSeparator2;
        private javax.swing.JTextField jTextField2;
        private javax.swing.JTextField jTextField3;
        private javax.swing.JTextField jTextField4;
        private javax.swing.JTextField jTextField5;
        // End of variables declaration
    }Ning.

    Use the Action architecture (http://java.sun.com/products/jfc/tsc/articles/actions/):
    import java.awt.event.ActionEvent;
    import javax.swing.AbstractAction;
    import javax.swing.Action;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    import javax.swing.KeyStroke;
    public class HotKeyComponent extends JPanel {
         public static void main(String[] args) {
              HotKeyComponent c = new HotKeyComponent();
              UselessAction a1 = new UselessAction("Action 1", "action.1", KeyStroke.getKeyStroke("F1"));
              UselessAction a2 = new UselessAction("Action 2", "action.2", KeyStroke.getKeyStroke("F2"));
              UselessAction a3 = new UselessAction("Action 3", "action.3", KeyStroke.getKeyStroke("F4"));
              c.addButton(a1);
              c.addButton(a2);
              c.addButton(a3);
              JFrame frame = new JFrame("HotKey Test");
              frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              frame.setBounds(100, 100, 400, 300);
              frame.add(c);
              frame.setVisible(true);
         public void addButton(Action action) {
              Object command = action.getValue(Action.ACTION_COMMAND_KEY);
              KeyStroke stroke = (KeyStroke)action.getValue(Action.ACCELERATOR_KEY);
              getInputMap(WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(stroke, command);
              getActionMap().put(command, action);
              JButton button = new JButton(action);
              add(button);
         static class UselessAction extends AbstractAction {
              public UselessAction(String name, Object actionCommand, KeyStroke stroke) {
                   putValue(Action.NAME, name);
                   putValue(Action.ACTION_COMMAND_KEY, actionCommand);
                   putValue(Action.ACCELERATOR_KEY, stroke);
              public void actionPerformed(ActionEvent actionEvent) {
                   System.out.println("actionPerformed " + getValue(Action.NAME));
    }The example contains three buttons. You can either click them, or press the key which is mapped to an Action.

  • How to create foreign key automatically?

    I am writing to seek help, in regards creating foreign key automatically, when I insert data into my ''price'' table.  I have 2 tables, one called prices and names.  the relationship between them, if that one name can have many prices and one price
    can have many names (many-to-many). Hence, i have junction table called  "Name_Prices", as shown below in the sample database schema:
    Names
    name_id [pk]
    name
    type
    UploadDate
    Prices
    Price_id [pk]
    name_id [fk]
    price
    uploadDate
    Name_Prices
    name_id REFERENCE names (name_id)
    price_id REFERENCE prices (price_id)
    PRIMARY KEY (name_id, price_id)
    The  price's data input comes in as CSV file everyday. (please see the example below) :
    name name_type price UploadDate
    ALBA MBS 93.5 17/10/2014
    ALESC Trup 58 17/10/2014
    ALESC Trup 52 17/10/2014
    My desire goal/output is to be able to create a functionality, where I can insert the price's data into the database (''prices''), it will automatically insert foreign key in the price
    table (from the names table), and if there is a new price's name, then the database will create a new name id for it, in the name's table, transferring the name, its type, from the CSV input data. 
    In order to achieve this task, where would I start implementing this logic?(in SQL server or application-side) what steps does this involve and is this task achievable, all in sql server side (i.e. store procedure, functions etc..). 
    Apology in advance, if the question is not clear to understand, i happy to follow up with further questions, if required.  
    Any help would be very appreciated. Many thanks

    As noted above, I modified the design:
    Products
    Product_id [pk]
    Product
    type
    UploadDate
    Prices
    Price_id [pk]
    price
    uploadDate
    Product_Prices
    Product_id REFERENCE Products (Product_id)
    price_id REFERENCE prices (price_id)
    PRIMARY KEY (Product_id, price_id)
    Note
    Kalman Toth Database & OLAP Architect
    SQL Server 2014 Database Design
    New Book / Kindle: Beginner Database Design & SQL Programming Using Microsoft SQL Server 2014

  • How to create Secret Key.

    Hi,
    Can any one point me, where I can find to create a Secret Key and store it inside the KeyStore ?
    I am trying to use the w3'c encryption / decryption and I want to create a key which can be compatible to TripleDESCBC or rsa-1_5.
    Since I am new to all these, any pointer will be helpful.
    Thanks in advance,
    -Kalpesh.

    Asuming you have a JCE Provider installed that support 3DES, try this:
    import javax.crypto.*;
    SecretKey generateSecretKey ( String alg ) {
      SecretKey sk = null;          
      try {
        KeyGenerator keyGen = KeyGenerator.getInstance(alg);
        keyGen.init(new SecureRandom());
        sk = (SecretKey)keyGen.generateKey();
        return(sk);
      } catch (Exception e) {
        e.printStackTrace();
        return null;
    }Pass in "DESede/CBC" or "3DES/CBC" for 'alg'. You might also want to specify the pading, depending on the Provider you're using. BouncyCastle is a good open-source JCE provider that supports 3DES.
    Note that RSA is a MUCH different beast - you want a key-PAIR- there, neither half of which is a SecretKey.
    Good luck,
    Grant

  • How to create surrogate key in dimension without unique value

    Hi, I have a dimension where there is no column with unique value. I want to add a surrogate key to replace the existing primary key which is derived from concatenating 3 columns(e.g. 'A'||'B'||'C'). I'm thinking of using sequence. But this won't allow me to link the dimension to fact table. How do I come up with surrogate key under this situation? Thanks. ~Tracy

    I'm actually trying to accomplish something similar myself.
    In my sources I've got two sorts of customers, ones that are directly reported, and ones whose information is provided with sales records (this is stored in module ODS).
    Of course identification is different, but in the datamart (module DWH) I'm sort of forced to use an equivalent way of loading (due to the way it first used to work). To accelerate lookups on dimensions, I copy the ODS surrogate key to DWH dimensions, but this does not work for the 'inbuilt' customers because they do not have a surrogate key in the ODS.
    They DO have means of unique identification, and at first I thought I could concatenate these (also 3) columns to use as identification code. Unfortunately this is VARCHAR2, where the surrogate key is (naturally) NUMBER.
    So now it looks like I'm forced to first build a table in ODS especially for these 'inbuilt' customers and assign a surrogate key (by sequence) to it, this way it conforms to how 'normal' customers are loaded into DWH.
    I guess you'll have to pull of the same trick, i.e. create a table with either only the 'translation' of D-code to a surrogate key or all information that is fed into the dimension, which then can be used as a lookup or as complete source when loading data into your datamart.
    Good luck, Patrick

  • How to create native key events

    Hello
    can someone tell me please if (and if yes, how) it is possible to create native, therefore by the underlying recognized key events? My Java-App needs to send several key inputs which are also required to be noticed by Windows...
    Thanks
    Matthias

    see java.awt.Robot

  • How to create Origin key

    Hi Everyone,
    Please guide me about how can we create new origin key for new payment types.
    Please guide.
    Thanks and Regards

    HI Bill,
    Thanks for your reply...
    I basically reruire a New Entry into the Standard Table TFK001, which is the Origin Key Table.Simultaneolsly the FM
    FKK_PAYMENT_BATCH_CREATE is using a table TFK001T, which is the Table for Origin key code for getting the Text as per the Document Origin Key(HERKF) from Table TFK001.
    Please help me out how I can do this ??? ....Is It Possible ...??? means can we create a new Entry into these Table...
    Thanks
    MP

Maybe you are looking for

  • Ipod says has no music right after restoring and syncing

    It started with my ipod randomly going to menu in the middle of a song. Then it started skipping. And finally it would go from song to song but wouldn't play. So I restarted it while walking to class. When it got back to the menu it said there were n

  • Tree view control print

    Hi all       I want to set a print option for the tree view control along with back,exit etc options.please help me to do this. Thanks in regards Regards Giri

  • Arithmetic Expression & Relational Check

    Hi - I am implementing a sample use case where for all baggage received, if a bag has been taken off the baggage conveyor belt and not loaded on the aircraft for more than 15 minutes, an alert needs to be sent. I have written the query in the event p

  • Does iPhoto read APS cassette # on Kodak Picture CD

    I've loaded pictures into iPhoto from a Kodak Picture CD from APS film. The photos load as well as the date and time of day that the picture was taken. There is a cassette # on the film cartrige and Picture CD. Is there a way to get this info automat

  • Sort,filter Apexir_rollover issue in IR report

    Hi, I am using apex latest version, My Interactive report has several columns, to help user I have set overflow:auto;Sort,filter Apexir_rollover is working fine only for first few columns, for rest of the columns it disappears, I did refer to the sev