Stupid question: whats wrong here? -- Syntax Error in FROM clause

i keep getting the error: Syntax Error in FROM clause.
here is the code:
<%@ page import="java.sql.*" %>
<HTML>
<HEAD>
     <TITLE>User Application Area</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000">
<%
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con = DriverManager.getConnection("jdbc:odbc:fypproject","","");
Statement st = con.createStatement();
String email = (String)session.getAttribute("email");
String levelStatus = (String)session.getAttribute("levelStatus");
String details = "SELECT PD.Forename, PD.Surname, L.Level_Name FROM PD Personal_Details AND LD Login_Details AND L Level WHERE PD.Email_Address = LD.Email_Address AND LD.Level_ID = L.Level_ID AND Level_ID = '" + levelStatus + "'";
ResultSet rsDet = st.executeQuery(details);
if(rsDet.next()) {
String forename = rsDet.getString("Forename");
String surname = rsDet.getString("Surname");
String level_name = rsDet.getString("Level_Name");
%>
<DIV ALIGN="center"><H1>User Application Arena</H1></DIV>
<BR>
<H4>Welcome back <% out.println(forename + " " + surname); %> </H4>
<BR>
<%
out.println(level_name);
else {
out.println("NOT FOUND ANYTHING");
st.close();
con.close();
%>
</BODY>
</HTML>
the strange thing is when i write a query that doesn't involve the 'Level' table it works fine.
for example if i just want to display the forename and surname from 'Personal_Details' where the Email_Address = email it works fine...as soon as i involve the 'Level' table i get this error.
i basically have 'Level_ID' in the 'Login_Details' table which is found out in the preceding jsp and passed through to this page and i can print out the Level_ID
but....what i want to do is use this Level_ID and find the respective Level_Name in the Level table.
my Level table looks like this:
Level_ID Level_Name
0 Pending
1 Interview
2 Rejection
Thanks :o)

Perhaps this is your issue ...
The column Level_ID is in both the Login_Details and Level tables. Therefore, in your WHERE clause, you must specify a table alias for each reference to Level_ID
WHERE PD.Email_Address = LD.Email_Address AND LD.Level_ID = L.Level_ID AND Level_ID = '" + levelStatus + "'";
should be
WHERE PD.Email_Address = LD.Email_Address AND LD.Level_ID = L.Level_ID AND L.Level_ID = '" + levelStatus + "'"; //ADDED "L." before Level_ID
Level_ID would have been unique until you added the Level table.
Good luck.
-Mark

Similar Messages

  • Exception: DBD, [Microsoft][ODBC Excel Driver] Syntax error in FROM clause.

    Dear experts,
    I'm trying to create an universe linked to an Excel File.
    I've created the ODBc connection and the DNS Data Source and inserted the table (table name RAC$) in the Universe. however, when I try to map each table field in the universe's Objects I'm getting this error message:
    "Exception: DBD, [ODBC Excel Driver] Syntax error in FROM clause.State:37000".
    I've tried to rename the table, inserting square brackects and also add new parameters to the universe («Transactional Available = "Yes"» and «Delimited Identifier = "Yes"») but still no solution to my problem.
    Any advice, tip or trick?
    Thank you. My best regards.
    Inês Santos

    Hi Ines,
    Thanks for sharing how you resolved this! I will bookmark this so that I can find it when I will likely need it!
    Bill
    Sorry I don't know how to make the accent circumflex! Or is that what you call it? On top of the e?
    Edited by: wavery on Jun 11, 2010 12:07 AM
    Edited by: wavery on Jun 11, 2010 12:09 AM

  • Syntax error in From clause from Access

    I am trying to migrate a database from Access 2000, and all of the tables except one migrate correctly. The one problem table gives me the following error message:
    Unable to migrate table data: NWQ_TANC.PARAMETERS; [Microsoft][ODBC Microsoft Access Driver] Syntax error in FROM clause.
    Does anyone know how to fix this? I have found the error in the help Appendix, but it just lists it as a QUERY type error, #3131, and gives no explanation or clues on how to fix it.
    Thanks, Jessica

    Hi Jessica
    Just wondering if you ever managed to find a solution to this problem, as I am getting a very similar error - only I don't just get it for one table, I get it for every single table in the database!
    Would be very interested to hear if you managed to sort it or not
    Cheers
    Ed

  • Error in FROM clause

    hi,
    ok i have a piece of code which looks like
    ResultSet rs = stmt.executeQuery("SELECT OrderDate, ProdNumber, Quantity, Price, OrderNumber FROM Order WHERE EmailAddress='" + email + "'");
    when i execute it... i get following error
    java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Syntax error in FROM clause.
    i don't think there is any problem with syntax...
    thanx in advance

    Hey the escape character in java is \ you need to use that to escape the property of " for eg you will write like this ResultSet rs = stmt.executeQuery("SELECT OrderDate, ProdNumber, Quantity, Price, OrderNumber FROM Order WHERE EmailAddress= "\""+ email + "\"");
    try this and let me know if it works

  • DATAMOVER: Error: Syntax error in where clause for PSOPRDEFN

    SET LOG C:\PSUSER_HRM.log;
    SET input F:\psoprdefn.dat;
    IMPORT psoprdefn where OPRId = 'PS';
    when i execute this command after importing .dat file from my database i get error:
    Error: Syntax error in where clause for PSOPRDEFN
    any suggestions pls help....
    Thanks
    aravind
    Edited by: 967641 on Nov 20, 2012 11:39 AM
    Edited by: 967641 on Nov 20, 2012 11:40 AM

    That is correct.
    Datamover tries to insert data in PSOPRDEFN and rows exist with these keys.
    To avoid this you can add the following statement in your script:
    SET UPDATE_DUPS;
    This will update the values other than the keys if a row already exists in the database with the keys in the dat file.
    I can advice you to buy the new book of Jim Marion, PeopleSoft PeopleTools Data Management and Upgrade Handbook
    http://www.amazon.com/PeopleSoft-PeopleTools-Management-Upgrade-Handbook/dp/0071787925/ref=sr_1_1?ie=UTF8&qid=1353575734&sr=8-1&keywords=jim+j+marion
    It has an entire chapter on how to use datamover.
    Hakan

  • What is this syntax error?

    The standard SAP program SAPDBZDF giving error in ECC6.0 version in line 211:Field "%_GET" is unknown. It is neither in one of the specified tables nor defined by a "DATA" statement . . .
    The line declared is 
    IF B0SG-XASGL <> 'X' AND %_GET+10(1) <> ' '.
    What is the %_GET? how to eliminate the error?
    This code doesn't give syntax error in 4.0B version.
    If it is standard SAP report, please help me.

    Hi,
    this rather looks like some kind of inactive query, infostructure or other generated stuff.
    As already mentioned: Our system knows
    SAPDBDDF                                   Logical Database SAPDBDDF
    SAPDBIDF                                   Real Estate Logical Database
    SAPDBKDF                                   Logical Database SAPDBKDF
    SAPDBMDF                                   FM Master Data Mass Selection
    SAPDBSDF                                   SAPDBSDF Logical Database
    SAPDBVDF
    If you copied one of the standard logical databases to customer name space SAPDBZDF: I did this and I found OSS notes guiding through additional necessary process.
    Regards,
    Clemens

  • Stupid question  - What platforms does Solaris x86 run on?

    Hello,
    I am a longtime Solaris for sparc user. Could someone please direct me to information about what platforms/processors Solaris for x86 runs on? Are there dual-bootable Windows/Solaris systems or something? What about laptops? I will start searching myself for info, but if anyone knows of a great strehouse of info on this matter, I would appreciate it.
    Thanks!

    solaris: get it free
    http://www.sun.com/software/solaris/get.jsp
    What platforms does Solaris x86 run on? not such a stupid question if one is to inquire, does it run on intel conroe chips, yonah? are both chips recognized, does it run at 64 bit on conroe? has anyone got it going on mac? how about the 4 proc intel chips released. any one tried this and last but not least xen virtualistion with new built in amd/intel virtualization technology...

  • Beginner: Getting syntax error on WHERE clause in SELECT

    I'm very new to php and mySQL.  Am using DW master/detail to generate to basic code I need.  One thing I need to do is modify a select statement in the master to include a WHERE clause to limit the selection to a particular value in one field.
    I'm getting a syntax error with the WHERE clause I'm adding to the map select statement.
    This is the portion of the error message showing the error location:
    'WHERE Group='Community' LIMIT 0, 10'
    The php that generated the select is:
    $query_maps = "SELECT * FROM tblmaps ORDER BY tblmaps.DispSeq";
    $query_limit_maps = sprintf("%s WHERE Group='%s' LIMIT %d, %d", $query_maps, $selectGroup, $startRow_maps, $maxRows_maps);
    This approach to creating the select statement is from the code generated for the master page.  It adds the LIMIT clause.  All I did was add the "WHERE Group='%s' and the $selectGroup variable which comes from earlier code.  You can see that the $selectGroup variable is equal to the "Community: group.
    I've scanned the web to see what syntax error I might be making but haven't found anything that explains it.
    The full resolved select statement is:
    SELECT * FROM tblmaps ORDER BY tblmaps.DispSeq WHERE Group='Community' LIMIT 0,10
    What am I not seeing?
    Tom

    Thanks.  Make sense but changing that didn't help.
    Here's the error message I'm getting:
    You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Group='Community' ORDER BY tblmaps.DispSeq LIMIT 0, 10' at line 1
    The full select (from a debugging ECHO I inserted) is:
    SELECT * FROM tblmaps WHERE Group='Community' ORDER BY tblmaps.DispSeq LIMIT 0, 10
    Note that when I take the WHERE clause out, there is no syntax error.

  • Error in FROM clause (MS Access)

    I'm getting an 'error executing a database query.' The query
    is a simple
    <cfquery name="myquery" datasource="#application.dsn#">
    SELECT *
    FROM #url.table#
    </cfquery>
    The debugging info i get is as follows:
    SELECT * FROM Order
    VENDORERRORCODE -3506
    SQLSTATE 42000
    It also states the error is in the FROM clause and only
    happens when url.table is Order, not the other table names. I know
    the order table exists because i get a nonexistent table name error
    when url table is a bogus table name. This implies that
    it knows the order table exists but says there's an error in
    the FROM clause. The query is successful on all the other tables in
    my db (MS access, i'm using the access driver without unicode). Any
    ideas?

    order is a reserved word...you'll need to escape it using
    brackets
    FROM [order]
    HTH
    Tim Carley
    www.recfusion.com
    [email protected]

  • Syntax within the from Clause

    In the following SQL SELECT statement, what does the
    px-granule(0, block_range, dynamic) in the FROM clause reference.
    This select statement was copied from the sql analyze tool within
    OEM 2.2.
    SELECT /*+ Q524000 NO_EXPAND ROWID(A1) */ A1."PROCESSING_DATE"
    C0,
    A1."PRCSNG_SEQUENCE_NR_IDENTIFIER" C1,
    A1."TUI_ID" C2,NVL(A1."RECORD_TYPE_CODE",' ') C3,
    NVL(A1."CONDITION_CODE",' ') C4,
    NVL(A1."PURPOSE_CODE",' ') C5,
    NVL(A1."DOCUMENT_IDENTIFIER",' ') C6,
    NVL(A1."NIIN_IDENTIFIER",' ') C7,
    NVL(RTRIM(A1."DOCUMENT_NUMBER_IDENTIFIER"),' ') C8,
    NVL(A1."SUFFIX_CODE",' ') C9,
    NVL(A1."UNIT_OF_ISSUE_CODE",' ') C10,
    NVL(A1."PLUS_MINUS_CODE",' ') C11,
    NVL(A1."TRANSACTION_QUANTITY_CHAR_TEXT",' ') C12,
    NVL(A1."TRANSACTION_REVERSAL_CODE",' ') C13,
    NVL(A1."ON_HAND_QUANTITY_CHAR_TEXT",' ') C14,
    NVL(A1."SITE_CODE",' ') C15,
    A1."RECORD_TYPE_CODE" C16,
    NVL(TO_CHAR(TRUNC(A1."REPAIR_SEQUENCE_NR_IDENTIFIER")),' ') C17,
    NVL(A1."COGNIZANCE_SYMBOL",' ') C18,
    NVL(A1."FSC_CODE",' ') C19
    FROM "OPS$DWTLOD"."TLOD_UNION_ITEMS" PX_GRANULE(0, BLOCK_RANGE,
    DYNAMIC) A1
    WHERE A1."REGION_IDENTIFIER_CODE"=5 AND
    A1."PROCESSING_DATE"<=:B1 AND
    NVL(A1."NIIN_IDENTIFIER",' ') LIKE '000457162' AND
    NVL(RTRIM(A1."DOCUMENT_NUMBER_IDENTIFIER"),' ') LIKE '%'
    AND A1."PROCESSING_DATE">=:B2 AND A1."PROCESSING_DATE"<=:B3 AND
    NVL(A1."NIIN_IDENTIFIER",' ') LIKE '000457162' AND
    NVL(RTRIM(A1."DOCUMENT_NUMBER_IDENTIFIER"),' ') LIKE '%'
    Thanks,
    Gil

    DECLARE
           highestlid locations.location_id%TYPE;
    BEGIN
           SELECT
                max(location_id)
           INTO
                highestlid
           FROM
                locations;
           highestlid:=highestlid+1;
           ADDLOCATION(highestlid,'Lucan');
    END;
    /

  • Probably a stupid question - what does '256' mean in response to a command

    Hi,
    I.m just learning PHP (I mean at the very beginning). The tutorial I'm following was running through how to start and stop the apache server via terminal.
    When I entered the commands, I received the following error"
    /usr/sbin/apachectl: line 82: ulimit: open files: cannot modify limit: Invalid argument
    So I poked around and found out that I needed to modify the apachectl script to remove "ulimit -S -n `ulimit -H -n`" from the line ULIMITMAXFILES="ulimit -S -n `ulimit -H -n`"
    So created a backup, opened nano and modifed the script. So far so good. So I went to try the command again and....
    sudo apachectl graceful
    256
    Can someone please enlighten this poor beginner as to what I've done?
    Many thanks

    Can someone please enlighten this poor beginner as to what I've done?
    Sure. You edited the file incorrectly (or, at least, pointlessly )
    modify the apachectl script to remove "ulimit -S -n `ulimit -H -n`" from the line ULIMITMAXFILES="ulimit -S -n `ulimit -H -n`"
    Well, sorta, kinda.
    To understand what is happening now it's useful to understand what the original command did.
    ULIMITMAXFILES="ulimit -S -n `ulimit -H -n`"
    This command has three components:
    ULIMITMAXFILES=
    "ulimit -S -n "
    and
    `ulimit -H -n`
    Note that the last component is surrounded by back ticks. This indicates that it's a subcommand that should be executed and the result of which inserted in its place.
    So in effect, this line tells the shell to first go away and run `limit -H -n`.
    This command determines the maximum limits available for a process and would normally return the string 'unlimited'.
    This has the effect of turning the full line into:
    ULIMITMAXFILES="ulimit -S -n unlimited"
    (since the subcommand has been executed and its result inserted in the command).
    So now the shell can run the command 'ulimit -S -n unlimited', the result of which is stuffed into ULIMITMAXFILES
    Your mistake is that you simply omitted the subcommand that determines the maximum process limit on this system so now the command looks like:
    ULIMITMAXFILES="ulimit -S -n"
    which simply determines the current process limit (which is normally 256).
    In other words, since you nixed the last parameter to the command you're now just asking it for the current limits (256) rather than setting a new limit value.
    That's why you get '256' - it's what you asked for.
    As for what to do about it? Well, nothing would be one option - it shouldn't prevent apache from running, you just get additional output when you run apachectl. If it bothers you, delete (or comment out) the entire line rather than just the subcommand. Unless I'm mistaken it's not going to make and significant difference to Apache's operation either way.

  • TS2634 i have a ipad gen1 refurbished the wall usb charger keeps saying charging is not supported with this accesory and has taken 24 hrs to charge half the battery and this is a factory charger that uses the usb port whats wrong here help please

    i just purchased a refurbished ipad gen 1 when i pluged in the wall charger with the usb cable a window came up and said (charging not supported with this accesory) the battry was almost dead so i pluged in the wall charger and
    the battery has been charging for 24 hrs and is only 50%charged it is the factory use charger for this unit why does this error come up and why is it taking so long the software is up to date

    Not normal. Take it to an Apple Store for evaluation.
    Make a Genius Bar Reservation
    http://www.apple.com/retail/geniusbar/
    The quickest way (and really the only way) to charge your iPad is with the included 10W or 12W USB Power Adapter. iPad will also charge, although more slowly, when attached to a computer with a high-power USB port (many recent Mac computers) or with an iPhone Power Adapter (5W). When attached to a computer via a standard USB port (2.5W, most PCs or older Mac computers) iPad will charge very slowly (but iPad indicates not charging). Make sure your computer is on while charging iPad via USB. If iPad is connected to a computer that’s turned off or is in sleep or standby mode, the iPad battery will continue to drain.
    Apple recommends that once a month you let the iPad fully discharge & then recharge to 100%.
    How to Calibrate Your Mac, iPhone, or iPad Battery
    http://www.macblend.com/how-to-calibrate-your-mac-iphone-or-ipad-battery/
    At this link http://www.tomshardware.com/reviews/galaxy-tab-android-tablet,3014-11.html , tests show that the iPad 2 battery (25 watt-hours) will charge to 90% in 3 hours 1 minute. It will charge to 100% in 4 hours 2 minutes. The new iPad has a larger capacity battery (42 watt-hours), so using the 10W charger will obviously take longer. If you are using your iPad while charging, it will take even longer. It's best to turn your new iPad OFF and charge over night. Also look at The iPad's charging challenge explained http://www.macworld.com/article/1150356/ipadcharging.html
    Also, if you have a 3rd generation iPad, look at
    Apple: iPad Battery Nothing to Get Charged Up About
    http://allthingsd.com/20120327/apple-ipad-battery-nothing-to-get-charged-up-abou t/
    Apple Explains New iPad's Continued Charging Beyond 100% Battery Level
    http://www.macrumors.com/2012/03/27/apple-explains-new-ipads-continued-charging- beyond-100-battery-level/
    New iPad Takes Much Longer to Charge Than iPad 2
    http://www.iphonehacks.com/2012/03/new-ipad-takes-much-longer-to-charge-than-ipa d-2.html
    Apple Batteries - iPad http://www.apple.com/batteries/ipad.html
    Extend iPad Battery Life (Look at pjl123 comment)
    https://discussions.apple.com/thread/3921324?tstart=30
    New iPad Slow to Recharge, Barely Charges During Use
    http://www.pcworld.com/article/252326/new_ipad_slow_to_recharge_barely_charges_d uring_use.html
    Tips About Charging for New iPad 3
    http://goodscool-electronics.blogspot.com/2012/04/tips-about-charging-for-new-ip ad-3.html
    How to Save and Prolong the battery life of your new ipad
    https://discussions.apple.com/thread/4480944?tstart=0
    Prolong battery lifespan for iPad / iPad 2 / iPad 3: charging tips
    http://thehowto.wikidot.com/prolong-battery-lifespan-for-ipad
    iPhone, iPod, Using the iPad Charger
    http://support.apple.com/kb/HT4327
    Install and use Battery Doctor HD
    http://itunes.apple.com/tw/app/battery-doctor-hd/id459702901?mt=8
    To Extend a Device’s Battery Life, Get to Know It Better
    http://tinyurl.com/b67c7xz
    iPad Battery Replacement
    http://www.apple.com/batteries/replacements.html
    In rare instances when using the Camera Connection Kit, you may notice that iPad does not charge after using the Camera Connection Kit. Disconnecting and reconnecting the iPad from the charger will resolve this issue.
     Cheers, Tom

  • Stupid question--what do install DVDs look like?

    Hey, everything got mixed up in the Christmas rush, including the disks for my 2.0 dual-core. I know I have them, as I ran Hardware Test after purchasing some RAM.
    Can anyone tell me what they (and their packaging) look like? I can't find them anywhere. I do have the books (black folio). Just can't remember the DVDs.
    And is it normal that I can't run fsck on this Mac?
    D'oh! and thanks.
    PowerMac G5/2.0 dual-core, 4.5gb RAM   Mac OS X (10.4.3)  

    They are in a white paper sleeve with a plastic
    window in it. The DVDs are grey in color. fsck should
    work.
    OK, now I remember. The two-sided thingy. White paper sleeve... not gonna stand out. But at least I know what I'm looking for now.
    As for fsck, I get the prompt by the second restart (first one only gets partway through the text) but can't type. Or keys repeat and can't be stopped. Repeat is on Macally keyboard only, can't type is on both original and Macally. When I get ambitious, I'll pull the RAM and try again.
    My original problem was just Photoshop being picky about fonts, and I fixed that.
    Back to the DVD search. Thanks!

  • Probably a stupid question... here it go...

    How can I change my tc from English to Portuguese Brazil??

    Go to Preferences>Language & Text
    Pick your language, and also go under "input" sources and check mark the flag(s) of the language(s) you want. Then go to the upper right hand corner of the screen, right next to the date, click on the flag you see there and you'll be given the option to change it to the one(s) you checked off. Get the right flag flying there in the corner and your keyboard should offer you the symbols and such of that language.
    If you click on that flag you will also see the option of "Show Keyboard Viewer" which will display for you which letters and symbols you'll get from which keys while flying that flag.

  • Every time I open up Pages, it tells me I have an update, but when I open Software Update, it says everything is up to date. Whats wrong here?

    So when I open Pages, it says there's an update, and it asks me if I want to go to Software Update to check it out. So it opens, it loads, and tells me everything is up to date, no updates. Am I missing something? I have Pages '09 version 4.0.5 (852)

    There didnt seem to be one.
    No, it wasnt. It didnt say "installed" where the price for the app would usually be located.
    But I did manage to get it all fixed at an Apple Store. Turns out the disk had some issues installing it. We reinstalled it again and this time around was successful. Now whenever there's an update it should go through the app store no problem.
    Thank you!

Maybe you are looking for

  • Connecting Web and the entire OTC cycle (Part 2)

    I am a .Net programmer and at the same time SAP SD Consultant but just new  to this SAP field. I will be creating a website where the customer orders will be recorded. Based on my research in this forum, connecting a website and SAP will be possible

  • How to print a pdf

    Hello, First sorry for my poor english...and second i need help. I have a printer (HP deskjet F4172) and i wan't to print a pdf file, but I can't. When I select from the menu of that pdf the "print" option...I choose the "ok" button and appear someth

  • Photo slide show "shuffle" is not random

    I have over 10,000 photos on my ipod touch and they are in multiple folders.  When I view a slide show on shuffle of my "Photo Library" (which contains all of the photos), the order is DEFINITELY not random.  Approximately 90% or more of the photos s

  • E-mail doesn´t send...

    I have just configured my E51 for e-mail...(POP3) I tried writing an e-mail...no problem! I klick on "send"...the phone starts sending...and sending...and sending...and sending...etc... After about 5 minutes I aborted the operation. There must be som

  • All Day Events Showing as 24 Hour Events (Nokia N95)

    Hi, I'm syncing a Nokia N95 using the Nokia iSync plugin. My all day events are shown on the phone as 24 hour long events. Is there a way to stop this? Many thanks David