EjbCreate() method return primary key genereted by database

Hello Everyone,
I have entity CMP EJB that maps MySQL database table, which is set to asign Primary key (integer) to new entries automatically by using AUTO_INCREMENT. The problem is ejbCreate(..) method, which returns primary key. My question is: how to make it return primary key generated by database?
Thanks

Hi,
I'm also facing the same problem also. The problem is: how do I code the ejbCreate method?
If I don't initialize the primary key field, I get a complaint that the primary key field needs to be initialized in ejbCreate.
But if I try to initialize it to an arbitrary value, the database won't allow me to do the insert, because the primary key is auto-generated.

Similar Messages

  • EjbCreate returns primary key - auto increment

    ejbCreate of a BMP entity bean must return the primary key.
    If i have an auto-incrementer (in MySQL) and i insert the new data in this method, how can i then find the primary key to return?
    Surely i cannot just use a select statement in another method as the other data in the table may not be unique and may not return the correct primary key.
    Help Please
    Thanks
    Dave

    Hi,
    PreparedStatement ps = con.prepareStatement("INSERT INTO food_data (description)" + " VALUES (?)");
    //Get generated primary key
    ResultSet res = ps.getGeneratedKeys();
    while (res.next())
    {     key = res.getInt(1);
    This code requires JDK 1.4.2.
    Any other soln for previous versions of JDK (1.4.1 or 1.3.1)
    Seetesh

  • Primary Key - Generated by database TRIGGER

    Hi,
    I have a form with a block that is attached to a table. So far, nothing fancy :-)
    The Primary is generated with an ORACLE SEQUENCE. That is done at the TABLE level with a DATABASE trigger.
    So in the form, the primary field is not populated.
    Works fine. But if the user wants to UPDATE the forms content, right after they did an INITIAL commit, THEY CAN'T !!!!!!!!!!!
    How can I code this in the form?
    Is there a way to syncronize (populate) the primary key in the form with it's table content?
    If so, how do I query the table if I don't have the primary key value ?
    Thanks for ANY advise,
    Marc.

    Another solution is to use both a database trigger and a PRE-INSERT trigger in Forms.
    The database trigger should be something like
    CREATE TRIGGER INS_TABLENAME BEFORE INSERT ON TABLENAME
    FOR EACH ROW WHEN (new.ID IS NULL)
    BEGIN
    SELECT TABLENAME_SEQ.nextval INTO :new.ID FROM DUAL;
    END;
    and the PRE-INSERT trigger should be something like:
    SELECT TABLENAME_SEQ.nextval INTO :blockname.ID FROM DUAL;
    This way one solves the problem of DML RETURNING VALUE not working in Forms with Oracle version > 8 (does it work on version 8 as it is said to be? - i have not tested it anyway) and the use of other applications (SQL*Plus, JAVA, etc) without writing any code.

  • Determining the primary key in a database table

    Hi people..
    I am building an interface which displays the database information...according to the specified datasource name..
    Up till now i managed to display the different tables and the respective attributes...
    Is there a way of how i can determine (through java code) if an attribute is the primary key or not of the corresponding table??
    Thanks for your time..
    Regards
    S

    Hi thanks for your reply however when i run the above code i get the following exception..
    java.sql.SQLException: [Microsoft][ODBC Driver Manager] Driver does not support this function
    the statement causing such exception is ..
    ResultSet rs = dbMetaData.getPrimaryKeys(null, null, tableName);
    Do you have any suggestions...??? Sincerely i dont know what i can do..If it can helps the database i m connecting to is an access 2000 database and i am connecting to the database like this:
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    Connection connection = DriverManager.getConnection("jdbc:odbc:"+dataSourceName,username,password);
    Thanks a lot again

  • [SOLVED] Show only primary key columns in database diagrams

    Hi,
    I'd like to create a database diagram with some tables hiding all the columns that aren't primary key or foreign key.
    Currently the only way that I've found is right click on the column's name (in the table body visualized into the diagram) --> Hide selected shape
    I've found the option that permits to visualize the constraint name and (optionally) the relative fields on the same row but what I'd like is something like:
    <Table name>
    <column_name> PK
    <column_name> PK
    <column_name> FK1
    <column_name> FK2
    Do you know a way to do this?
    Many thanks
    Best regards
    Message was edited by:
    Tranen

    Hi Tranen,
    you can view the constraints and respective columns by setting the
    Table Shape Properties in the Property Inspector.
    Select (all) the tables on the Diagram you want
    In the Property Inspector,under Constraints -Set the 'Show Constraint Columns' to 'True',
    Set 'Show Constraints' to 'True' .
    Constraints (PK,UK,FK,Check)
    Also Set the 'Show Columns' option to 'False' .This will be under display options in the Property inspector.
    This should modify the Table shape in the diagram as follows:
    <Table name>
    <PK> PKName:Column1,Column2
    <UK>UKName:Column3
    <FK>FKname:Column1
    are you looking for the same?
    Thanks.

  • Insert into table returning primary key (auto number) in resultset

    Hi,
    I'm connecting to Oracle 10g via JDBC (ojdbc14.jar).
    My SQL statement is as follows:
    INSERT into Student (studentName, phone, email, address) values ('Jason', '12345678', 'test', 'test');
    SELECT Student_studentId_SEQ.NEXTVAL FROM DUAL;
    Fyi -The Student table has a trigger to support the generation of a primary key (integer) based on a sequence when a new record is inserted.
    What the above will do (from the Java app point of view) is to create a Student record and automatically select the student ID so that the student ID can be accessed via the resultset in Java.
    I'm getting error "ORA-00911: invalid character". Can you please help?
    Regards,
    Jason
    Edited by: user10394130 on Oct 13, 2008 2:40 AM

    Yes, I'm referring to the studentId, which is generated via the Student table trigger on insert of a new record.
    I've now verified that the following SQL works and it is "printing" the correct studentId.
    DECLARE seqNbr_studentId NUMBER(12) := 0;
    BEGIN
    INSERT into Student (studentName, phone, email, address) values ('Jason', '12345678', 'test', 'test')
    RETURNING studentId INTO seqNbr_studentId;
    dbms_output.put_line(seqNbr_studentId);
    END;
    --> This prints the correct value of seqNbr_studentId that has been generated by the trigger. This is good.
    However, I would like the studentId to be in a resultset (so that I can access this via Java Resultset.getInt(1) ), for example:
    DECLARE seqNbr_studentId NUMBER(12) := 0;
    BEGIN
    INSERT into Student (studentName, phone, email, address) values ('Jason', '12345678', 'test', 'test')
    RETURNING studentId INTO seqNbr_studentId;
    SELECT seqNbr_studentId FROM DUMMYTABLE;
    END;
    Is this possible?
    What I'm trying to do is to achieve the effect in SQL Server where I can simply do an SQL command "SELECT @@IDENTITY" where it returns the auto number from the newly inserted record.
    Regards,
    Jason
    Edited by: user10394130 on Oct 13, 2008 2:08 AM
    Edited by: user10394130 on Oct 13, 2008 2:56 AM

  • Retrieving Primary Keys MetaData from database

    Hello all,
    I am trying to retrieve a list of primary keys, give a catalogname, schemaname and tablename. But the ResultSet that's being returned doesn't have the "PK_NAME" column itself.
    ResultSet rset = dbm.getPrimaryKeys(null,null,tablename);
    while(rset.next())
    ResultSetMetaData rsmetadata = rs.getMetaData();
    int ncols = rsmetadata.getColumnCount();
    for(int i=1;i<=rsmetadata.getColumnCount();i++)
    //Here's where I print the columnnames in the ResultSet
         System.out.println(rsmetadata.getColumnName(i));
    Can someone tell me how to retrieve the list of primary keys if not this way?
    Thanks

    Ahh don't worry about this. I figured out the problem :)
    Thanks guys.

  • ?Trigger to return primary key value after insert"

    Ok, so I'm a newbie to oracle. I was hoping someone could tell
    me how I can get the value of a field after insertion. I
    created a sequence and a trigger to autoincrement the primary
    key. I figured out that select @@Identity does not work. So
    I'm trying to figure out how to return the primary key value of
    just inserted record.
    Any help or suggestions would be really appreciated.
    thanks matt

    I have 3 tables - master, detail and collector.
    when a record is inserted into the collector table - I want to fire a trigger and insert the value of "collector.a_test", "collector.b_test" into "master.test" and "detail.test" respectively.
    I want to create an after/insert trigger on the collector table to accomplish this. I tried to implement the example listed in previous message (see below) *** BUT **** I get a PLS-00103 error - "Encountered the symbol "A_ID" when expecting one of the following: :=. ( @ %;
    Note: master, detail and collector have before insert trigger/sequence that assigns their PK values.
    master has 2 columns - a_id (number PK), a_test (varchar2(255))
    detail has 3 columns - b_id (number PK), b_test (varchar2(255)), aa_id (number FK)
    collector has 3 columns - c_id (number PK), a_test (varchar2(255)), b_test (varchar2(255))
    as in;
    create or replace trigger wf.c_a_b_insert
    after insert on wf.collector
    referencing old as old new as new
    for each row
    declare
    aa_id master.a_id%type;
    begin
    insert into master (a_test) values(:new.a_test);
    returning a_id into aa_id;
    /* now insert into detail and get the FK value from aa_id */
    end;
    What am I doing wrong and how can I fix this?
    Thanks much!
    Bill G...

  • Adding 2 primary keys in mdf database in VS Community 2013 from Server Explorer

    Hello,
    I have to update a Windows Forms application using VS Community 2013. I have to add a little database with customers and installations, so 1 customer can manage many installations and 1 installation can be managed by many customers. It is the first
    time that use VS 2013 so I don't know if I have done all steps well:
    Right click in the project item -> Add -> New item -> Data -> Service-base Database. I don't know what "service-based" means, but is the only way I can see to add a database. This step added
    mydb.mdf file to the project.
    Server Explorer -> Data Connections -> mydb.mdf -> Right click on Tables -> Add New Table. I have added
    Customer and Installation tables with no problem. These are T-SQL scripts:
    CREATE TABLE [dbo].[Customer]
    [UserName] NVARCHAR(50) NOT NULL PRIMARY KEY,
    [Password] NVARCHAR(50) NOT NULL,
    [FullName] NVARCHAR(50) NOT NULL,
    [Company] NVARCHAR(50) NULL,
    [Contact] NVARCHAR(100) NULL
    CREATE TABLE [dbo].[Installation]
    [Imei] NVARCHAR(15) NOT NULL PRIMARY KEY,
    [Ip] NVARCHAR(15) NOT NULL,
    [Name] NVARCHAR(50) NOT NULL
    Now, I have to create CustomerInstallation table with 2 primary keys. The script:
    CREATE TABLE [dbo].[CustomerInstallation]
    [UserName] NVARCHAR(50) NOT NULL ,
    [Imei] NVARCHAR(15) NOT NULL,
    PRIMARY KEY ([UserName]),
    PRIMARY KEY ([Imei]),
    CONSTRAINT [FK_CustomerInstallation_Customer] FOREIGN KEY ([UserName]) REFERENCES [Customer]([UserName]),
    CONSTRAINT [FK_CustomerInstallation_Installation] FOREIGN KEY ([Imei]) REFERENCES [Installation]([Imei])
    When I click the Update button, I get the following error message:
    Update cannot proceed due to validation errors.
    Please correct the following errors and try again.
    SQL71533 :: A table or table-valued function ([dbo].[CustomerInstallation]) contains more than one primary key.
    SQL71531 :: The table or view ([dbo].[CustomerInstallation]) has more than one clustered index.
    So my question is: How can I add 2 primary keys to the table? Is it posible with this "service-based" database?
    Thank you for all,
    Jon.
    PD: I didn't know in what forum write this question, please, move this thread to the appropriate forum. Sorry for the inconvenience.

    You can only have one primary key per table but the primary key can be over multiple columns so:
    CREATE TABLE [dbo].[CustomerInstallation]
        [UserName] NVARCHAR(50) NOT NULL , 
        [Imei] NVARCHAR(15) NOT NULL, 
        PRIMARY KEY ([UserName], [Imei]),    
        CONSTRAINT [FK_CustomerInstallation_Customer] FOREIGN KEY ([UserName]) REFERENCES [Customer]([UserName]),
        CONSTRAINT [FK_CustomerInstallation_Installation] FOREIGN KEY ([Imei]) REFERENCES [Installation]([Imei])
    will let you have both columns as part of the primary key

  • How to code the ejbCreate() method without initailizing primary key?

    Hi all,
    I've just started learning about EJBs, and now am at the stage of learning how to create, deploy and test a CMP Entity Bean.
    Ran into a problem which I'm hoping someone can help out with.
    I'm using SQL Server 2000 as my backend database, and have created a simple table called TEST with 2 fields, id and name. id is set as the primary key, and as an identity conlumn. What this means is that when we do inserts, we don't need to specify a value for the id column. SQL Servers automatically generates that value.
    Here's my ejbCreate method in my bean class:
    public Integer ejbCreate(String name) throws CreateException {
        this.setName(name);
    }When I tried to run the create method from a web client, I got this error:
    javax.ejb.CreateException: [EJB:010148]In EJB 'SampleEJB', the primary key field 'id' was not set during ejbCreate. All primary key fields must be initialized during ejbCreate. at weblogic.rmi.internal.ServerRequest.sendReceive(ServerRequest.java:186) at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:284) at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:244) at everbright.ejb.SampleEJB_uzc4wg_HomeImpl_813_WLStub.create(Unknown Source) at jsp_servlet.__index._jspService(__index.java:152) at weblogic.servlet.jsp.JspBase.service(JspBase.java:33) at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:996) at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:419) at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:315) at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6452) at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321) at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118) at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3661) at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2630) at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219) at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)
    So it seems like I can't leave the id field uninitialized in the ejbCreate method. However I don't know what to initialize it with either, because in order to know what value I need to initialize it to, I'll need to run a db query to retrieve the next primary key value for the id field. This doesn't sound very efficient to me.
    I tried to initailize it to null, but that gave me a NullPointerException.
    Why do we need to initialize the primary key field in ejbCreate? Should the container do the insert and then get it from the table accordingly?
    Is there any other way I can get this set-up working?
    Thanks!

    Hi Fusion777,
    Ya, I've been searching around forums for an answer also. Apparently this is indeed a problem that has no general solution. It depends on 2 factors:
    1) Whether or not the database supports autogenerate key (which most does) and how (Oracle does it by sequences while SQL Server by identities)
    2) Whether or not the application server supports 1).
    In my case, I'm using SQL Server and Weblogic Server 8.1 and most fortunately, Weblogic does support identities and sequences. Just define the <auto-key-generation> stanza in your weblogic-cmp-rdbms-jar.xml deployment descriptor, as follows:
    <automatic-key-generation>
         <generator-type>ORACLE</generator-type>
         <generator-name>test_sequence</generator-name>
         <key-cache-size>10</key-cache-size>
    </automatic-key-generation>
    <automatic-key-generation>
         <generator-type>SQL-SERVER</generator-type>
    </automatic-key-generation>
    <automatic-key-generation>
         <generator-type>NAMED_SEQUENCE_TABLE</generator-type>
         <generator-name>MY_SEQUENCE_TABLE_NAME</generator-name>
         <key-cache-size>100</key-cache-size>
    </automatic-key-generation>I've tried that and it works :-)
    I gather from your reply that those who are using JBoss are equally fortunate :-)
    So I thought I'll share this in case some other poor fellow is facing the same problem as we are. At least worse come to worse, he'll have the option of switching to either JBoss or Weblogic and know that it works in both :-)
    Some other users seem to be against the idea of using auto-generated keys for precisely the reason that it is not a standard across database and application servers. See this thread:
    http://forum.java.sun.com/thread.jspa?forumID=13&threadID=329896
    I've in fact stopped working on EJB 2.0 and am exploring something called Hibernate, which seems to have a more generic way of dealing with the auto-generated key issue. In fact, I've heard news that EJB 3.0, which is the upcoming standard for EJB, will be heavily inspired by Hibernate as far as CMP Entity Beans are concerned.
    You can check out Hibernate at http://www.hibernate.org.

  • How can I use a mySQL database schema with numeric auto increment primary key instead of GUID?

    Hello!
    I'm using the TestStand "MySQL Insert (NI)" database schema with GUID as primary key. So everything works fine.
    But I prever using numeric values as primary key, because the database is in conjunction with another database which uses numeric values as primary key.
    Is this possible?
    Has anyone an idea how I can modify the "Generic Recordset (NI)" for use with MySQL?
    Thanks!
    Configuration:
    Microsoft Windows XP
    TestStand 3.1
    MySQL 4.1.12a
    MySQL ODBC 3.51 Driver
    Brosig

    Adam -
    The TestStand Database Logging feature does not allow you to run a separate SQL command after executing the command for a statement(table), so I do not think that you can use an auto incrementing column for the tables. There is just no way to get it back in a generic way. One option that I tried is something similar to the Oracle schema where you call a store procedure to return a sequence ID for each record that you want to add.
    So you would have to create the following sequence table in MySQL:
    CREATE TABLE sequence (id INT NOT NULL);
    INSERT INTO sequence VALUES (0);
    Then create a stored procedure as shown below that will increment the sequence value and return it in a recordset:
    CREATE PROCEDURE `getseqid`()
    BEGIN
            UPDATE sequence SET id=LAST_INSERT_ID(id+1);
            SELECT LAST_INSERT_ID();
    END
    Then update the MySQL tables to use INT primary and foreign key values, so the TestStand MySQL SQL file to create all tables would have text like this:
    CREATE TABLE UUT_RESULT
     ID    INT  PRIMARY KEY,
    ~
    CREATE TABLE STEP_RESULT
     ID    INT  PRIMARY KEY,
     UUT_RESULT   INT  NOT NULL,
    ~
    Then update the schema primary and foreign key columns in the TestStand Database Options dialog box to be INT to match the table. For the primary key columns, you will have to set the Primary Key Type to "Get Value from Recordset" and set the Primary Key Command Text to "call getseqid()". This will call the stored procedure to determine the next value to use as the ID value.
    Hope this helps...
    Scott Richardson
    National Instruments

  • Case In-Sensitive primary key (NVARCHAR2 datatype) in Oracle 10g

    I have primary keys in my database which are of NVARCHAR2 type. By default data is inserted into these columns as case sensitive which means insertion of both 'ABCD' and 'Abcd' are allowed.
    Can I change the settings in Oracle so that the primary keys work case in-sensitively? I wanted Oracle to throw an error if someone is inserting 'Abcd' and if there is already a record with primary key 'ABCD'.
    Note: I am using Entity Framework.

    Some ideas:
    One method would be to place a before insert trigger on the data and upper it.
    You could add another column, populate via a trigger as upper(), then build a unique index on this column.
    See the following Oracle documentation on case insensitive searchs and comparisons
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14225/ch5lingsort.htm#i1008800
    Oracle support documents:
    Develop Global Application: Case-insensitive searches #342960.1
    How to use Contains As Case-Sensitive And -Insensitive On The Same Column #739868.1
    How To Implement Case Insensitive Query in BC4J ? #337163.1
    HTH -- Mark D Powell --

  • How to create Primary key

    I want to insert HOSTID that has unique values in a new application in a primary key column in database.
    I am starting with h000000001
    and I want to go from that to h000000002
    and .... h0000000010 , 11, 12 etc etc.
    How do I do this?
    I did this:
    rs = stmt.executeQuery("select wlbmach_host_id from wlbmach order by wlbmach_host_id desc");
    // I am getting the greatest value eg: h000999999
    if (rs.next())
    getHostID = (String)rs.getString("wlbmach_host_id");
    //Get the h0009999999
    getStringNumber = getHostID.substring(1,10);
    //This gives me 9999999
    try
    {getNum = Integer.parseInt(getStringNumber);
    //change number to integer so I can add 1 to it
    getNum=getNum+1;
    getStringNumber=Integer.toString(getNum);//make that a string
    getHostID="h"+getNum;//add h to it
    }//try
    catch(Exception e)
    {System.out.println("NumberFormatException might have occured");%>
    else
         System.out.println("Assigning first HostID");
         getHostID = "h00000001";
    System.out.println("HostID is "+getHostID);
    But gives Exception:String index out of range: 10.. My column can take 10 varchar ??
    Can someone help .. Is this the right way to do it ?
    Is there a better way to generate primay keys?

    Why are you making life difficult??? Why not use the SEQUENCE object (if you are using Oracle)? You can retrieve next value by "Select sequencename.nextval from dual" as the query...you will get your number. Also, when two requests are made at the same time, Oracle takes care of this problem for you...you do not need to synchronize the method in JAVA. Do some research in this...I think you will like it.

  • Trouble with primary key in query string

    Switching from asp to php, so working with David Power's book:  The Essential Guide to Dreamweaver CS4 with CSS, AJAX and PHP.  Retraining my brain, so starting from scratch in the learning process.
    Everything was going perfectly until I tried to add a record's primary key to a query string.  I have compared my code with the book's example code, and everything matches.  When previewing the page in my browser, and hover over the link that should pass the primary code to the next page, the query string doesn't display properly.  It shows user_id=    but no number shows, as it is supposed to.  www.webpage.com/update_user.php?user_id=
    Here is my code: (please note, <> have been removed, as I was unable to figure out how to display the code the correct way on here (copy/paste was not working, nor Insert Syntax highlighting)
    ?php do { ?       
    ?php echo $row_listUser['family_name']; ?, ?php echo $row_listUser['first_name']; ?       
    ?php echo $row_listUser['username']; ?       ?php echo $row_listUser['admin_priv']; ?     
    a href="update_user.php?user_id=?php echo $row_listUser['user_id']; ?"Edit/a     
    a href="delete_user.php?user_id=?php echo $row_listUser['user_id']; ?"Delete/a         
    ?php } while ($row_listUser = mysql_fetch_assoc($listUser)); ?
    Any ideas that could help me figure out why this part in particular isn't working would be greatly appreciated.  Writing to the database worked perfectly, I see that there are numbers in the database under user_id, and it is set as my primary key in the database setup.  Such a simple process that is causing me such a headache!
    Thanks

    Hoping this will work- complete code of page.  Hopefully you can see what isn't right!
    <?php require_once('../Connections/connSCFDIR.php'); ?>
    <?php
    if (!function_exists("GetSQLValueString")) {
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
      if (PHP_VERSION < 6) {
        $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
      $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
      switch ($theType) {
        case "text":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;   
        case "long":
        case "int":
          $theValue = ($theValue != "") ? intval($theValue) : "NULL";
          break;
        case "double":
          $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
          break;
        case "date":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;
        case "defined":
          $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
          break;
      return $theValue;
    mysql_select_db($database_connSCFDIR, $connSCFDIR);
    $query_listUser = "SELECT user_id, username, first_name, family_name, admin_priv FROM users ORDER BY family_name ASC";
    $listUser = mysql_query($query_listUser, $connSCFDIR) or die(mysql_error());
    $row_listUser = mysql_fetch_assoc($listUser);
    $totalRows_listUser = mysql_num_rows($listUser);
    $query_listUser = "SELECT username, first_name, family_name, admin_priv FROM users ORDER BY family_name ASC";
    $listUser = mysql_query($query_listUser, $connSCFDIR) or die(mysql_error());
    $row_listUser = mysql_fetch_assoc($listUser);
    $totalRows_listUser = mysql_num_rows($listUser);
    ?>
    <?php require_once('../css/scf_admin.css'); ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title>
    <link href="/css/scf_admin.css" rel="stylesheet" type="text/css" /><!--[if IE 5]>
    <style type="text/css">
    /* place css box model fixes for IE 5* in this conditional comment */
    .twoColFixRtHdr #sidebar1 { width: 220px; }
    </style>
    <![endif]--><!--[if IE]>
    <style type="text/css">
    /* place css fixes for all versions of IE in this conditional comment */
    .twoColFixRtHdr #sidebar1 { padding-top: 30px; }
    .twoColFixRtHdr #mainContent { zoom: 1; }
    /* the above proprietary zoom property gives IE the hasLayout it needs to avoid several bugs */
    </style>
    <![endif]-->
    <script src="/SCFSpryAssets/SpryMenuBar.js" type="text/javascript"></script>
    <link href="/SCFSpryAssets/SpryMenuBarHorizontal.css" rel="stylesheet" type="text/css" />
    </head>
    <body class="twoColFixRtHdr">
    <div id="container">
      <div id="header">
      <div id="mainContent"><br />
      <h1>View Users</h1>
      <table width="500" border="1">
      <tr>
        <td>Name</td>
        <td>Username</td>
        <td>Administrator</td>
        <td> </td>
        <td>  </td>
      </tr>
      <?php do { ?>
        <tr>
          <td nowrap="nowrap"><?php echo $row_listUser['family_name']; ?>, <?php echo $row_listUser['first_name']; ?></td>
          <td><?php echo $row_listUser['username']; ?></td>
          <td><?php echo $row_listUser['admin_priv']; ?></td>
          <td><a href="update_user.php?user_id="<?php echo $row_listUser['user_id']; ?>">Edit</a></td>
          <td><a href="delete_user.php?user_id="<?php echo $row_listUser['user_id']; ?>">Delete</a></td>
        </tr>
        <?php } while ($row_listUser = mysql_fetch_assoc($listUser)); ?>
      </table>

  • Diff b/w primary key and unique key?

    what is the diff b/w primary key and unique key?

    Hi,
    With respect to functionality both are same.
    But in ABAP we only have Primary key for the Database tables declared in the Data Dictionary.
    Unique is generally is the term used with declaring key's for internal tables.
    Both primary and Unique keys can identify one record of a table.
    Regards,
    Sesh

Maybe you are looking for

  • I lost the ability to scroll with my touch pad. Did I accidentally hit a key combo? how to get it back?

    Somehow I lost the ability to scroll up/down on my Asus laptop touchpad. I can scroll up/down with left-click held down using the scroll bar, but not with he mousepad. Allother thigs work okay. My guess is that I hit a combination of keys that turned

  • IBots: Save report as CSV file on to a disk using iBot

    Hi Experts, The requirement is to configure an iBot, which saves a report as CSV flie at a give address on hard drive (eg: C:\iBots\files\my_report.csv). this file must be updated every week. thanks in advance for ur help, Surya

  • How Route List work?

    Hey, I would like to add 2 MGCP gateway in a Router list. But, How CUCM knows if specif gateway is up? By Network conectivity, E1 port status or both? thanks.

  • SSO message processing

    Hi, While reading "Enterprise Single Sign-On", I came across section "Message Processing With an SSO Ticket". Here, the explanation contains 2 SSO (SSO Server A and SSO Server B). But, I have seen many times that there is only single SSO Server. How

  • Putting Ultra ATA drive into Mac Pro

    I need to get data off of a drive that was in a PC that crashed. Any issues putting it in one of the bays of my (2009) Mac Pro?