Convert this MS Access SQL to do it in Oracle?

I converted an MS Access database to make it into Oracle. Everything is going well until i came to this update SQL. How do I do this in Oracle?
UPDATE (((tblkapplan
INNER JOIN tblTotalStock ON tblkapplan.MATERIAL = tblTotalStock.MATERIAL)
LEFT JOIN tblSafetyStock ON tblkapplan.MATERIAL = tblSafetyStock.MATERIAL)
LEFT JOIN tblOrders ON tblkapplan.MATERIAL = tblOrders.Material
SET tblkapplan.QUANTITY =
(IIf(IIf(IsNull([tblSafetyStock]![QUANTITY]),'0',[tblSafetyStock]![QUANTITY])-(IIf([tblTotalStock]![TOTAL_STOCK]-
IIf([tblOrders]![Quantity]>0,([tblOrders]![Quantity]),'0')>0,[tblTotalStock]![TOTAL_STOCK]-
IIf([tblOrders]![Quantity]>0,([tblOrders]![Quantity]),'0'),'0'))>0,([tblkapplan]![QUANTITY]*12)+
IIf(IsNull([tblSafetyStock]![QUANTITY]),'0',[tblSafetyStock]![QUANTITY]-(IIf([tblTotalStock]![TOTAL_STOCK]-
IIf([tblOrders]![Quantity]>0,([tblOrders]![Quantity]),'0')>0,[tblTotalStock]![TOTAL_STOCK]-
IIf([tblOrders]![Quantity]>0,([tblOrders]![Quantity]),'0'),'0'))),([tblkapplan]![QUANTITY]*12)))/12I know this can be done like this:
IIf(IsNull([tblSafetyStock]![QUANTITY]),'0',[tblSafetyStock]![QUANTITY])
nvl(tblSafetyStock.QUANTITY,0)But how do I do with the rest?

Hi,
Maybe you could explain (To yourself) in words, what the update is supposed to do.
If you can't, then your question is basically what this means
(IIf(IIf(IsNull([tblSafetyStock]![QUANTITY]),'0',[tblSafetyStock]![QUANTITY])-(IIf([tblTotalStock]![TOTAL_STOCK]-
IIf([tblOrders]![Quantity]>0,([tblOrders]![Quantity]),'0')>0,[tblTotalStock]![TOTAL_STOCK]-
IIf([tblOrders]![Quantity]>0,([tblOrders]![Quantity]),'0'),'0'))>0,([tblkapplan]![QUANTITY]*12)+
IIf(IsNull([tblSafetyStock]![QUANTITY]),'0',[tblSafetyStock]![QUANTITY]-(IIf([tblTotalStock]![TOTAL_STOCK]-
IIf([tblOrders]![Quantity]>0,([tblOrders]![Quantity]),'0')>0,[tblTotalStock]![TOTAL_STOCK]-
IIf([tblOrders]![Quantity]>0,([tblOrders]![Quantity]),'0'),'0'))),([tblkapplan]![QUANTITY]*12)))/12A question which is probably better asked somewhere else. (Unless of course, someone here is familar with that syntax)
Regards
Peter

Similar Messages

  • Pls convert this piece of SQL code to oracle

    Following is the SQL code----
    Update reg_dim
    set reg_dim.Region_Description = st_reg.Region_Desc ,
    reg_dim.Process_Date = sysdate
    from st_glt_region st_reg
    left join
    Dim_Region reg_dim
    on st_reg.Region_Abbreviation = reg_dim.Region
    where reg_dim.Region is not null
    I have tried this in oracle -----
    update Dim_region_test set Dim_region_test.REGION_DESCRIPTION = (select st_glt_region.Region_Desc
    from st_glt_region left join Dim_region_test
    on Dim_region_test.Region=st_glt_region.Region_Abbreviation where Dim_region_test.Region not in null)
    group by st_glt_region.Region_Desc;
    This is executing but in Dim_region_test, REGION_DESCRIPTION column is empty
    Pls help me..................

    Something like this?
    UPDATE reg_dim
       SET reg_dim.region_description = st_reg.region_desc,
           reg_dim.process_date = (SELECT SYSDATE
                                     FROM st_glt_region st_reg LEFT JOIN dim_region reg_dim
                                             ON st_reg.region_abbreviation = reg_dim.region
                                    WHERE reg_dim.region IS NOT NULL);*009*

  • How can I convert this small pl/sql block in a single query?

    Hello,
    I need to have a single SQL query which gives the same output as the following piece of code, which uses a cursor to iterate on the rows in order to get the informations I need:
    declare
    cursor c(p varchar2) is
    select context_id, id, parent_id
    from CONTEXT_CONTEXT
    start with parent_id is null
    and context_id = p
    connect by prior id = parent_id
    and context_id = p;
    begin
    for r in (select context_id from ALL_CONTEXTS where context_type in ('MYTYPE'))
    loop
    for j in c(r.context_id)
    loop
    -- I want to obtain the values of the following colums from a query:
    dbms_output.put_line(j.context_id || ' ' || j.id || ' ' || j.parent_id);
    end loop;
    end loop;
    end;
    Additional informations:
    CONTEXT_CONTEXT.context_id references ALL_CONTEXTS.id
    CONTEXT_CONTEXT.id references ALL_CONTEXTS.id as well
    CONTEXT_CONTEXT.parent_id references ALL_CONTEXTS.id as well
    id is primary key of ALL_CONTEXTS
    (context_id, id) is primary key of CONTEXT_CONTEXT
    */

    user10047839 wrote:
    Unfortunately, the CONNECT_BY_ROOT is not supported by my version of the DB 9i.
    SELECT  context_id,
            SUBSTR(
                   SYS_CONNECT_BY_PATH(context_id,'/'),
                   2,
                   INSTR(
                         SYS_CONNECT_BY_PATH(context_id,'/') || '/',
                         1,
                         2
                        ) - 2
                  ) AS parent_context_id
      FROM  CONTEXT_CONTEXT
      START WITH parent_id IS NULL
        AND context_id IN (
                           SELECT  context_id
                             FROM  all_contexts
                             WHERE context_type IN ('MYTYPE')
      CONNECT BY PRIOR ID = parent_id
             AND context_id = PRIOR context_id;SY.

  • Convert IIF Access SQL to Oracle SQL...

    I am in the process of converting a MS Access application to VB.Net with Oracle database behind. However I am having a problem converting an MS Access Query that contains IIF statements into an Oracle SQL command. Below is the MS Access SQL code:
    SELECT PDTABLE_132.UNIQUE_CLASH_ID, CISClashStatusTbl.Approval_Type AS Clash_Status, CISClashTypeTbl.Clash_Type, *IIf([TEMP_ACTION_DISCIPLINE] Is Null,"UNALOCATED",[TEMP_ACTION_DISCIPLINE]) AS ACTION_DISCIPLINE*, *IIf([CISDisciplineTbl].[Discipline] Is Null,[PD_2910A_PDTABLE_111].[DISCIPLINE_NAME],[CISDisciplineTbl].[Discipline]) AS TEMP_ACTION_DISCIPLINE*
    FROM ((((((((((((PDTABLE_132 INNER JOIN PD_2910A_PDTABLE_113 ON PDTABLE_132.MODEL_INDEX_NO_A = PD_2910A_PDTABLE_113.MODEL_INDEX_NO) INNER JOIN PD_2910A_PDTABLE_113 AS PD_2910A_PDTABLE_113_1 ON PDTABLE_132.MODEL_INDEX_NO_B = PD_2910A_PDTABLE_113_1.MODEL_INDEX_NO) INNER JOIN PDTABLE_119 ON PD_2910A_PDTABLE_113.MODEL_INDEX_NO = PDTABLE_119.MODEL_INDEX_NO) INNER JOIN PDTABLE_119 AS PDTABLE_119_1 ON PD_2910A_PDTABLE_113_1.MODEL_INDEX_NO = PDTABLE_119_1.MODEL_INDEX_NO) LEFT JOIN CISClashStatusTbl ON PDTABLE_132.IF_APPROVAL_STATUS = CISClashStatusTbl.Approval_Code) LEFT JOIN CISClashTypeTbl ON PDTABLE_132.RECENT_CLASH_TYPE = CISClashTypeTbl.Clash_Code) INNER JOIN PD_2910A_PDTABLE_112 ON PD_2910A_PDTABLE_113.AREA_INDEX_NO = PD_2910A_PDTABLE_112.AREA_INDEX_NO) INNER JOIN PD_2910A_PDTABLE_112 AS PD_2910A_PDTABLE_112_1 ON PD_2910A_PDTABLE_113_1.AREA_INDEX_NO = PD_2910A_PDTABLE_112_1.AREA_INDEX_NO) LEFT JOIN CISOwnerTbl ON PDTABLE_132.UNIQUE_CLASH_ID = CISOwnerTbl.UNIQUE_CLASH_ID) LEFT JOIN CISDisciplineTbl ON CISOwnerTbl.Discipline_Code = CISDisciplineTbl.Discipline_Code) LEFT JOIN PD_2910A_PDTABLE_111 ON PDTABLE_132.ACTION_DISCIPLINE = PD_2910A_PDTABLE_111.DISCIPLINE_INDX_NO) LEFT JOIN PD_2910A_PDTABLE_111 AS PD_2910A_PDTABLE_111_1 ON PDTABLE_132.DISCIPLINE_INDEX_A = PD_2910A_PDTABLE_111_1.DISCIPLINE_INDX_NO) LEFT JOIN PD_2910A_PDTABLE_111 AS PD_2910A_PDTABLE_111_2 ON PDTABLE_132.DISCIPLINE_INDEX_B = PD_2910A_PDTABLE_111_2.DISCIPLINE_INDX_NO
    ORDER BY PDTABLE_132.UNIQUE_CLASH_ID;
    Any help would really be appreshiated.
    Thanks in advance
    Simon
    Edited by: user8275408 on 21-Jan-2010 07:25

    Hi, Simon,
    Welcome to the forum!
    An Oracle equivalent of
    IIf(TEMP_ACTION_DISCIPLINE Is Null,"UNALOCATED",TEMP_ACTION_DISCIPLINE) AS ACTION_DISCIPLINEis
    CASE
         WHEN  TEMP_ACTION_DISCIPLINE Is Null
         THEN  'UNALOCATED'
         ELSE  TEMP_ACTION_DISCIPLINE
    END          AS ACTION_DISCIPLINE, This assumes that temp_action_discipline is a string. (All THEN and ELSE clauses must return the same data type, or at least compatable types.)
    CASE is the most general way of doing IF-THE-ELSE logic in Oracle SQL.
    For certain special situations, there may be shorter ways.
    Testing a variable to see whether it is NULL or not is one of those situations, so you could also say
    NVL2 ( TEMP_ACTION_DISCIPLINE
         , TEMP_ACTION_DISCIPLINE
         , 'UNALOCATED'
    This site noramally compresses whitespace. Whenever you post formatted text here (and code should always be formatted), type these 6 characters:
    (all small letters, inside curly brackets) before and after formatted sections.
    Edited by: Frank Kulash on Jan 21, 2010 10:41 AM
    After reading Bluefrog's answer, I realized that you're testing and possibly returning the same thing, temp_action_discipline.
    In that case, NVL, like Bluefrog suggested, is the best thing to do.  CASE and NVL2, as shown above, will give the right results, but they're more complicated than you need for this job.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Translating ms-access sql to oracle sql

    I would like to translate this ms-access sql to oracle sql.
    SELECT
    CStr(STUDENT_ID),
    FIRST_NAME,
    LAST_NAME,
    IIF(LEN(CLASS_CODE)=3,"Y","") AS "ELEMENTARY_SCHOOL",
    IIF(LEN(CLASS_CODE)=4,"Y","") AS "MIDDLE SCHOOL",
    FROM T_STUDENT
    Thanks in advance for your help.
    Sandra

    For an equivalent of IIF, look at CASE or DECODE. For LEN use LENGTH.
    A business rule that says elementary and middle schools can always be identifed by the length of their codes sounds rather unreliable, though.

  • An error has occurred while accessing SQL database or system resources. If this is the first time you have seen this message, please try again later. If this problem persists, please contact your administrator.

    I have SP Server 2010, and when I try to DELETE a rule within an existing Audience, "Property (Account Name) = domain/username", I get this error, "An error has occurred while accessing SQL database or system resources. If this
    is the first time you have seen this message, please try again later. If this
    problem persists, please contact your administrator."  When I try to "MODIFY" the rule I get this error, "One or more values typed on this page are not valid. Check the text for the indicated fields." 
    The last time I checked it was working, I'm not aware of any new updates installed recently?  I did a full Profile Synchronization as well, but still not working, please advise? -- Evenstarline

    Hi Sara,
    First of all thank you very much for your prompt responses. Here are my comments to each of your suggestions below, and just to let you know I am using a Farm Admin account.  I
    was able to do this way after we upgraded from SP 2007 to SP 2010 as well.   I would like to mention I'm not a SP expert, just been given the responsibility due to another person handling it just left, so apologize with some of
    my novice questions below?
    1. When I change the Operators to "Contains" or "Not Contains" get generates this error below.
         Error generating in red towards top of the audience page..."One or more values typed on this page are not valid.  Check the text for the indicated fields."
         Error occurred where you enter your "Value"..."Could not resolve the user identity. Please re-enter the account name."
    2. We have a 3-server-tier topology (SPWeb, SPDB, and SPFarm).  Does the updates only apply to where the Central Admin is installed, which is the "SPFarm"?  I checked all
    3 servers, and NONE of the updates (KB2899494, KB2889845, and KB2883055) you'd mentioned are installed.
    3. I'm new to IISRET, I need to be extra cautious of what I run in production, is this safe to run with no problem?  What does it do?  And How do I run it?
    4. I'm also new to viewing the ULS log.  I'd just downloaded a viewer for it.  I'm assuming the only logs I need to be concern with viewing are within the SPAdmin (where Central
    Admin is installed)?  There's so many of them, what should I be looking for exactly?
    Evenstarline 

  • Convert PLSQL to T-SQL

    Hi!
    Does anyone know a good conversion tool to convert PLSQL to T-SQL?
    I am working with Oracle 11gR1 and MS SQL Server 2005. I would like to convert the existing
    procedures, functions, packages etc. to T-SQL.
    Thanks in advance for your help!

    I have been tasked with taking over a new website which had a database written in
    MySql (I think anyway).  ....  My question is how do I import this into a Sql Server database? 
    Hello John,
    If you can get access to the MySQL database, then you can use the free Microsoft tool SQL Server Migration Assistant for MySQL (MySQLToSQL) to migrate the database to MS
    SQL Server.
    Olaf Helper
    [ Blog] [ Xing] [ MVP]

  • InfoPath Forms - Cannot access SQL DataConnection

    Hi everyone!
    I have a InfoPath form published in my SharePoint portal and now I need to add a new DataConnection that returns data from a query, so, I created a new DataConnection to receive data with SQL server method. Then, I writed my query and convert it to udcx
    file. But when I clicked in "Preview" button. It works very fine, but when I published it to my SharePoint site, i got this error: "Erro while querying data source, you don't have permissions to access the DB". But, the user that is set
    to access SQL Server has the "dbowner" security level. 
    I think that the error is because my DataSource is local, but I have no idea how can I publish it! 
    Does anyone kno how resolve it?
    Thanks in advance!
    Best Regards.

    Define an AppUserId in the secure store service application which has been granted access to the database and update the connection string to use this as the sso app id.
    This post is my own opinion and does not necessarily reflect the opinion or view of Slalom.

  • Reference to database and/or server name in '' is not supported in this version of SQL Server

    Hello all
    I am using C# and ADO.NET (native) - Visual Studio 2013.
    I am always using full qualified queries like "SELECT * FROM [database].[schema].[table]"
    Obviously there is a problem when doing this against SQL Azure,
    I get the following error: "Reference to database and/or server name in '' is not supported in this version of SQL Server"
    Interesting fact: With SQL Management Studio, the same query works.
    I need to know if this error is really a true one or not.
    If yes, I can quit using SQL Azure. I would need a SQL Server and not a partial SQL Server :-)
    Thanks and best regards
    Frank

    Hi,
    Here are my suggestions:
    1. Use partially qualified queries, because:
    a. from a security standpoint, you'd want to limit your login's access across the server instance
    b. in order to achieve a even better, you should specify your database as the Initial Catalog directly in the SQL Connection.
    If you take into account these practices, SQL Database doesn't come with any limitation from that point of view.
    However, in regard to 'With SQL Management Studio, the same query works', this is actually only partially true because if you run that query agains ADO.NET, you'll actually end up in switching databases along the query which is obviously not permitted in
    SQL Database since you're running in a hosted black-box version of SQL you're not managing. It's just like running the USE <dbname> command which obviously doesn't work.
    Alex

  • Entity Framework - Code First - Migration - How to access SQL Server and Oracle using the same context?

    Hello,
    I use Entity Framework code first approach.
    My project is working fine with SQL Server. But, I want to access Oracle too. I want to switch SQL Server and Oracle in run time.
    I am able to access Oracle using "Oracle.ManagedDataAccess.EntityFramework.dl" in a new project.
    But, Is this possible to access SQL Server and Oracle in the same project.
    Thanks,
    Murugan

    This should be possible with a Code-First workflow.  In Code-First the database mapping layer is generated at runtime.
    David
    David http://blogs.msdn.com/b/dbrowne/

  • Access SQL Function in Oracle?

    Microsoft Access SQL has a function called LastOf which extracts
    data from a column within the last row returned when multiple
    rows are returned. This function works even when many tables are
    joined and only one of them returns multiple rows. Does Oracle's
    SQL implementation have anything like it?

    I can't find a reference to a LastOf function for MS-Access.
    Perhaps you are refering to the Last(expr) function or MoveLast
    method of DAO Recordset.
    Last behavior can be reached in one of several ways depending on
    the desired results, most depending on the ordering of the result
    set. Both Access and VB use the concept of a recordset, which is
    analogous to a CURSOR in Oracle.
    To use an implicit cursor, and only retreive the one row, you
    might use the sudo-colomn ROWNUM:
    SELECT my_col FROM my_tab WHERE ROWNUM = 1
    This would give you the first record of the result set, but there
    is no guarantee on which row it would be - so you might consider
    ordering the result set:
    SELECT my_col FROM my_tab WHERE ROWNUM = 1 ORDER BY my_col ASC;
    Which would return one row, the value of my_col being the
    smallest value in the table. Now might be a good time to talk
    aggrogate functions, such as:
    SELECT MIN( my_col ) FROM my_tab;
    which does the same thing as above.
    If all else fails, RTFM.
    -Kevin

  • How to convert this Servlet into JSP

    I am trying to convert this Servlet into JSP page.
    How do I go about doing this?
    Thanks.
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.util.*;
    import java.text.*;
    /** Shows all items currently in ShoppingCart. Clients
    * have their own session that keeps track of which
    * ShoppingCart is theirs. If this is their first visit
    * to the order page, a new shopping cart is created.
    * Usually, people come to this page by way of a page
    * showing catalog entries, so this page adds an additional
    * item to the shopping cart. But users can also
    * bookmark this page, access it from their history list,
    * or be sent back to it by clicking on the "Update Order"
    * button after changing the number of items ordered.
    * <P>
    * Taken from Core Servlets and JavaServer Pages 2nd Edition
    * from Prentice Hall and Sun Microsystems Press,
    * http://www.coreservlets.com/.
    * &copy; 2003 Marty Hall; may be freely used or adapted.
    public class OrderPage extends HttpServlet {
    public void doGet(HttpServletRequest request,
    HttpServletResponse response)
    throws ServletException, IOException {
    HttpSession session = request.getSession();
    ShoppingCart cart;
    synchronized(session) {
    cart = (ShoppingCart)session.getAttribute("shoppingCart");
    // New visitors get a fresh shopping cart.
    // Previous visitors keep using their existing cart.
    if (cart == null) {
    cart = new ShoppingCart();
    session.setAttribute("shoppingCart", cart);
    String itemID = request.getParameter("itemID");
    if (itemID != null) {
    String numItemsString =
    request.getParameter("numItems");
    if (numItemsString == null) {
    // If request specified an ID but no number,
    // then customers came here via an "Add Item to Cart"
    // button on a catalog page.
    cart.addItem(itemID);
    } else {
    // If request specified an ID and number, then
    // customers came here via an "Update Order" button
    // after changing the number of items in order.
    // Note that specifying a number of 0 results
    // in item being deleted from cart.
    int numItems;
    try {
    numItems = Integer.parseInt(numItemsString);
    } catch(NumberFormatException nfe) {
    numItems = 1;
    cart.setNumOrdered(itemID, numItems);
    // Whether or not the customer changed the order, show
    // order status.
    response.setContentType("text/html");
    PrintWriter out = response.getWriter();
    String title = "Status of Your Order";
    String docType =
    "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 " +
    "Transitional//EN\">\n";
    out.println(docType +
    "<HTML>\n" +
    "<HEAD><TITLE>" + title + "</TITLE></HEAD>\n" +
    "<BODY BGCOLOR=\"#FDF5E6\">\n" +
    "<H1 ALIGN=\"CENTER\">" + title + "</H1>");
    synchronized(session) {
    List itemsOrdered = cart.getItemsOrdered();
    if (itemsOrdered.size() == 0) {
    out.println("<H2><I>No items in your cart...</I></H2>");
    } else {
    // If there is at least one item in cart, show table
    // of items ordered.
    out.println
    ("<TABLE BORDER=1 ALIGN=\"CENTER\">\n" +
    "<TR BGCOLOR=\"#FFAD00\">\n" +
    " <TH>Item ID<TH>Description\n" +
    " <TH>Unit Cost<TH>Number<TH>Total Cost");
    ItemOrder order;
    // Rounds to two decimal places, inserts dollar
    // sign (or other currency symbol), etc., as
    // appropriate in current Locale.
    NumberFormat formatter =
    NumberFormat.getCurrencyInstance();
    // For each entry in shopping cart, make
    // table row showing ID, description, per-item
    // cost, number ordered, and total cost.
    // Put number ordered in textfield that user
    // can change, with "Update Order" button next
    // to it, which resubmits to this same page
    // but specifying a different number of items.
    for(int i=0; i<itemsOrdered.size(); i++) {
    order = (ItemOrder)itemsOrdered.get(i);
    out.println
    ("<TR>\n" +
    " <TD>" + order.getItemID() + "\n" +
    " <TD>" + order.getShortDescription() + "\n" +
    " <TD>" +
    formatter.format(order.getUnitCost()) + "\n" +
    " <TD>" +
    "<FORM>\n" + // Submit to current URL
    "<INPUT TYPE=\"HIDDEN\" NAME=\"itemID\"\n" +
    " VALUE=\"" + order.getItemID() + "\">\n" +
    "<INPUT TYPE=\"TEXT\" NAME=\"numItems\"\n" +
    " SIZE=3 VALUE=\"" +
    order.getNumItems() + "\">\n" +
    "<SMALL>\n" +
    "<INPUT TYPE=\"SUBMIT\"\n "+
    " VALUE=\"Update Order\">\n" +
    "</SMALL>\n" +
    "</FORM>\n" +
    " <TD>" +
    formatter.format(order.getTotalCost()));
    String checkoutURL =
    response.encodeURL("../Checkout.html");
    // "Proceed to Checkout" button below table
    out.println
    ("</TABLE>\n" +
    "<FORM ACTION=\"" + checkoutURL + "\">\n" +
    "<BIG><CENTER>\n" +
    "<INPUT TYPE=\"SUBMIT\"\n" +
    " VALUE=\"Proceed to Checkout\">\n" +
    "</CENTER></BIG></FORM>");
    out.println("</BODY></HTML>");
    }

    Sorry.
    actually this is my coding on the bottom.
    Pleease disregard my previous coding. I got the different one.
    My first approach is using <% %> around the whole doGet method such as:
    <%
    String[] ids = { "hall001", "hall002" };
    setItems(ids);
    setTitle("All-Time Best Computer Books");
    out.println("<HR>\n</BODY></HTML>");
    %>
    I am not sure how to break between code between
    return;
    and
    response.setContentType("text/html");
    Here is my coding:
    public void doGet(HttpServletRequest request,
    HttpServletResponse response)
    throws ServletException, IOException
         String[] ids = { "hall001", "hall002" };
         setItems(ids);
         setTitle("All-Time Best Computer Books");
    if (items == null) {
    response.sendError(response.SC_NOT_FOUND,
    "Missing Items.");
    return;
    response.setContentType("text/html");
    PrintWriter out = response.getWriter();
    String docType =
    "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 " +
    "Transitional//EN\">\n";
    out.println(docType +
    "<HTML>\n" +
    "<HEAD><TITLE>" + title + "</TITLE></HEAD>\n" +
    "<BODY BGCOLOR=\"#FDF5E6\">\n" +
    "<H1 ALIGN=\"CENTER\">" + title + "</H1>");
    CatalogItem item;
    for(int i=0; i<items.length; i++) {
    out.println("<HR>");
    item = items;
    if (item == null) {
    out.println("<FONT COLOR=\"RED\">" +
    "Unknown item ID " + itemIDs[i] +
    "</FONT>");
    } else {
    out.println();
    String formURL =
    "/servlet/coreservlets.OrderPage";
    formURL = response.encodeURL(formURL);
    out.println
    ("<FORM ACTION=\"" + formURL + "\">\n" +
    "<INPUT TYPE=\"HIDDEN\" NAME=\"itemID\" " +
    " VALUE=\"" + item.getItemID() + "\">\n" +
    "<H2>" + item.getShortDescription() +
    " ($" + item.getCost() + ")</H2>\n" +
    item.getLongDescription() + "\n" +
    "<P>\n<CENTER>\n" +
    "<INPUT TYPE=\"SUBMIT\" " +
    "VALUE=\"Add to Shopping Cart\">\n" +
    "</CENTER>\n<P>\n</FORM>");
    out.println("<HR>\n</BODY></HTML>");

  • Access SQL Query Problem - Pls help

    Hi,
    I'm connecting to an Access database and have a query which looks somehting like this:
    SELECT Accept.ACCEPT_NO,
         Accept.CURRENCY,
         Accept.INT_RATE,
         Accept.F_AMOUNT,
         Accept.DEALER,
         Accept.MATURITY,
         Accept.START_DATE,
         Accept.DEAL_DATE,
         Accept.DEALTICKET,
         Accept.BANK_NAME,
         Accept.CALC_DAYS,
         "2001/11/22" AS CurrentDate
    FROM Accept;
    It works fine without the line with CurrentDate so i'm sure something's wrong there. What i want to do is set CurrentDate as a constant ("2001/11/22") i dont have any experience with Access so any help you could give me would be greatly appreciated.
    Thanx in advance.

    I was able to successfully query an access 97 database using the following SQL:
    String sql = "SELECT emp.emp_fname, emp.emp_lname, '2001/11/22' AS CurrentDate FROM emp";don't know why your's wouldn't work. Was there a SQLException? Or are you trying to get it to work using the Access SQL editor?
    Jamie

  • How to retreive this file in SQL*Plus

    If I upload files which name is KOREAN, name of files is invisible.
    I dont't know cause of this problem.
    How is keeping korean name of file from breaking?
    Also, answer how to retreive this file in SQL*Plus
    Thanks
    silverbell

    To access ifs data from SQL, you need to (officially) setup a 'user view'. Refer to the Java API documentation on how to do this. Once you have created the user view, then you may access this view using any SQL tool.

  • What may be the cause of this error java.sql.SQLException: invalid sql type passed to callable statement in iplanet ussing JNDI

     

    Hi,
    The possibilities can be of various reasons, with the sql statements,
    xml descriptors, data sources, improper drivers anything. To crack down
    the solution, kindly let me know the error messages and what exactly are
    you trying to accomplish.
    Thanks & Regards
    Raj
    manimaran t wrote:
    what may be the cause of this error java.sql.SQLException: invalid sql
    type passed to callable statement in iplanet ussing JNDI
    Try our New Web Based Forum at http://softwareforum.sun.com
    Includes Access to our Product Knowledge Base!

Maybe you are looking for

  • Problem in sending SMS via using java communication API

    I need to send SMS via my sony ericsson Z530i. It is connected to the com5 port of my system. I got the following code. import java.io.*; import java.util.BitSet; import javax.comm.*; import java.lang.*; public class SerialToGsm {     InputStream in;

  • FPGA sine wave generator

    NI工程師你好 我在FPGA端使用sine wave generator 可是出來的波形卻不是一個完整的Sin波圖形 可以請工程師幫我解答一下嗎?? 已解決! 轉到解決方案. 附件: sin.png ‏10 KB sin-1.png ‏13 KB

  • G4 iBook and extended desktop

    I am using my G4 iBook to connect to a projector for presentations and have noticed that MS PowerPoint 2004 allows projecting of the current slide whilst I can see next and previous slides on my iBook screen. However in order to do this I have to swi

  • Why its showing error : Invalid Object Name 'table name' when we try to insert data ?

    Hi,     When i try to insert data in the database with the following query                 con.Open();                 cmd = new SqlCommand("insert into good(ID,Name) values('" + textBox1.Text + "','" + textBox2.Text + "')", con);                 cmd

  • CWA redirect failure

    I have a situation where DNS cannot be used for redirecting on CWA, so I have had to create a auth profile that has manual entries in it that redirects the guest to the IP address of the guest portal, rather than the DNS name. The attribute is config