Database array questions

Disclaimer: I am new to DB's.
I'm looking at creating a MySQL database to hold tests done on DUTs (each with a specific serial). In theory, each DUT undergoes 3 tests. Each test produces a 401x9 2D array of DBLs. I am not concerned with the write speed to the DB, but I do want to optimize the read of the DB (potentially may need to retrieve 1000+ of these 2D arrays as fast as possible). I have the DB Toolkit; using LV 8.5. Questions:
1. I have seen two different ways to save a 2D array in a DB mentioned: first, writing one row at a time with the DB Insert vi, resulting in a 2D array in a table (which is slow writing) or second, changing the 2D array to a variant and using the DB Insert vi, resulting in a single cell in a table. I know I can use other methods (parameterized vi, sql commands, user defined functions on the DB server, please do comment if you have found drastic performance increase with these methods), but of the two ways of storing a 2D array, can I read a 2D array from a table faster than reading a 2D array from a single cell? Whenever I need this data, I will read it all (i.e. I will never have to search for certain data within these individual 2D arrays)
2. I may have installed the 8.2.1 DB toolkit, because the Database Variant to Data vi/function does not drop onto the Block Diagram when I drag it from the palette, and the Help has ???. I assume this is because it just points to the normal Variant to Data, which in 8.5 is in a subpalette as compared to 8.2.1. Any quick way to fix this?
3. Any other general suggestions for a DB newbie? I've been trying to derive best practices from KB aritcles, this forum, and the web, but there is so much information and so many varying opinions I find it hard to narrow down best practices.
Michael

Hi Miguel,
It looks like you are embarking on a very interesting project. Although you probably have seen many of the following documents, I've linked a few to get you started.
Discussion forum using LabVIEW to read from tables
Developer Zone article about developing a test system
Knowledgebase article about imitations of speed with database toolset
As far as your first question, I would suggest trying out both methods with simple code and testing with a small amount of values to determine  which one will be the fastest.
Good luck with your project!
Amanda Howard
Americas Services and Support Recruiting Manager
National Instruments

Similar Messages

  • Database array

    I created a simple database array. It got cluster controls showing name, age and martial status. But I need to write these data into a xls file and I can't add new data. With bundle by name function I can only change some data but I can't add new one.
    Attachments:
    Cluster.vi ‏12 KB

    If this is to be a subVI of a larger program, you need to set up the connector pane.  You also need an output indicator for the Database Array.  You cannot pass the control to the output.  Generally the use of local variables should be minimized in LabVIEW.  If this is not a subVI, then you need to add a while loop around the code.  Do NOT use Run Continuously! It is only for debugging purposes.
    You do not need the unbundle and bundle nodes since you are setting the entire New Data cluster.
    You should make the New Data cluster a typedef so that when you make changes such as adding an address field, you only need to change it one place.  Use the typedef cluster as the element in the Database Array also.
    If you do not care where the new data is placed in the Database Array, and generally a database does not care, then just use Build Array in the New Data Case.
    Here is a modified version with these changes.
    Lynn
    Attachments:
    New Data.ctl ‏13 KB
    Database update ni_com forum.2.vi ‏14 KB

  • Some basic HP Smart Array questions

    Hopefully a simple answer to what seems to be a fairly simple question...
    If, for example, you have a P800 HP Smart Array with 24 disks and a spare and you want to partition a number of database files across drives to maximise I/O performance (the transaction log file is heavy on writes and the other data and index files are heavy on reads), would it be better to:-
    a) Use the 24/25 disks to create one SAS Array and three logical drives:-
    SAS Array A with spare - 3 Logical drives
         Logical Drive 1 (1200 Gb, RAID 1+0)  
         Logical Drive 2 (1200 Gb, RAID 1+0)
         Logical Drive 3 (1200 Gb, RAID 1+0)
    b) Use the 24 disks to create three SAS arrays each with one Logical Drive:-
    SAS Array A  & Logical Drive 1  (1200 Gb, RAID 1+0)  
    SAS Array B  & Logical Drive 1 (1200 Gb, RAID 1+0)  
    SAS Array C  & Logical Drive 1  (1200 Gb, RAID 1+0)  
    Not sure how the Spare disk fits into Option B?
    Anyway, if the objective is to maximize I/O performance, is it Option A or B?    
    The phrase, 'logical drive'... Does this mean that I/O is partitioned at the logical drive level or does the HP Smart array controller spread the I/O across the SAS Array?  If I look at I/O counters (eg. Perfmon on Windows Server), I can see that Logical drives as in Option A seem to be separated completely as one logical drive could have a disk queue and other logical drives on top of the same SAS array will not have a disk queue.  What are the prose and cons of Option A and B?  Understanding these issues will help me to come up with the right configuration in terms of arrrays and logical drives.
    Thanks in advance,
    Clive

    Hi, Clive:
    I'm not so sure yours is a fairly simple question for the HP consumer notebook forum.
    You may want to copy and paste your post in the HP Business Support Forum -- Disk Array section.
    http://h30499.www3.hp.com/t5/Disk-Array/bd-p/itrc-195

  • ACS 5.3 Database backup questions

                 I do an incermental backup every day at 02:00
    IncrementalBackup-Job
    Mon Sep 17 02:00:00 EST 2012
    Mon Sep 17 02:00:02 EST 2012
    Completed
    But  I get the  
    System Alarm [Database Purging]
    Mon Sep 17 04:00:00
    Incremental Backup not configured
    why?
    see contents of repository below so it is there
    CHIACS71/chacs01# sh repository DataBase
    acsviewdbfull_CHIACS71_20120912_095516.tar.gpg
    acsviewdbfull_CHIACS71_20120913_020000.tar.gpg
    acsviewdbincr_1_CHIACS71_20120914_020000.tar.gpg
    acsviewdbincr_2_CHIACS71_20120915_020000.tar.gpg
    acsviewdbincr_3_CHIACS71_20120916_020000.tar.gpg
    acsviewdbincr_4_CHIACS71_20120917_020000.tar.gpg
    catalog.xml
    repolock.cfg
    CHIACS71/chacs01#
    second question can I use my secondary ACS for the DataBase repository?

    Hi,
    You should use an nfs server, sftp or ftp repository for backups only, something that is dedicated for storage. I would not recommending using anything that is used for production which needs internal storage to take on the task of managing another applications data.
    As far as the the first question, i am not talking about the purging, i am talking about the scheduled application backups:
    http://www.cisco.com/en/US/docs/net_mgmt/cisco_secure_access_control_system/5.3/user/guide/admin_operations.html#wp1076238
    Tarik Admani
    *Please rate helpful posts*

  • Database connection question...

    i am using Java 1.5.0_06 and to connect to MySQL database i use Connector/J and the following code:
    try {
    Class.forName("com.mysql.jdbc.Driver");
    } catch(java.lang.ClassNotFoundException e) {
    System.err.print("Main: ClassNotFoundException: ");
    System.err.println(e.getMessage());
    return;
    try {
    con = DriverManager.getConnection(dburl);
    ps = con.prepareStatement(
    I was told i should be using a DataSource to do connection pooling and i have read over the info and downloaded jdbc2_0-stdext.jar and i am using MySQL and windows XP pro.
    the code looks like this
    Context ctx = new InitialContext();
    DataSource ds = (DataSource)ctx.lookup("jdbc/InventoryDB");
    Connection con = ds.getConnection("myUserName", "myPassword");
    then i just use con as i have already in my code.
    Can someone please point me in the right direction to get this working.
    I read this:
    A systems administrator or someone working in that capacity deploys a DataSource object. Deployment, which involves setting the DataSource object's properties and then registering it with a JNDI naming service, is generally done with a tool. As part of the registration process, the systems administrator will associate the DataSource object with a logical name. This name can be almost anything, usually being a name that describes the data source and that is easy to remember. In the example that follows, the logical name for the data source is InventoryDB . By convention, logical names for DataSource objects are in the subcontext jdbc , so the full logical name in this example is jdbc/InventoryDB .
    i have goggled but can't seem to find out exactly what i need to do next.
    I can't find the "tool" and have to be honest i am lost lol.
    can the The JDBC 2.0 Optional Package work with Java 1.5.0_06?

    i am using Java 1.5.0_06 and to connect to MySQL database i use Connector/J and the following code: i updated it to use manual connection pooling like so:
    final String dburl = "jdbc:mysql://localhost/......";
    Connection con = null;
    try {
    Class.forName("com.mysql.jdbc.Driver");
    } catch(java.lang.ClassNotFoundException e) {
    System.err.print("Main: ClassNotFoundException: ");
    System.err.println(e.getMessage());
    return;
    try {
    DataSource dataSource = setupDataSource(dburl);
    con = dataSource.getConnection();
    con.close();
    public static DataSource setupDataSource(String connectURI) {
    ObjectPool connectionPool = new GenericObjectPool(null);
    ConnectionFactory connectionFactory = new DriverManagerConnectionFactory(connectURI,null);
    PoolableConnectionFactory poolableConnectionFactory = new PoolableConnectionFactory(connectionFactory,connectionPool,null,null,false,true);
    PoolingDataSource dataSource = new PoolingDataSource(connectionPool);
    return dataSource;
    so i compiled and ran it and it worked no problem but my question is that this is a server that does some db work upon starting and then waits for clients like so:
    while (listening)
         new PSMultiServerThread(serverSocket.accept()).start();
    so once i am in PSMultiServerThread what exactly do i need to do?
    i know i don't need to do this again:
    Class.forName("com.mysql.jdbc.Driver");
    but do i need to do this again:
    DataSource dataSource = setupDataSource(dburl);
    i geuss i have to to declare the variable lol.
    and do i include this code in the PSMultiServerThread
    public static DataSource setupDataSource(String connectURI) {
    ObjectPool connectionPool = new GenericObjectPool(null);
    ConnectionFactory connectionFactory = new DriverManagerConnectionFactory(connectURI,null);
    PoolableConnectionFactory poolableConnectionFactory = new PoolableConnectionFactory(connectionFactory,connectionPool,null,null,false,true);
    PoolingDataSource dataSource = new PoolingDataSource(connectionPool);
    return dataSource;
    --------------------------------------------------------------------------------------

  • Multiple Database Servers Question

    Hi,
    Please forgive this ignorant question, but can someone tell
    me how one would go about using multiple database servers?
    Just as there comes a time where one would need more than
    one web server and would need to use a load balancing
    solution, what happens when one would need more than one
    Database Server?
    How does one go about implementing that solution?
    Is there some way to have two database servers carrying the
    same information with some kind of load balancing solution
    in front of it(?) or does one place some tables on one
    Database
    server, and other tables on the other database server?
    (I have no clue as to how things would work.)
    Thanks in advance,
    Joe

    Microsoft SQL allows for clustering of SQL databases, so for
    instance two servers connected to a fileshare and a virtual address
    shared across the two physical boxes. Database connections are made
    to the virtual addres which will then be handled by the active
    node. Becuase a database is ultimately a file(s) on a disk it can
    only be attached to one node at a time so you end up with an
    active/inactive cluster.

  • Trying to send multiple types in a byte array -- questions?

    Hi,
    I have a question which I would really appreciate any help on.
    I am trying to send a byte array, that contains multiple types using a UDP app. and then receive it on the other end.
    So far I have been able to do this using the following code. Please note that I create a new String, Float or Double object to be able to correctly send and receive. Here is the code:
    //this is on the client side...
    String mymessage ="Here is your stuff from your client" ;
    int nbr = 22; Double nbr2 = new Double(1232.11223);
    Float nbr3 = new Float(8098098.809808);
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    ObjectOutputStream oos = new ObjectOutputStream(baos);
    oos.writeObject(mymessage);
    oos.writeInt(nbr);
    oos.writeObject(nbr2);
    oos.writeObject(nbr3);
    oos.close();
    byte[] buffer = baos.toByteArray();
    socket.send(packet);
    //this is on the server side...
    byte [] buffer = new byte [5000];
    String mymessage = null; int nbr = 0; Double nbr2 = null;
    Float nbr3 = null;
    mymessage = (String)ois.readObject();
    nbr = ois.readInt();
    nbr2 = (Double) ois.readObject();
    nbr3 = (Float) ois.readObject();
    My main question here is that I have to create a new Float and Double object to be able to send and receive this byte array correctly. However, I would like to be able to have to only create 1object, stuff it with the String, int, Float and Double, send it and then correctly receive it on the other end.
    So I tried creating another class, and then creating an obj of this class and stuffing it with the 4 types:
    public class O_struct{
    //the indiv. objects to be sent...
    public String mymessage; public int nbr; public Double nbr2;
    public Float nbr3;
    //construct...
    public O_struct(String mymessage_c, int nbr_c, double nbr2_c, float nbr3_c){
    my_message = my_message_c;
    nbr = nbr_c;
    nbr2 = new Double(nbr2_c);
    nbr3 = new Float(nbr3_c);
    Then in main, using this new class:
    in main():
    O_struct some_obj_client = new O_struct("Here is your stuff from your client", 22, 1232.1234, 890980980.798);
    oos.writeObject(some_obj_client);
    oos.close();
    send code....according to UDP
    However on the receiving side, I am not sure how to be able to correctly retrieve the 4 types. Before I was explicitely creating those objects for sending, then I was casting them again on the receiving side to retrieve then and it does work.
    But if I create a O_struct object and cast it as I did before with the indiv objects on the receiving end, I can't get the correct retrievals.
    My code, on the server side:
    O_struct some_obj_server = new O_struct(null, null, null. null);
    some_obj_server = (O_struct)ois.readObject();
    My main goal is to be able to send 4 types in a byte array, but the way I have written this code, I have to create a Float and Double obj to be able to send and receive correctly. I would rather not have to directly create these objects, but instead be able to stuff all 4 types into a byte array and then send it and correctly be able to retrieve all the info on the receiver's side.
    I might be making this more complicated than needed, but this was the only way I could figure out how to do this and any help will be greatly appreciated.
    If there an easier way to do I certainly will appreciate that advise as well.
    Thanks.

    public class O_struct implements Serializable {
    // writing
    ObjectOutputStream oos = ...;
    O_struct struct = ...;
    oos.writeObject(struct);
    // reading
    ObjectInputStream ois = ...;
    O_struct struct = (O_struct)ois.readObject();
    I will be sending 1000s of these byte arrays, and I'm sure having to create a new Double or Float on both ends will hinder this.
    I am worried that having to create new objs every time it is sending a byte array will affect my application.
    That's the wrong way to approach this. You're talking about adding complexity to your code and fuglifying it because you think it might improve performance. But you don't know if it will, or by how much, or even if it needs to be improved.
    Personally, I'd guess that the I/O will have a much bigger affect on performance than object creation (which, contrary to popular belief, is generally quite fast now: http://www-128.ibm.com/developerworks/java/library/j-jtp01274.html)
    If you think object creation is going to be a problem, then before you go and cock up your real code to work around it, create some tests that measure how fast it is one way vs. the other. Then only use the cock-up if the normal, easier to write and maintain way is too slow AND the cock-up is significantly faster.

  • Simple java/mysql database application question about triggers

    I am planning a new database application using java and mysql. I may want to use some triggers to automatically update the tables when a change is made. my question is this: If I write the trigger, and I use Java to modify the database, will java automatically pause and let the trigger finish doing its task before it continues? what if it writes more to the table before the trigger is finished modifying the table? how do I get java to pause and let the trigger finish?
    thanks for your response

    lduren wrote:
    I am planning a new database application using java and mysql. I may want to use some triggers to automatically update the tables when a change is made. my question is this: If I write the trigger, and I use Java to modify the database, will java automatically pause and let the trigger finish doing its task before it continues? what if it writes more to the table before the trigger is finished modifying the table? how do I get java to pause and let the trigger finish?
    It doesn't have anything to do with java at that point.
    When you execute, for example, an insert statement, then the database executes that statement. The database (not java, not the driver) decides with that statement is complete. Control returns to java when the database decides that execution is complete.
    And except for tricks that one might do (or attempt to do) via SQL or triggers then when the statement execution finishes then everthing has completed running.

  • Array questions

    Hi, everyone.
    I'm writing a lab program which counts the number of occurances of English letters in a line of English text.
    The program has the following requirements
    Assume that we input only lowercase English text
    The program should be able to count the number of occurances of English letters in a text and print out both the number of occurances and the letters. Don't print out letters that don't exist in the text.
    I write my code as following:
    import java.util.*;
    public class Translator
    public static void main(String[]args)
         Scanner sc = new Scanner(System.in);
         System.out.println("Please enter text:");
         String text = sc.nextLine();
         char[] input = text.toCharArray();
        public static void countLetters(char [] input)
            System.out.println("Letter           Number of occurances");
            int[] alphabet = new int[26];
            for (int i=0; i<input.length; i++)
                if (input=='a')
    alphabet[0] += 1;
    else if(input[i]=='b')
    alphabet[1] += 1;
    else if (input[i]=='c')
    alphabet[2] += 1;
    else if (input[i]=='d')
    alphabet[3] += 1;
    else if (input[i]=='e')
    alphabet[4] += 1;
    else if (input[i]=='f')
    alphabet[5] += 1;
    else if (input[i]=='g')
    alphabet[6] += 1;
    else if (input[i]=='h')
    alphabet[7] += 1;
    else if (input[i]=='i')
    alphabet[8] += 1;
    else if (input[i]=='j')
    alphabet[9] += 1;
    else if (input[i]=='k')
    alphabet[10] += 1;
    else if (input[i]=='l')
    alphabet[11] += 1;
    else if (input[i]=='m')
    alphabet[12] += 1;
    else if (input[i]=='n')
    alphabet[13] += 1;
    else if (input[i]=='o')
    alphabet[14] += 1;
    else if (input[i]=='p')
    alphabet[15] += 1;
    else if (input[i]=='q')
    alphabet[16] += 1;
    else if (input[i]=='r')
    alphabet[17] += 1;
    else if (input[i]=='s')
    alphabet[18] += 1;
    else if (input[i]=='t')
    alphabet[19] += 1;
    else if (input[i]=='u')
    alphabet[20] += 1;
    else if (input[i]=='v')
    alphabet[21] += 1;
    else if (input[i]=='w')
    alphabet[22] += 1;
    else if (input[i]=='x')
    alphabet[23] += 1;
    else if (input[i]=='y')
    alphabet[24] += 1;
    else alphabet[25] +=1;
    System.out.println("a");
    for(int i=0; i<input.length; i++)
    if (alphabet[i] > 0)
    System.out.println(input[i] +" "+alphabet[i]);
    Though having gotten no syntext error complain from the compiler, no matter what I input, the program returns nothing. At first I assumed that it's the first for loop's problem, so that I typed in some System.out.println() methods at the end of some elseif statements. But I still got nothing after this trial. So that I guess it's the char[] input = text.toCharArray();'s problem.
    Have the input[i] elements really stored any character (I tried to convert the input string into char array) after I typed char[] input = text.toCharArray();'s problem. ?
    My another question is: since the input[i] stores character, when I am trying to print out the letters that exist in the text through the last System.out.println() method in my code, I can use input[i] to represent the letter which I want to print. Is it right?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    I figure out now that the problem is caused by the last for loop. I modify it as following:
    for(i=0; i<26; i++)
                if (alphabet[i] > 0)
                System.out.println('a'+i +"          "+alphabet);
    }After the modification, now I can get the right answer. The only problem I have now is trying to convert the interger number produced by 'a'+i back into character. I tried to replace 'a'+i with toChar('a'+i), but it doesn't work. Can you give me some explanation? Thank you very much!                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Photo Array Question

    I have a bit of a silly question about the photo array Apple uses in many of their publications, including the idea behind "CoverFlow". Check this link to see what I mean: http://arstechnica.com/reviews/os/mac-os-x-10-5.ars/2. (Bottom photo)
    Is there a way to achieve this? What software accomplishes this? I am a webmaster using iWeb.
    I have something similar on the page I have created, but the difference is my photos are straight as they descend, whereas Apple's are straight, yet not square, they seem to be turned, like in this top image of Ubuntu: http://www.taimila.com/?q=node/3. The photos are not rotated, but turned.
    Any software ideas?
    Any ideas at all?

    Resizing is a different issue altogether from format.
    It's safe to scale the image in ID regardless of the format. If you look in the info panel with the image selected you'll see two resolution numbers listed, actual and effective. Actual is just the resolution at the dimensions the image was saved and is essentially irrelevant. Effective resolution is what you have at the dimensions you are currently using, and that's the number that counts. If that number is in the range that is acceptable for the type of output you are using, there is no need to resize the image in Photoshop at all.
    If you MUST resize the image, then yes, convert to something besides jpeg if that's what it is to start. And keep in mind that up-sampling won't improve image quality in general, and downsampling more than 20% or so can cause you to lose fine details (but so will scaling down).
    Peter

  • Create View from Database Links - Question

    Question
    I'm missing something simple.
    I'm trying to create a view, from a Database Link.
    CREATE VIEW view_name
    AS SELECT a.*
    FROM schema.tablename@dblink a;
    When I run this in the SQL Commands window.
    I get this error message.
    ORA-00933: SQL command not properly ended
    What am I missing? Any help is appreciated...

    <i>CREATE VIEW vw_name
    AS SELECT a.*
    FROM [email protected] a;
    </i>
    <br>
    1) User (schema) which is creating view must have proper db_link to source database. For that try this for testing purpose:
    select 1 from [email protected]<br>
    If this fail then db_link is not ok! This step is absolute must to go any further step to!!!
    <br>
    2) when db_link is set, then your view should be named as:
    CREATE VIEW vw_name
    AS SELECT *
    FROM <b>schema_name</b>.[email protected];<br>
    please pay attention to "schema_name", because from remote side every table is in some schema so it really need declaration of owner schema.
    <br>
    Hope this helps...

  • I have some database related questions

    hey all
    i am currently designing a java GUI program for a dvd renting shop.
    this program obviously needs a databse, i was just wondering how much possibly a database on a home pc could hold data because this shop have about 15000 DVD title and about 1500 client so i was wondering how much a mySQL databse table could hold....
    i also have another question...this shop have an access database...my question is can i use the existing database and querie it from my java program??? do i need a driver ??? can i querie an acces databse just like a regular SQL databse(e.g. SELECT * FROM TABLENAME) ????

    hey all
    i am currently designing a java GUI program for a dvd
    renting shop.Why not simply download JBoss Seam's DVD store example. It's fully coded for you already!
    this program obviously needs a databse, i was just
    wondering how much possibly a database on a home pc
    could hold data because this shop have about 15000
    DVD title and about 1500 client so i was wondering
    how much a mySQL databse table could hold....
    You will not have issues even with Access with that few a number of rows. Disk is really the only limitation on the size of the database. (There can be O/S or database specific limitations, such as 2GB of total size). So, do not worry about how many records.
    When you truly get a large number of records (tens of millions plus) or you are joining two large tables, then you can have performance issues. Good use of primary keys, indexes and database design can limit this issue.
    i also have another question...this shop have an
    access database...my question is can i use the
    existing database and querie it from my java
    program??? do i need a driver ??? can i querie an
    acces databse just like a regular SQL databse(e.g.
    SELECT * FROM TABLENAME) ????You can use Access, mySQL, Postgres or any number of other databases. Each will require (and will have on their site) a JDBC driver that you need to have on your application's CLASSPATH. My recommendation would be mySQL or Postgres. Both are free and excellent quality.
    As an aside, you should rarely SELECT * from any table (other than a code or lookup table). Use a WHERE clause to limit results. What user would possibly want to scroll through ALL 15,000 records? :^)
    - Saish

  • MySQL Database Structure Question

    This is probably going to seem a little odd, but I need some outside opinions.  I'm using Dreamweaver CS5 to build a business website.  When all is said and done, it's going to have around 20,000 items (not anytime soon, but it'll get there).  I'm using a dynamic data set up to load the inventory because I'm way too lazy to build that many pages and links one at a time.
    The corporate chain has two sections, lighting, and electrical supply.  I want the database to hold the product ID(of course), name, description, image(this is part of where the question comes in), price, sale price(discounts not our cost), an enum field for whether or not the item is discontinued(for our own records), size / weight for shipping reasons, and if reality is permitting, a field for color selection of the products.
    My original idea was to have two tables, one for lighting, one for electrical.  Somebody pointed out to me that this could fail because they pointed out that some of the items might have multiple images, which is true.  Some of the items (like some of the fans we sell) have different colors but still cost the same.  They suggested I set the images up in a seperate table and use a foreign key. but that changes my entire structure.
    Does anyone mind offering ideas on how I might set that up to avoid data redundancy and other problems that might pop up due to repeat listings?  I've got the images all with unique names (in the case of the same product in different colors, I added a color code like pb for polished brass, etc.)  That person had an excellent point on multiple tables, so now I'm wondering about a better and more reliable structure.

    I'm ok with PHP, and usually pretty good with databases.  Right now I've got enough sample stuff to build a smaller scale prototype with about 200 products, from both lighting and electric.  Believe me, I haven't really done much more than start with the layout, because the many to many relationships just didn't occur to me.  Pretty much going solo on this project with occasional advice from one co-worker who's good at his job but extremely busy, so I think I just got a little to close to it and overlooked some clear and obvious problems.  As far as requirements, I'm using a 3 column div tag layout, the left column being the nav bar with the product categories.  When they click one of those, it should display that category (image, name, price) with the clickable name and thumbnail image in the middle, and from there they click the product they want to see and it'll display the full size image and full description on the right column.
    Set requirements...wish I had a clear list, but the bosses are pretty much illiterate in this area of computers, so I'm on my own with that.  That's all I'm hoping to get out of the database is that three column layout.  I figure I'll make a changeable nav bar later so customers can switch from one store to the other and the nav bar goes from there.
    We're hoping to get the database to have the fields I mentioned for now (at least for initial testing) and maybe add an inventory tracking function so we know how many we have throughout the chain.  We're not worried about that part now, just getting them up and selling cuz our current inventory system works just fine.  How would 10 or more tables be better?  Just breaking down the amount of products to be searched at a time, or is that how detailed you think it should be built?  Don't worry, I wasn't hanging everything on a two table set up, I knew there would be room for much improvement.
    Current basic layout:
    Lighting / Electric Tables          Image table:  ID (either the product ID without the color code or maybe the document path), category(lighting / electric),                                                                   subcategory (fan, lamp, etc)
    id
    class
    category
    description
    price
    sale price
    discontinued
    size
    weight
    That's what I've got so far, sorry for the weird way that list pasted....

  • Database Vault Question on a Test Server

    I have a question about database vault. Say I have Database Vault protecting the DBA from viewing table XYZ in producion. If the DBA takes a backup of the production database and clones it onto another test server is table XYZ still protected on that test server? Or because Database Vault is not running against this test server does that mean that the table is wide open now for the DBA to see? Thanks for any help on this.
    Edited by: jeff81 on Nov 18, 2010 12:25 PM

    findhorn wrote:
    > I wondered if the mysql_query function needed a
    reference to
    > the database?
    No, mysql_query() just needs the query. Your problem lies
    with quotes in
    the query itself. A couple of the values are not in quotes.
    There should
    also not be a comma before WHERE.
    $query_updateAvailability = "UPDATE tbl_availability
    SET
    satStatus='".mysql_real_escape_string($_POST['satStatus'])."',
    sunStatus='".mysql_real_escape_string($_POST['sunStatus'])."'
    WHERE
    availabilityId='".mysql_real_escape_string($_POST['availabilityId'])."'";
    David Powers, Adobe Community Expert
    Author, "The Essential Guide to Dreamweaver CS3" (friends of
    ED)
    Author, "PHP Solutions" (friends of ED)
    http://foundationphp.com/

  • FLV Array question - final flv file looping

    So the first part of my question was kindly and quickly
    answered by Rothrock. But I've got a new question that has arisen.
    When I set these up as an array it's ignoring the settings in the
    parameter field for autorewind which is set to false and it's
    looping the last movie file in the array. Is there anyway to avoid
    this by adding a snippet of new code to this code below:
    import mx.controls.MediaDisplay;
    flvURL = new Array();
    flvURL[1] = "preroll_live.flv";
    flvURL[2] = "atlas.flv";
    flvURL[3] = "jones_outro.flv";
    counter = 1;
    my_FLVplybk.contentPath = flvURL[1];
    var listenerObject:Object = new Object();
    listenerObject.complete = function(eventObject:Object):Void {
    counter++;
    if (counter == flvURL) {
    counter = 1;
    my_FLVplybk.contentPath = flvURL[counter];
    my_FLVplybk.addEventListener("complete", listenerObject);
    Preferably I'd like to either:
    Have the movie reset to an array file of my choice but not
    auto play or just Stop the movie on the final frame.
    Any help here will be greatly appreciated.
    Many thanks!
    -Kjup

    Anyone have any ideas on this...let me know if you need more
    details.
    Thanks,
    Kjup

Maybe you are looking for

  • Retrieve recording from fios

    I guess this topic was discussed before and it was all over the internet. here is the issue.  I just got new plan and sign up with fios tv with dvr.  I am new to this and actually first use dvr.  I recorded some shows on tv and want to take it out pu

  • How Can I Make A Large Photo with Product Detail for My Thumbnails in Dreamweaver

    Hello All: New to Dreamweaver, so my code knowledge does not exist yet. Have Mercy!!!! Anyway , I am making a typical product page. I prefer that when people click the thumbnail product photo to not have to click into another brower. Nowadays you are

  • ODS ACTIVATION ERROR IN BI 7.0

    Hi, Iam Facing the problem in activation of ODS.... When i loaded the data in ODS manually..The data was succesful and activation also ran well... But when see the same in the processs chain ....Activation of ods is in red... I repeated it...but stil

  • Removal of batch management indicator from material master

    I had removed all batch stock from material code but when trying to remove batch management indicator from material master system is giving the message "batches already exist" Please suggest the solution.

  • Query in Context Node

    Hi all,            Can anyone please tell me as to when we go for creating a New Context Node. Regards, Vijay