Newbie getting snytax error

I'm trying to create a table with a floating amount of columns, I create the table fine with 3 fixed columns but when I try to add more columns I get a syntax error. Since I'm new to this and learning as I go can anyone point out some errors I'm making.
Thanks
Jim
error message:
Syntax error or access violation: You have an error in your SQL syntax near 'select your GENDER:BLOB NOT NULL' at line 1
Closeing connection
Using MySql:
stmt = con.createStatement();
      stmt.executeUpdate( "CREATE TABLE TestDataBase1("  +
         "Respondent INTEGER      NOT NULL, "    +
         "Date       VARCHAR (10) NOT NULL, "    +
         "Time       VARCHAR (10) NOT NULL, "    +
         "PRIMARY KEY( Respondent )"                  +
     for( int i = 1; i <= questionText.length; i++ ){
          stmt.executeUpdate ("ALTER TABLE TestDataBase1 ADD COLUMN "+getColumnName(i)+" BLOB NOT NULL");
//.... snip
// return the question that will be the column header
public String getColumnName( int i ){
    return questionText;

Hey, Thanks for the reply.
I was pictureing it like this but I can't envision
your description
|--------|--------|-------|-------|--------------------
|Resp |Date |Time | Q1 |Q2 etc...
| 1 | blah |blah | yes |Male
| 2 | blah |blah | no |Female
| | | | |
||--------|--------|-------|-------|--------------------
|Resp |Date |Time | Q1 |Q2 etc...
| 1 | blah |blah | yes |Male
| 2 | blah |blah | no |Female
| | | | |
|
would become
Respondents table
|--------|--------|-------|-------|--------------------
|Resp |Date |Time | \\\
| 1 | blah |blah |
| 2 | blah |blah |
| | | |
answers table
|--------|--------|-------|-------|--------------------
|Resp | Question | answer
| 1 | 1 | Male
| 1 | 2 | no
| 2 | 1 | Male
| 2 | 2 | yes
This makes it much easier to query results, to get the response to the first 5 questions would be.
select * from answers where question between 1 and 5
under your design it would be UGLY.
This model is easily extended to multiple tests simply by adding a column for the test ID to the respondent table.

Similar Messages

  • C++ newbie gets linking error

    Hi,
    I am writing my first C++ programs (been a SQL/DB programmer for last 10 years) on Sun Solaris. Here is my source code:
    #include <list>
    #include <string>
    #include <iostream.h>
    using namespace std; // You must use this to include STL!
    int main()
    // Create list instances
    list<int> list1; // Empty list
    size_t n = 10;
    double val = 3.14;
    list<double> list2(n, val); // Create n copies of val
    list<double> list3(list2); // Create a copy of list2
    cout << "Size of list1 " << list1.size() << endl;
    cout << "Size of list2 " << list2.size() << endl;
    cout << "Size of list3 " << list3.size() << endl;
    // We iterate over the elements of list 3 and print its elements
    // Create list iterator
    list<double>::const_iterator i;
    // Print every character in the list
    for (i = list2.begin(); i != list2.end(); ++i)
    cout << *i << ",";
    and getting the following linker error:
    /SUNWspro/9.0/exec/SUNWspro/bin/CC -o test test.cpp
    Undefined first referenced
    symbol in file
    std::bad_alloc::bad_alloc() test.o
    void*operator new(unsigned,void*) test.o
    ld: fatal: Symbol referencing errors. No output written to test
    I have heard of Solaris C++ compilers having problem with the use of templates..... is this the problem here or am I just missing some arguments/libraries?
    Thx in advance!

    In the interest of keeping code examples short and simple, textbook authors do things in their code examples that are not suitable for real-world applications. Apart from "using namespace std", you find global variables and functions with short names, and no attention paid to error detection or recovery. (They also use more explanatory comments in the code than a real-world program should have.)
    That's OK when you are illustrating particular language points. You want to highlight the point, and not have a lot of distractions. But in my view, not enough authors go on to explain good programming practice, and show realistic examples.
    For the case in point, the Standard Library declares thousands of names. They are in namespace std to help avoid collisions with user-defined names. Once you put "using namespace std" into your code, you import all of those names into the global namespace, creating opportunities not only for compiler complaints due to name collisions, but for subtle errors involving binding symbols to the standard library that you expected to refer to your own definitions.
    I never write "using namespace std" in real code. I sometimes use it when creating tiny test cases for bug reports. But as you saw in my earlier comments, the difference in the sample program between a dangerous programming practice and a much better programming practice was one line of code!

  • [Newbie Question] Getting *** ODBC Error = 08004, TimesTen Error = 818

    While just playing around with Times ten and I am getting following error while starting data source
    bash-3.2$ ./ttadmin -cachestart cachealone1
    *** [TimesTen][TimesTen 11.2.1.3.0 ODBC Driver]Sum of permanent and temporary partition sizes (2320 MB) exceeds maximum size (2047 MB) allowed on this platform
    *** ODBC Error = 08004, TimesTen Error = 818
    From where does Timesten hit this limit of 2047 MB ? Can i increase the maximum sizes by doing some configuration changes(My machine as around 6 gb memory[Oracle DB is also installed on the same node]). I am trying to check the various operations using bigger tables (around 2gb DB size).
    Following are the configurations:
    [root@stin77 ~]# /sbin/sysctl -p
    net.ipv4.ip_forward = 0
    net.ipv4.conf.default.rp_filter = 1
    net.ipv4.conf.default.accept_source_route = 0
    kernel.sysrq = 0
    kernel.core_uses_pid = 1
    net.ipv4.tcp_syncookies = 1
    kernel.msgmnb = 65536
    kernel.msgmax = 65536
    kernel.shmmax = 4294967295
    kernel.shmall = 268435456
    fs.file-max = 6553600
    net.ipv4.conf.default.rp_filter = 1
    net.ipv4.conf.default.accept_source_route = 0
    kernel.sysrq = 0
    kernel.core_uses_pid = 1
    kernel.shmmni = 4096
    kernel.sem = 250 32000 100 128
    net.ipv4.ip_local_port_range = 1024 65000
    net.core.rmem_default = 262144
    net.core.wmem_default = 262144
    net.core.rmem_max = 262144
    net.core.wmem_max = 262144
    bash-3.2$ uname -a
    Linux stin77 2.6.18-92.el5PAE #1 SMP Tue Apr 29 13:31:02 EDT 2008 i686 i686 i386 GNU/Linux
    [cachealone1]
    Driver=/localhome/oracle/Timesten/TimesTen/tt1121/lib/libtten.so
    DataStore=/localhome/oracle/Timesten/TimesTen/tt1121/info/DemoDataStore/cachealone1
    TempSize=320
    PermSize=2000
    PLSQL=1
    DatabaseCharacterSet=WE8MSWIN1252
    OracleNetServiceName=orcl
    Kernel Parameters:
    [root@stin77 ~]# /sbin/sysctl -p
    net.ipv4.ip_forward = 0
    net.ipv4.conf.default.rp_filter = 1
    net.ipv4.conf.default.accept_source_route = 0
    kernel.sysrq = 0
    kernel.core_uses_pid = 1
    net.ipv4.tcp_syncookies = 1
    kernel.msgmnb = 65536
    kernel.msgmax = 65536
    kernel.shmmax = 4294967295
    kernel.shmall = 268435456
    fs.file-max = 6553600
    net.ipv4.conf.default.rp_filter = 1
    net.ipv4.conf.default.accept_source_route = 0
    kernel.sysrq = 0
    kernel.core_uses_pid = 1
    kernel.shmmni = 4096
    kernel.sem = 250 32000 100 128
    net.ipv4.ip_local_port_range = 1024 65000
    net.core.rmem_default = 262144
    net.core.wmem_default = 262144
    net.core.rmem_max = 262144
    net.core.wmem_max = 262144

    You are running 32-bit TimesTen on a 32-bit O/S. Regardless of how much memory the machine has, there are limits on how much can be used by an individual process and further limits due to filesize etc. 32-bit TimesTen is limited to a maximum datastore size of 2 GB.
    To create a datastore with an overall size larger than 2 GB you need a 64-bit machine running a 64-bit O/S and 64-bit TimesTen. Then the only limitation is how much physical memory you have in the machine...
    Chris

  • Why do I get an error message that says "Incompatible Types"?

    I am a newbie to Java programming. I have experience with VB.
    I am using Net Beans 6.1. I was following a sample program that shows me how to use the JDBC ODBC bridge to connect to an MS-Access file.
    I get an error message at this line:
    statement = connection.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
    statement was declared earlier with:
    private Connection connection;
    private Statement statement;
    private ResultSet resultSet;
    Here are my imports:
    import accessingmsdb.Page1;
    import java.beans.Statement;
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.util.logging.Level;
    import java.util.logging.Logger;
    import javax.swing.text.html.Option;
    import java.lang.String;
    I am also getting erros on the following 2 lines (these follow the first statement above):
    statement.execute(query);
    resultSet = statement.getResultSet();
    The site that has the sample does not have a forum. Any assistance you can provide would be appreciated.
    Edited by: Matt_in_MI on Aug 20, 2008 1:36 PM
    Edited by: Matt_in_MI on Aug 20, 2008 1:39 PM

    statement = connection.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);Probably because that driver doesn't allow you to use the mix of the two parameters that you passed.

  • I dont understand why i get this error when trying to type "else"

    Hello Everybody,
    Im new to java and am writing a simple program which gets a input number between 0 and 100 and is to print A for (grade>=90), B for (90>grade>=80) and so on, when grades < 60 get F.
    i use a series of if/else, but when i get to the FINAL else it gets an error (red wavy line under the last else). this ruins the program bcoz now a grade 61 will output "D" AND "F".
    can anyone explaing why this error msg? and how can i fix it?
    this is the code:
    public class Assignment02Q04 {
         public static void main (String[] args){
              int grade = (Integer.parseInt(args[0]));
              if (grade >= 90){
                   System.out.println("A");}
                        else {if (grade >= 80){
                        System.out.println("B");}
                             else {if (grade >= 70){
                             System.out.println("C");}
                             else {if (grade >=60);{
                                  System.out.println("D");}
                             else System.out.print("F");
         }

    Please ignore the rude bits... this is a pro-forma post most often trotted out to suspected trolls... i.e. It's NOT directed at you personally.
    h1. The Ubiquitous Newbie Tips
    * DON'T SHOUT!!!
    * Homework dumps will be flamed mercilessly.
    * Have a quick scan through the [Forum FAQ's|http://wikis.sun.com/display/SunForums/Forums.sun.com+FAQ].
    h5. Ask a good question
    * Don't forget to actually ask a question. No, The subject line doesn't count.
    * Ask once
        - Don't Crosspost!
        - Two people answering one question independantly is a waste of there time.
    * Don't even talk to me until you've:
        (a) [googled it|http://www.google.com.au/] and
        (b) looked it up in [Sun's Java Tutorials|http://java.sun.com/docs/books/tutorial/] and
        (c) read the relevant section of the [API Docs|http://java.sun.com/javase/6/docs/api/index-files/index-1.html] and maybe even
        (d) referred to the JLS (for "advanced" questions).
    * [Good questions|http://www.catb.org/~esr/faqs/smart-questions.html#intro] get better Answers. It's a fact. Trust me on this one.
        - Lots of regulars on these forums simply don't read badly written questions. It's just too frustrating.
          - FFS spare us the SMS and L33t speak! Pull your pants up, and get a hair cut!
        - Often you discover your own mistake whilst forming a "Good question".
        - Many of the regulars on these forums will bend over backwards to help with a "Good question",
          especially to a nuggetty problem, because they're interested in the answer.
    * Improve your chances of getting laid tonight by writing an SSCCE
        - For you normal people, That's a: Short Self-Contained Compilable Example.
        - Short is sweet: No-one wants to wade through 5000 lines to find your syntax errors!
        - Often you discover your own mistake whilst writing an SSCCE.
        - Solving your own problem yields a sense of accomplishment ;-)
    h5. Formatting Matters
    * Post your code between a pair of &#123;code} tags
        - That is: &#123;code} ... your code goes here ... &#123;code}
        - This makes your code easier to read by preserving whitespace and highlighting java syntax.
        - Copy&paste your source code directly from your editor. The forum editor basically sucks.
        - The forums tabwidth is 8, as per [the java coding conventions|http://java.sun.com/docs/codeconv/].
          - Indents will go jagged if your tabwidth!=8 and you've mixed tabs and spaces.
          - Lines longer than 80 characters should be wrapped.
          - Proper indentation illustrates program logic.
    * Post your error messages between a pair of &#123;code} tags:
        - That is: &#123;code} ... errors here ... &#123;code}
        - To make it easier for us to find, Mark the erroneous line(s) in your source-code. For example:
            System.out.println("Your momma!); // <<<< ERROR 1
        - Note that error messages are rendered basically useless if the code has been
          modified AT ALL since the error message was produced.
        - Here's [How to read a stacktrace|http://www.0xcafefeed.com/2004/06/of-thread-dumps-and-stack-traces/].
    * The forum editor has a "Preview" pane. Use it.
        - If you're new around here you'll probably find the "Rich Text" view is easier to use.
        - WARNING: Swapping from "Plain Text" view to "Rich Text" scrambles the markup!
        - To see how a posted "special effect" is done, click reply then click the quote button.
    If you (the newbie) have covered these bases *you deserve, and can therefore expect, GOOD answers!*
    h1. The pledge!
    We the New To Java regulars do hereby pledge to refrain from flaming anybody, no matter how gumbyish the question, if the OP has demonstrably tried to cover these bases. The rest are fair game.
    Edited by: corlettk on 17/03/2009 23:25 ~~ Doh!

  • Newbie Topic - compiling errors and jvm.dll missing

    Okay, we're starting at square .1 here. I'm trying to compile the ClickMe.java in the tutorial for newbies like myself. I know how to compile from the command line, etc., but I get an 2 errors. Seems to be saying line 6, cannot resolve symbol and line 28.
    - - - - code below - - - - - -
    import java.applet.Applet;
    import java.awt.*;
    import java.awt.event.*;
    public class ClickMe extends Applet implements MouseListener {
    private Spot spot = null;
    private static final int RADIUS = 7;
    public void init() {
    addMouseListener(this);
    public void paint(Graphics g) {
    // draw a black border and a white background
    g.setColor(Color.white);
    g.fillRect(0, 0, getSize().width - 1, getSize().height - 1);
    g.setColor(Color.black);
    g.drawRect(0, 0, getSize().width - 1, getSize().height - 1);
    // draw the spot
    g.setColor(Color.red);
    if (spot != null) {
    g.fillOval(spot.x - RADIUS,
    spot.y - RADIUS,
    RADIUS * 2, RADIUS * 2);
    public void mousePressed(MouseEvent event) {
    if (spot == null) {
    spot = new Spot(RADIUS);
    spot.x = event.getX();
    spot.y = event.getY();
    repaint();
    public void mouseClicked(MouseEvent event) {}
    public void mouseReleased(MouseEvent event) {}
    public void mouseEntered(MouseEvent event) {}
    public void mouseExited(MouseEvent event) {}
    - - - - - - end ClickMe.java code - - - - -
    I thought maybe it was b/c the Spot was capitalized, but I changed that to l/c and that didn't help. This code is, of course, taken right off of this page:
    http://java.sun.com/docs/books/tutorial/java/concepts/practical.html
    The other thing that's happening, is that when I try to run the NetBeans IDE 3.6, I get an error "Cannot load jvm.dll." I know there are jvm.dll's on this machine, but maybe they're in the wrong directory. I haven't messed with anything, just d-loaded the whole j2se SDK 1.4.1 and i'm already snafu'd. But then, I'm a newbie, so go ahead make fun. But, if you can, offer advice.
    thx in advance!

    I seem to be compiling right, b/c I was able to compile the classic HelloWorld.java ok and I can compile the spot.java file ok. I see what looks to be a valid spot.class file after I compile. If you're really bored, I could describe exactly how I'm launching the cmd.exe and how I point successfully to the javac.exe, but, newbie that I am, can we just go on faith that I'm doing that step right? And I also tried re-compiling the Spot.java file first, trashing the original ClickMe.java file so that everything was sequential. I'm wondering if this has something to do with the IDE & that jvm.dll out of whack.....
    As for the Netbeans IDE, I'm going to see if I can reinstall that separately. The whole SDK maybe didn't unpack correctly, who knows.
    But thanks for responding......

  • I want to Sync my iPhone 4 to iTunes however I get an error message from iTunes each time I connect the phone to the PC saying that I should restore to factory settings. Frustrating because it's already annoying enough that I can't drag and drop mp3's!!!

    I have never been so frustrated before in my life with any phone. I find it obnoxious as it is that I cannot simply drag and drop files (especially MP3's) straight from my PC directly into my phone, which I have been used to doing up until now. Everyone who convinced me to get the iPhone has instructed me that my frustration can be fixed by downloading iTunes and syncing it all up via that program (which I have never used before). So, I downloaded the program successfully, however when I connect the iPhone 4 to the PC and iTunes is open, I get an error message that 'iTunes cannot read the content of the iPhone "iPhone" and that I should go to the Preferences tab of the iPhone and select 'restore' to restore this phone to factory settings. First of all, I don't understand why I need to do that. I have already downloaded apps and other important things in the 2 days that I have the phone. I am also scared that it will erase my contacts. This is such a headache. Music is very imporatant to me, but I am getting so frustrated that I don't have freedom over the phone which I thought was supposed to be one of the best out there. I would really appreciate help in this matter. I am sure the phone is great but I am on the verge of taking it back and getting something else.

    Hey joshuafromisr,
    If you resintall iTunes, it should fix the issue. The following document will go over how to remove iTunes fully and then reinstall. Depending on what version of Windows you're running you'll either follow the directions here:
    Removing and Reinstalling iTunes, QuickTime, and other software components for Windows XP
    http://support.apple.com/kb/HT1925
    or here:
    Removing and reinstalling iTunes, QuickTime, and other software components for Windows Vista or Windows 7
    http://support.apple.com/kb/HT1923
    Best,
    David

  • I cannot open Pages from the app or from a saved document on the desk top.  I get an error: "The application Pages cannot be opened  -1712"  Any suggestions?

    I cannot open Pages from the app or from a saved document on the desk top.  I get an error: "The application Pages cannot be opened  -1712"  Any suggestions?

    The following previous discussion has a solution that worked for a variety of people with the -1712 error on a variety of applications and may help: The application Safari can't be opened -1712

  • HELLO I AM GETTING THIS ERROR WHEN I OPEN ITUNES "ITUNES WAS UNABLE TO LOAD DATA CLASS INFORMATION FROM SYNC SERVICES ...."

    i was getting this error whenever i tried to sync my ipod touch to itunes.. i had 10.5 version of itunes so i waited till apple updates it .today apple udated itunes and still after udating to 10.6 version i am getting this error please i have tried many things like download mobile me i uninstalled itunes and the reinstalled it but nothing seems to work please i haven't sync my ipod from last month and i want to sync some songs in it please please help..........................i have also tried to reset sync history from edit/preferences but nothing is working what should i do should restore my ipod touch or create a new id and start all over from beginning??please help....thanks

    i tried searching more problems like this but everyone has given a link to a page which gives steps to solve this issue and i have already tried that before but nothing worked ...should i restore my ipod but i am worried that if i restore my ipod and if i cannot sync my ipod then i  wont be having anything on my ipod.....do u any specific solution that can solve this issue 100%??

  • I am trying to open my iTunes on a Windows XP laptop and get the error message 42404 "iTunes application could not be opened.  Please repair or reinstall QuickTime".  I did that and it did not help.  Any ideas?

    I am trying to open my iTunes on a Windows XP laptop and get the error message 42404 "iTunes application could not be opened.  Please repair or reinstall QuickTime".  I did that and it did not help.  Any ideas?

    Let's see if a more rigorous uninstall/reinstall procedure gets us past that, nancy. See the following troubleshooting document:
    Removing and Reinstalling iTunes, QuickTime, and other software components for Windows XP

  • Have Macbook Pro & 4th gen iPod Touch. Downloaded & installed iOS 4.3.2 yesterday. Upgrade went without a hitch, but now iTunes on My Macbook Pro will not open. I get an error that says "iTunes" Data too new to be used with this version of iTunes.

    Have a Macbook Pro and a 4th gen iPod Touch. Downloaded and install iOS 4.3.2 yesterday. Upgrade went without a hitch, but now iTunes on My Macbook Pro will not open. I get an error that says --The file "iTunes Library" cannot be read because it was created by a newer version of iTunes--. I am running iTunes 10.1.  I searched for Updates to my MacBook Pro (running 10.6.7), but comes back saying no updates available. WHAT IS GOING ON??

    Is your computer still authorized in the Store menu in iTunes?
    iTunes Store: About authorization and deauthorization
    When I changed to my new MacBookPro I had to authorize it although I used TimeMachine to transfer my settings and data.
    Did you try to deselect Wi-Fi syncing and enable it again after that?
    iTunes 10.5 and later: Troubleshooting iTunes Wi-Fi syncing
    Did you already transfer your purchases and manually started a backup?

  • I'm getting this error statement: XULRUNNER error: platform version 6.0.2 is not compatible with min etc max etc6.0.1 - what is this about and how can it be corrected?

    This is what I think may have happened. The other day, Thursday Sept 8th, I shut down my pc in the middle of a Firefox upgrade. Now when I try to access Firefox on my pc, I get this error message:
    XULRUNNER Error: Platform version '6.0.2 is not compatible with min Version >= 6.0.1 max Version < 6.0.1
    What is this about and how can I retsore access to Firefox on my pc?

    If you use ZoneAlarm Extreme Security then try to disable Virtualization.
    Do a clean reinstall and delete the Firefox program folder.
    * http://kb.mozillazine.org/Browser_will_not_start_up#XULRunner_error_after_an_update
    *[[/questions/869812]]
    *[[/questions/869951]]

  • Itunes get "Send Error Report" message

    Alright so when I try and open itunes I get a send error report message. I've tried updating it and that doesnt work and I've already tried reinstalling it. I thought quicktime was the error so I went to try and remove it from my computer. As it was loading to remove quicktime I got a "fatal error" message and quicktime could not be deleted.
    Help please?
    Message was edited by: Joshua Malin

    Itunes has encountered a problem and needs to close
    the first thing that i check for when people report getting that message when they try to launch their itunes is a broken QuickTime.
    try to open your QuickTime. does it launch properly, or do you get an error message?
    if you get an error message, the first thing we'll try is a careful standalone QT 7.1 reinstall.
    download and save a copy of the QT 7.1 standalone installer to your hard drive. (we'll run the install from there rather than online.) switch off antivirus and antispyware applications prior to the install.
    Quicktime 7.1 Standalone Installer
    if that install goes through okay, does your itunes launch properly again?
    (if you get an error message on the QT standalone reinstall, let us know what it says. include error message numbers if you're getting any.)

  • I recently upgraded to the newest Firefox and now when i click on my icon I get an error message and have to click on it b4 FF will open, what should i do?

    Hi,
    I recently downloaded the newer version of FF and now when i click to open it i am getting an error in the top left corner of my screen. i can't even read what the message says in entirety b/c it's wrapping over off the side of the screen. When I click the error message than FF will open. Also, when I'm trying to send emails from an online shopping cart thru my business and I'm getting an error that it won't send and that's never happened until this problem w/FF. Please tell me what i should to to get FF working normally again.

    Can you tell us what text is in the part that you can read ?
    Is it a message from Firefox or from the Mac Operating System ?
    Start Firefox in [[Safe Mode]] to check if one of the add-ons is causing the problem (switch to the DEFAULT theme: Tools > Add-ons > Appearance/Themes).
    * Don't make any changes on the Safe mode start window.
    See:
    * [[Troubleshooting extensions and themes]]

  • When I click on any of my movie or TV shows in Itunes I immediately get an error message that says Itunes has stopped working and closes the program. I can sync the movies and shows to my phone okay but I can't watch on Itunes. Can anyone help?

    When I click on any of my movie or TV shows in Itunes I immediately get an error message that says Itunes has stopped working and closes the program. I can sync the movies and shows to my phone okay but I can't watch on Itunes. Can anyone help?

    Let's try the following user tip with that one:
    iTunes for Windows 10.7.0.21: "iTunes has stopped working" error messages when playing videos, video podcasts, movies and TV shows

Maybe you are looking for