JDBC  Inner Query Code Needed

Hi
I have a table called Sale
contains a column called quantity_Available_For_Sale numeric(18,0)
Another table called Withdrawal_Operations contains a column called quantity_withdrawan numeric(18,0)
I need a jdbc code that add quantity_withdrawan value when inserted in the Withdrawal_Operations to the sum of the values of quantity_Available_for_Sale field
this is my trial code
  String sql= "update Sale  set  Item_code ='"+jTextField7.getText()+"',quantity_Available_for_Sale='"+jTextField10.getText()+"SELECT SUM"+""+quantity_Available_for_Sale+""+" FROM "+'Sale'+"+"'WHERE  withdrawal_id='"+jTextField12.getText()+"'";It generates two errors
unclosed character literal.
not a statement.
thanks
Edited by: VANPERSIE on May 7, 2011 10:50 PM

Hi,
This is what you currently have, I think. All I have done is some formatting in order to be able to read it.
String sql = "update Sale set  Item_code ='"   +
             jTextField7.getText()             +
             "',quantity_Available_for_Sale='" +
             jTextField10.getText()            +
             "'SELECT SUM'"                    +
             ""                                +
             "("                               +
             quantity_Available_for_Sale       +
             ")"                               +
             ""                                +
             " FROM "                          +
             Sale                              +
             ""                                +
             "' WHERE  withdrawal_id='"        +
             jTextField12.getText()            +
Statement stmt = con.createStatement(sql);That approach is wrong for several reasons, some being
1. Each time you concatenate a string together, it will be a brand new SQL statement for the server to hard parse.
Not only is this inefficiant, it breaks your SQL cache, causes latching which is definite resource.
Always use bind variables when dealing with databases.
2. You are subject to SQL injection. If your text fields contains SQL or parts of SQL, malicious users could take advantage of that.
3. Your statement is not type safe, and you need to clutter up with single quotes to turn strings into literals.
With this kind of code you are at sub-zero level of writing database applications.
A better approach would be to use PreparedStatement as suggested.
In your case something like:
String sql = "update Sale set  Item_code =?"   +
             ",quantity_Available_for_Sale="   +
             "SELECT SUM"                      +
             ""                                +
             "("                               +
             quantity_Available_for_Sale       +
             ")"                               +
             ""                                +
             " FROM "                          +
             Sale                              +
             ""                                +
             " WHERE  withdrawal_id=?";
PreparedStatement pstmt = con.prepareStatement(sql);
pstmt.setString(1, jTextField10.getText());
pstmt.setString(2, jTextField12.getText());This should take of the three points listed above.
In my opinion you are now at level 1 of writing database applications.
You still have some problems. Above sql, is not SQL, it is nothing but a Java String.
You will struggle to make it into valid SQL, probably by using a cumbersome trial and error process.
And this is even quite simple SQL.
In your case you seem to be pulling data from the front end, and use this directly in the data access layer.
So, you have no POJO layer (I am not saying that you should have).
This makes the SQL a perfect candidate for what you already mentioned yourself, stored procedures.
Using a stored procedure, you have something like this:
String sql = "{call sales_pck.set_quant_avail(?,?)}";
CallableStatement cstmt = con.prepareCall(sql);
cstmt.setString(1, jTextField10.getText());
cstmt.setString(2, jTextField12.getText());Looks much more appealing doesn't it?
- And not much room for SQL syntax errors.
You will of course have to implement that stored procedure. Something many Java developers do not like to do.
Don't know why - to me it smells like technology anxiety.
There is nothing wrong about stored procedures, and nothing old school about them. In your case it even seems like a sensible thing to do.
The first advantage about it, is that you will get to work in a layer (The database) that actually knows SQL.
Here's an attempt to implement your stored, implmented by using a PL/SQL package:
create or replace package sales_pck as
  procedure set_quant_aval (
    p_item_code        in sale.item_code%type,
    p_with_drawal_id   in sale.withdrawal_id%type
end sales_pck;
create or replace package body sales_pck as
  procedure set_quant_aval (
    p_item_code        in sale.item_code%type,
    p_with_drawal_id   in sale.withdrawal_id%type
  ) is
  begin
    update sale
    set    item_code = p_item_code,
           quantity_available =
           select sum (quantity_available_for_sale)
              from   sale
           where  withdrawal_id = p_with_drawal_id;
  end set_quant_aval;
end sales_pck;
/Doing this, you will soon realize that you are not quite there.
You SQL is syntactically wrong (At least in Oracle).
But you are now in the right environment to fix it.
It is probably also semantically wrong, it gives little meaning, and you are probably facing mutating table
(At least in Oracle and other databases supporting read consistency)
Note on syntax errors. You probably mean
    update sale
    set    item_code = p_item_code,
           quantity_available =
             (select sum (quantity_available_for_sale)
              from   sale
              where  withdrawal_id = p_with_drawal_id);Or
    update sale
    set    item_code = p_item_code,
           quantity_available =
             (select sum (quantity_available_for_sale)
              from   sale)
    where  withdrawal_id = p_with_drawal_id;I can't say which, they seem equally wrong.
This is what you should do:
1. Write a correct update statment in a query tool of your choice.
2. Put that statment inside a stored procedure
3. Test that procedure from a query tool
4. Implement the procedure call in your application
5. Test it.
Conclusion:
If you intend to do any (handwritten) SQL in your application, the goal is:
- write as little as you can in the Java layer
- write as much as possible in the database layer
One way of achieving this, is by utilizing stored procedures.
Regards
Peter

Similar Messages

  • How to overwrite an inner query in the select clause

    Hello,
    I have a queryof this form:
    SELECT t1.ID,
               t1.column2,
               (SELECT SUM (t2.column2)
                    FROM table2 t2
                  WHERE t2 = t.ID
                       AND t2.column1 IN (SELECT ..... FROM table3 t3 WHERE t3.column1 = t1.column3 ........)
        FROM table1 t1At the stage where I select from table3 I do not see the columns of table1. In other words:
      t3.column1 = t1.column3will NOT work.
    The version of the database is 10.2.0.4.
    How could I rewrite this piece of code in order to surround the problem?
    I cannot join table3 with table1 in the outermost query, because the structure of this database is such that it would not work for me.
    I know that most of you would say, change the DB structure, but anyway, any ideas? :)
    Besides, is the same restriction for inner queries applicable in Oracle 11g2?
    Thanks

    user13080027 wrote:
    Hi
    I mean I receive the error ORA-00904-"t1.column3" invalid identifier.Something does not add up here. You said earlier
    I cannot join table3 with table1 in the outermost query, because the structure of this database is such that it would not work for me.Why can't you rewrite your query something like follows:
    SELECT t1.ID,
               t1.column2,
               (SELECT SUM (t2.column2)
                    FROM table2 t2
                  WHERE t2 = t.ID
                       AND t2.column1 = t3.column3
        FROM table1 t1, table3 t3
    WHERE t3.column1 = t1.column3p.s. I am not saying this is the exact query you need but then you don't provide any details requested. ;)

  • Grouping Inner Query based on a column.Please help

    I have a strange query.
    I am using Subquery to display the count of rows from the inner query
    depending upon the value of 'Y' or 'N'
    Trade
    id_entity       id_inst_code_type   id_inst_code   dt_trade
    AGL            SE                  5660249        10-Feb-06
    AGL            SE                  5660249        13-Feb-06
    AGL            SE                  5660249        13-Feb'06
    Instrument_xref
    ID_inst      id_inst_xref_type     id_inst_xref  flg_active
    0029010             SE          5660249          Y
    0070789          SE          5660249          Y
    0071190          SE          5660249          Y
    0072385          SE          5660249          Y
    0073215          SE          5660249          Y
    0084797          SE          5660249          Y
    0091375          SE          5660249          Y
    0094690          SE          5660249          Y
    0104438          SE          5660249          Y
    My output:
    id_inst_code_type          id_inst_code   Earliest    Latest       Total    Active
    SE                         5660249       10 Feb 06   13 Feb 06    3        9
    2) If all the 'flg_active' column in Table Instrument_xref is set to 'N'
       the Active should be 0.
    3) Assume that the flg_active could be 3 Y's and 6 N's then what?
    id_inst_code_type          id_inst_code   Earliest    Latest       Total    Active
    SE                         5660249       10 Feb 06   13 Feb 06    3        0
    How do I check for the 'Y' or 'N' value in my code below ?
    Help appreciated as the the functionality changes by the hour...
    select    tie.id_entity             'Entity',
              tie.id_inst_code          'Inst Code',
              min(tie.dt_trade)         'Earliest',
              max(tie.dt_trade)         'Latest',
              count(*)                  'Total',
              dt.InnerTotal             'Active'   
    from     trade_input_event tie,
    (Select  insx.id_inst_xref_type,
                   insx.id_inst_xref,
                   insx.flg_active,
                   count(*) InnerTotal
      from instrument_xref insx
      where insx.id_inst_xref = '5660249'
      ---** Do I need to Check the flg_active here..
      ---** Do I need to use the Having clause here? ie having count(insx.id_inst_xref) = 'N'
       group by insx.id_inst_xref_type,insx.id_inst_xref,insx.flg_active) dt
      where tie.id_inst_code = dt.id_inst_xref
      and tie.id_entity = 'AGL'
      group by tie.id_entity, tie.id_inst_code_type,tie.id_inst_code

    As the flg_active is set to 'Y', I am trying to set it to 'N' in the query
    so that count of 0 is returned, but this displays nothing.
    Please help as to how to display a count(*) of 0 when the flg_active is 'N'??
    Select  insx.id_inst_xref_type,
                   insx.id_inst_xref,
                   insx.flg_active,
                   count(*) InnerTotal
      from instrument_xref insx
      where insx.id_inst_xref = '5660249'
      and insx.flg_active = 'N'
      group by insx.id_inst_xref_type,insx.id_inst_xref,insx.flg_active) dt

  • Error when trying to add a hint to inner query in WHERE clause

    I have a form where the WHERE clause in a block starts like:
    where seqno in (select seqno from nddf n, restriction r...
    I need to add a hint to the inner query like following:
    where seqno in (select /*+ ORDERED */ seqno from nddf n, restriction r...
    When the query executes. I gets an error message and when I look at the detail error I see: ORA-01722: invalid number
    Does anybody know the cause for this. Can I not use hints in inner queries?
    Thanks,
    Thomas

    Did you mean something like this,
    i have tried the below code in forms 10g , as the where clause of 'EMP' block there was no problem.
    deptno in (select /*+ ORDERED */ deptno from dept where rownum<2);
    Also tried in SQLPlus like below
    SQL> select * from emp where deptno in (select /*+ ORDERED */ deptno from dept where rownum<2);
    EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
    7782 CLARK MANAGER 7839 09-JUN-81 2450 10
    7839 KING PRESIDENT 17-NOV-81 5000 10
    7934 MILLER CLERK 7782 23-JAN-82 1300 10

  • SCCM 2012 R2 CU2 Can't Edit WMI Query Code in Report Builder

    I first posted this in the SCCM but the issue is not solved so I thought I'd try here in the SQL Reporting forum. Original thread here: http://social.technet.microsoft.com/Forums/en-US/b0a6ca3d-7471-4b49-8447-7403a65c2ec0/sccm-2012-r2-cu2-cant-edit-wmi-query-code-in-sccm-reports?forum=configmanagergeneral
    I'll repost info here to make this easier.....
    I built a new SCCM 2012 R2 CU2 suite on Server 2012 R2. This also uses SQL 2012 SP1 CU6. This suite has 4 servers: site server, two for WSUS and secondary DPs, and SQL. This problem is true for the built in reports and my custom reports. Our SQL guy has
    been helping me a lot but we've gotten nowhere. I can run a report. I can open one in edit mode after it prompts me for credentials. It loads Report Builder 3.0. But when I go to a dataset/query, enter credentials, and try to open it, I get a popup that
    says "Unable to connect to data source. 'AutoGen_5C6358F2_yayak..." When I click on details it says "The target principal name is incorrect. A connection was succesfully established with the server, but then an error occurred during the login
    process.  (SSL Provider, error: 0 -The target principal name is incorrect.)" In SQL Reporting Services Config Manager the paths for Web Service URL is
    http://ip.ip.ip.ip:80/ReportServer_SC01 and for Report Manager URL:
    http://ip.ip.ip.ip:80/Reports_SC01. A domain account is used to login. This happens when you r-click a dataset and select query to edit the code of a dataset, ie, when query designer tries to open up. It happens
    in both Admin Console and when using the Report Manager URL within SQL SSRS. All other functions of using edit mode of a report work fine.
    Ben JohnsonWY

    When I do that, browse is dimmed out.
    But, if I deselect "create a data set" and click "choose an existing dataset in this report..." there is no data connection at the end.
    But if I don't use report builder and instead use IE to browse to my ConfigMgr_ABC, I do see the connection at the end: {123...}.
    This problem is on a network that is not on the 'net, so it's hard to do screen shots, so I'll reproduce this problem step by step:
    I pick a report to edit, it doesn't matter which one.
    If I try it in Admin Console, I right-click, Edit the report, it asks me for a login, I login, then I get a popup that says "Cannot continue. The application is improperly formatted. Contact the vendor for assistance. I click the Details button and
    get a long set of text but the key part is "Your web browser settings do not allow you to run signed applications." This msg didn't appear before, so something changed, so I will investigate. I think it used to give a SPN error.
    If I use IE within report builder and navigate to whatever report, click open, everything works, except, when I click on Dataset0 (the key one I normally need to edit), click query, it prompts me for a login and no matter which one I use, i get a popup that
    says "unable to connect to data source 'AutoGen_123...'". If I click details I get "the targe principal name is incorrect. A connection was successfully established with the server, but then an error occurred during the login process. (provider:
    SSL Provider 0-The target principal name is incorrect.)
    Ben JohnsonWY

  • Use JDBC to query data for JSP Report

    Hi all,
    I met a trouble when use JDBC to query data,
    it can show data in report builder, but get error when call from url for exxample: http://localhost:8889/reports/TestJDBCReport.jsp
    found error message:
    javax.servlet.jsp.JspException: rwlib-1: REP-4100: Failed to execute data source. REP-0069: Internal error JDBCPDS-62000:Invalid sign-on parameter P_JDBCPDS
    javax.servlet.jsp.JspException: rwlib-1: REP-4100: Failed to execute data source.
    REP-0069: Internal error
    JDBCPDS-62000:Invalid sign-on parameter P_JDBCPDS
    anyone know pls help me
    Many thanks

    As a general rule, it's a good idea to separate the
    presentation (JSP and HTML) from the business rules
    (database access). I know you didn't do that on the
    AS/400, you had display files and business logic in
    the same program (at least, we certainly do in ours),
    but it's a good policy to follow in the web world.
    That means, don't put your database access code in
    the JSP. Other than that, it depends on the data.
    If you have simple data (e.g. customer's name and
    d address) then a Java bean would suffice. If you
    have complex data (e.g. customer's payment history)
    then a bean still might suffice. You would use an
    "include" if you had some data (static or dynamic)
    that you wanted to appear in several different pages
    in the same form.Thanks, I figured putting the code in the JSP was not the best way, but I wasn't sure about the other options.

  • How to pass parameter in Discoverer inner query  PLZ give solution-URGENT

    Hi All,
    My need is I have a query in Disco Admin which has inner query as mention below:
    select Net_Drawn_Amount,Undrawn_Amount,Business_Date from
    (select * from t_FacilityExtract) A,
    We are creating a workbook using Diso Plus and creating a parameter on Business_date which is date partitioned, but issue is in inner query(select * from t_FacilityExtract) is picking whole data which has millions of rows.
    Plz help me how to filter inner query.
    It is just a sample query.
    Plz help me as soon as possible.
    Thanks in advance
    Amit

    Hi,
    Generally, using database contexts is the best way to pass parameters to folders defined in Disco Admin. You can look at this posts or download a article on using contexts with Discoverer from my website (www.cabotconsulting.co.uk).
    Re: Implementing HR report in Discoverer
    Re: Passing multiple parameters into Custom Folder...
    Re: Parameters in SubQuery
    Re: Passing Parameters to a discoverer folder using Note 282249.1
    Rod West

  • Strange behavior in inner query with group by clause

    Hi All,
    I found a very strange behaviour with Inner query having a group by clause.
    Please look the sample code
    Select b,c,qty from (select a,b,c,sum(d) qty from tab_xyz group by b,c);
    This query gives output by summing b,c wise. But when i run the inner query it gives error as "not a group by expression "
    My question is - though the inner query is wrong, how is it possible that this query gives output.
    it behaves like -
    Select b,c,qty from (select b,c,sum(d) qty from tab_xyz group by b,c);
    Is it a normal behaviour ?
    If it is a normal behaviour, then how group by behaves inside a inner query.
    Thanks !!

    This case I have tested already and it throws error.
    But why the initial posted query is not throwing
    error even the inner query is wrong.
    In what way oracle behaves for the initial posted
    query?what is the scenario that throws the error? is it at the time when you only run the inner query or the whole query?

  • New to code, need help please!!!

    I have been designing my first website by following a string of videos I have purchased online. (Timothy Training w/ Framework Files) I am finally to the point that I am ready to 'put' these file on my business catalyst account and get them online. I have run into an issue however. I have a page called services.html and within it I have built a 'featured content slider' that links to several pages. The code was working perfectly in any browser that I previewed it in, live view, inspections, everything was fine!! Until, I 'put' the files onto my business catalyst account, now all of the sudden the code does not display correctly anymore. I have made no changes to the code what-so-ever, no changes to the style sheets, nothing. I had a tech support guy that took a 'quick look' and said that my outer div was all of the sudden in the wrong place. I dont understand how 1. it shifted when I made no changes, 2. It works perfectly fine when I view it outside of BC platform and 3. how to even begin to fix the issue. I have spent hours upon hours trying to remedy this myself and I am finally at a breaking point and quite desperate for help. I have so many hours into this site and I am quite frustrated that I made it this far only for it to fail. Please anyone that is willing to take a look I would be grateful. I am not sure if I should post the code in here or not as this is my first post in the forum. I guess I will try to copy and paste and see if that works. Any suggestions would be great help.. Thank you so much!
    I will copy and paste the code in this order: (I think this is all the code needed to figure it out,I hope...)
    services.html
    featureList.js
    featured.css
    styles.css
    services.html
    <!DOCTYPE HTML>
    <html><!-- InstanceBegin template="/templates/ts_fullwidth.dwt" codeOutsideHTMLIsLocked="false" -->
    <head>
              <script type="text/javascript" src="js/jquery.js"></script>
        <link href="css/styles.css" rel="stylesheet" type"text/css" media="screen">
        <link href="css/print.css" rel="stylesheet" type"text/css" media="screen">
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <meta http-equiv="Content-Type" content="cache" />
        <meta name= "robots" content="INDEX,FOLLOW" />
        <meta name= "keywords" content="Enter Keywords" />
        <meta name= "description" content="Description Here" />
    <!-- InstanceBeginEditable name="doctitle" -->
        <title>Web Site by Tahoe POS Systems LLC - www.tahoesystems.com</title>
                  <script type="text/javascript" src="js/featureList.js"></script>
        <link rel="stylesheet" href="css/featured.css" />
              <script language="javascript">
                        $(document).ready(function() {
                                  $.featureList(
                                            $("#tabs li a"),
                                            $("#output li"), {
                                                      start_item          :          1
              </script>
        <!-- InstanceEndEditable -->
        <!-- Google Analytics Code Goes Below Here -->
        <!-- End Google Analytics Code -->
    <!-- InstanceBeginEditable name="head" -->
    <!-- InstanceEndEditable -->
    </head>
    <body>
    <div id="outer">
              <div id="wrapper">
                        <div id="logo">
                      <img src="images/logos/logo2.png" />
            </div>
            <div id="social-media-icons">
                      <ul>
                          <li><a href="http://www.facebook.com/tahoesystems"><img src="images/icons/facebook_32.png" /></a></li>
                    <li><a href="#"><img src="images/icons/rss_32.png" /></a></li>
                    <li><a href="http://www.twitter.com"><img src="images/icons/twitter_32.png" /></a></li>
                    <li><a href="http://www.youtube.com"><img src="images/icons/youtube_32.png" /></a></li>
              </ul>   
            </div>
            <div id="topnav">
                      <ul>
                          <li><a href="index.html">HOME</a></li>
                    <li><a href="about.html">ABOUT US</a></li>
                    <li><a href="clients.html">CLIENTS</a></li>
                    <li><a href="services.html">SERVICES</a></li>
                    <li><a href="contact.html">CONTACT US</a></li>
                </ul>   
            </div>
            <div id="banner">
                      <img src="images/banner/b1.png" />
            </div>
            <div id="content-fullwidth"><!-- InstanceBeginEditable name="content" -->
              <h1>Welcome to Tahoe Systems Web Site!</h1>
              <p>Our Mission – To ensure your restaurant, bar, café, diner, or eatery operates smoothly. Streamline your workflow by providing the latest, most up-to-date technology the industry has to offer. Maximize your profits with a personalized POS system that works for you and not against you. Ease your stress with the quickest, most reliable, 24-hour technical support in the area. Train your staff in person with one-on-one classes taught by one of our certified staff.</p>
           <div id="feature">
                        <h1>Featured Tahoe Systems Services</h1>
            <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p>
                                  <div id="feature_list">
                                            <ul id="tabs">
                                                      <li>
                                                                <a href="javascript:;">
                                                                <img src="images/icons/ts_star_logo.png" />
                                                                          <h3>Complete Menu Design</h3>
                                                                          <span>Complete with our well-known Fast Bar Page </span>
                                                                </a>
                                                      </li>
                                                      <li>
                                                                <a href="javascript:;">
                                                                          <img src="images/icons/ts_star_logo.png" />
                                                                          <h3>Kitchen Printing with ease</h3>
                                                                          <span>Top of the line printing systems</span>
                                                                </a>
                                                      </li>
                                                      <li>
                                                                <a href="javascript:;">
                                                                <img src="images/icons/ts_star_logo.png" />
                                                                          <h3>VPEN Monitor Systems</h3>
                                                                          <span>HD Screens, Bump Bars, We can do it all!</span>
                                                                </a>
                                                      </li>
                                            </ul>
                                  <ul id="output">
                                                      <li>
                                                                <img src="images/feature_slider/menu-sample2.jpg" />
                                                                <a href="menu.html">Menu Gallery</a>
                                                      </li>
                                                      <li>
                                                                <img src="images/feature_slider/tmu220.jpg" />
                                                                <a href="print.html">Printing Gallery</a>
                                                      </li>
                                                      <li>
                                                                <img src="images/feature_slider/kds_hnet.jpg" />
                                                                <a href="vpen.html">VPEN Gallery</a>
                                                      </li>
                                            </ul>
                                  </div>
              </div>
              <p>Our Mission – To ensure your restaurant, bar, café, diner, or eatery operates smoothly. Streamline your workflow by providing the latest, most up-to-date technology the industry has to offer. Maximize your profits with a personalized POS system that works for you and not against you. Ease your stress with the quickest, most reliable, 24-hour technical support in the area. Train your staff in person with one-on-one classes taught by one of our certified staff.</p>
            <!-- InstanceEndEditable --></div>
            <div id="footer">
                       <p class="footer-text">All Rights Reserved - Tahoe Systems - 2012</p>
            </div>
       </div>
    </div>
    </body>
    <!-- InstanceEnd --></html>
    featureList.js
    * FeatureList - simple and easy creation of an interactive "Featured Items" widget
    * Examples and documentation at: http://jqueryglobe.com/article/feature_list/
    * Version: 1.0.0 (01/09/2009)
    * Copyright (c) 2009 jQueryGlobe
    * Licensed under the MIT License: http://en.wikipedia.org/wiki/MIT_License
    * Requires: jQuery v1.3+
    ;(function($) {
              $.fn.featureList = function(options) {
                        var tabs          = $(this);
                        var output          = $(options.output);
                        new jQuery.featureList(tabs, output, options);
                        return this;
              $.featureList = function(tabs, output, options) {
                        function slide(nr) {
                                  if (typeof nr == "undefined") {
                                            nr = visible_item + 1;
                                            nr = nr >= total_items ? 0 : nr;
                                  tabs.removeClass('current').filter(":eq(" + nr + ")").addClass('current');
                                  output.stop(true, true).filter(":visible").fadeOut();
                                  output.filter(":eq(" + nr + ")").fadeIn(function() {
                                            visible_item = nr;
                        var options                              = options || {};
                        var total_items                    = tabs.length;
                        var visible_item          = options.start_item || 0;
                        options.pause_on_hover                    = options.pause_on_hover                    || true;
                        options.transition_interval          = options.transition_interval          || 5000;
                        output.hide().eq( visible_item ).show();
                        tabs.eq( visible_item ).addClass('current');
                        tabs.click(function() {
                                  if ($(this).hasClass('current')) {
                                            return false;
                                  slide( tabs.index( this) );
                        if (options.transition_interval > 0) {
                                  var timer = setInterval(function () {
                                            slide();
                                  }, options.transition_interval);
                                  if (options.pause_on_hover) {
                                            tabs.mouseenter(function() {
                                                      clearInterval( timer );
                                            }).mouseleave(function() {
                                                      clearInterval( timer );
                                                      timer = setInterval(function () {
                                                                slide();
                                                      }, options.transition_interval);
    })(jQuery);
    featured.css
    #feature
    font-family: "Trebuchet MS",Verdana,Arial,sans-serif;
    font-size: 14px;
    line-height: 1.6;
    width: 750px; /* This is the width  */
    margin: 25px auto; /* margin top/bottom and centering  */
    padding: 20px; /* Padding inside */
    background: #FFF;
    /* Background color  */
    border: 1px solid #CCC; /* border around  */
    #feature h1 { margin: 0; }
    #feature p
    { margin: 0; padding: 7px 0; }
    .clear
    { clear: both; line-height: 1px; font-size: 1px; }
    #feature a
    { outline-color: #888;
    #feature h3 { margin: 0;
    padding: 7px 0 0 0;
    font-size: 16px; text-transform: uppercase;
    ul#tabs li a h3
    { color:#F60; margin-bottom: 5px; ; }
    div#feature_list
    width: 750px; height: 240px;
    overflow: hidden; position: relative;
    div#feature_list ul {
    position: absolute;
    top: 0;
    list-style: none;
    padding: 0;
    margin: 0;
    ul#tabs {
    left: 0;
    z-index: 2;
    width: 320px;
    ul#tabs li { font-size: 12px; font-family: Arial; }
    ul#tabs li img {
    padding: 5px; border: none; margin: 0px 10px 0 0;
    float: left;
    ul#tabs li a
    color: #222;
    text-decoration: none;
    display: block;
    padding: 10px;
    height: 60px;
    outline: none;
    ul#tabs li a:hover { color:#822B00; }
    ul#tabs li a.current {
    background:url(../images/feature-tab-current.png);
    color: #FFF;
    ul#tabs li a.current:hover {
    text-decoration: none;
    cursor: default;
    ul#output {
    right: 0;
    width: 460px; height: 240px;
    position: relative;
    ul#output li {
    position: absolute;
    width: 460px; height: 240px;
    ul#output li a {
    position: absolute;
    bottom: 10px; right: 10px;
    padding: 8px 12px;
    text-decoration: none;
    font-size: 11px;
    color: #FFF;
    background: #000;
    -moz-border-radius: 5px;
    ul#output li a:hover { background:#B33A00; }
    and finally styles.css
    /* CSS Document */
    /* Color Legend */
    /* Reset */
    html, body { margin; 0; padding: 0; border: 0; background: transparent; font-size:10px; }
    div, span, article, aside, footer, header, hgroup, nav, section,
    h1, h2, h3, h4, h5, h6, p, blockquote, a, ol, ul, li,
    table, tr, th, td, tbody, tfoot, thead {
              margin: 0;
              padding: 0;
              border: 0;
              verticle-align: baseline;
              background: transparent; }
    img                    {margin: 0; padding: 0; border: 0; }
    table, tr, th, td, tbody, tfoot, thead {
              margin: 0; padding: 0; border: 0;
              verticle-align: baseline;
              background: transparent; }
    table {border-collapse: collapse; border-spacing: 0; }
    input, select, textarea, form, fieldset {
              margin: 0; padding: 0; border: 0; }
    article, aside, dialog, figure, footer, header, hgroup, nav, section {
              display:block; }
    h1, h2, h3, h4, h5, h6, p, li, blockqutoe, td, th, a, caption, em, strong, strike {
              font-family: Arial, Helvetica, sans-serif;
              font-size:100%;
              font-weight: normal;
              font-style: normal;
              line-height: 100%;
              text-indent: 0;
              text-decoration: none;
              text-align: left;
              color: #000; }
    ol, ul, { list-style: none; }
    /* Global */
    html          {          }
    body          {          background-color:#E8DDCA;
                                  background-image:url(../images/background/roiBody_11.png);
                                  background-repeat:no-repeat;
                                  background-attachment:fixed; }
    /* Headings */
    h1, h2, h3, h4, h5, h6 { font-weight: bold; }
    h1 { font-size:24px; color: #C60 ;
                        padding-bottom: 15px; border-bottom: 1px #ccc solid; margin-bottom: 15px; }
    h2 { font-size: 20px; }
    h3 {font-size: 16px; margin-bottom: 5px; }
    h4 {font-size: 14px; }
    h5 {font-size: 14px; }
    h6 {font-size: 14px; }
    h1 img, h2 img, h3 img, h4 img, h5 img, h6 img, {margin: 0; }
    /* Text Elements */
    p                                        { color:#000; font-size: 12px; line-height: 150%;
                                                      margin: 15px 0px; }
    p. left                              {margin: 1.5em 1.5em 1.5em 0; padding: 0; }
    p. right                     {margin: 1.5em 0 1.5em 1.5em; padding: 0; }
    a                                        {          }
    a:link                              {color: #00f; }
    a:visited                    {color: #0f0; }
    a:active                    {color: #000; }
    a:focus                              {color: #666; }
    a:hover                              {color: #f00; }
    blockquote                    {color: #000; font-size: 12px; }
    strong                              { font-weight: bold; }
    em                                         {font-style: italic; }
    /* Images */
    .image-frame          { padding: 10px; border: 1px #ccc solid; margin: 10px; }
    /* Lists */
    ul                                        {          }
    ol                                        { list-style-type:decimal; }
    ul li                              {color: #000; font-size: 12px; }
    ol li                              {color: #000; font-size: 12px; }
    dl                                        {          }
    dt                                        {          }
    dd                                        {          }
    /* Tables */
    table                              { width: 100%; }
    tr                                         {          }
    .odd                              { background-color: #eee; }
    .even                              { background-color: #fff; }
    th                                         { font-weight:bold; }
    thead, th                    { background: #ccc; }
    tbody                              {          }
    th,td,caption           {          }
    caption                     {          }
    tfoot                              {          }
    .tfooter                    { background-color:#ccc; text-align: center; font-style: italic;
    caption                              { background-color: #efefef;
    /* Miscelaneous */
    sup, sub                    {line-height: 0; }
    abbr, acronym          { border-bottom: dotted #666; }
    address                              {          }
    del                                        {background: #ffcece; color: #f00; }
    code, pre                    { background-color:#ff9; padding: 2px 0px; margin: 4px 25px;
                                                      font-family: "Courier New", Courier, monospace; font-size: 12px; font-weight:bold
    /* Containers */
    #outer                              { width:960px; margin:0 auto; background-color:#FFF; }
    #wrapper                    { width:900px; margin:0 auto; background-color:#FFF; }
    #logo                              { margin:30px 0; float: left; }
    #social-media-icons                     { float:right;                               }
    #social-media-icons ul li           { display: inline;                     }
    #social-media-icons ul                    { margin-top: 40px;           }
    #topnav                                        { clear: both; }
    #topnav ul                              { border-top: 1px #000 solid; border-bottom: 1px #000 solid;
                                                                margin: 20px 0; padding: 10px 0; }
    #topnav ul li                    { display: inline          }
    #topnav ul li a                    { padding: 0 15px;          }
    #topnav          a:link                              {color: #000; }
    #topnav          a:visited                    {color: #000; }
    #topnav          a:active                    {color: #000; }
    #topnav          a:focus                              {color: #666; }
    #topnav          a:hover                              {color: #F90; }
    #banner                                        { margin-bottom: 30px;           }
    #slider                                        { margin-bottom: 30px; }
    #content                              { width: 650px; float: left;          }
    #content-fullwidth          { width: 100%; }
    #rightside                              { width: 200px; float: right;          }
    #footer                                        { clear: both; margin-top: 20px 0; border-top: 1px #ccc solid;          padding-bottom: 20px; }
    #box1          { width: 250px; float: left; margin: 25px; 
                                  border-top: 15px #666 solid; background-color:#EEE;          }
    #box2          { width: 250px;          float: left; margin: 25px;
                                  border-top: 15px #3E5838 solid; background-color:#EEE;          }
    #box3          { width: 250px;          float: left; margin: 25px;
                                  border-top: 15px #386165 solid; background-color:#EEE;          }
    #box1 h3, #box2 h3, #box3 h3 { margin: 20px 10px 10px 10px; }
    #box1 p, #box2 p, #box3 p { margin: 5px 10px 10px 10px; }
    #box4          {                    }
    #box5          {                    }
    #box6          {                    }
    /* Layout Extra */
    /* Navigation Extra */
    /* Forms */
    form ol { list-style-type:none; }
    form           { text-align:left; margin:20px;          }
    label           {
                        float: left; width: 150px; margin-top:5px;
                        text-align:right; display:block; background:none; font-weight:bold;
    submit          { background:none;           }
    input           {
                        width: 280px; margin:0 0 16px 10px;
                        border:1px #bbb solid; padding:5px; background:none;
    input:focus, textarea:focus          { background-color:#FF9; }
    textarea {
                        width: 280px; height: 150px; margin:0 0 16px 10px;
                        border:1px #bbb solid; padding:5px; background:none;
    select { margin-bottom:20px;          }
    .month { margin-left:155px;          }
    .submit {
                        width:90px; height:25px;
                        margin-left:160px;
                        font-size:12px;
    br                    { clear: left;           }
    .clear          { clear:both; }
    /* Miscelaneous */
    .popup-link                    { font-size: 12px; margin: 5px 10px; display:block; }
    .date                              { font-weight: bold; color: #C60; margin-bottom: 3px; }
    .copyright-text { font-size:80%; font-style: italic; color: #333; }
    .footer-text          { font-size:12px; font-style: normal; color: #000; text-align: center; }
    .title                              { font-size:18px; font-weight: bold; color: #333; }
    .subtitle                    { font-size:14px; font-style: italic; color: #333; }
    .artist                     { font-size:16px; font-weight: bold; color: #333; }
    .author                              { font-size:14px; font-weight: bold; color: #555; }
    .editor                              { font-size:14px; font-style: italic; color: #555; }
    .pub-date                    { font-size:10px; font-style: italic; color: #555; }
    .article-date          { font-size:10px; font-style: italic; color: #555; }
    .location                    { font-size:10px; font-style: italic; color: #555; }
    .float-right          { float:right; }
    .float-left                    { float:left; }
    .clear                              { clear:both; }
    .hide                              { display:none; }
    .block                              { display:block; }
    .inline                              { display:inline; }
    .first                              { font-weight:bold; }
    .last                              { font-weight:bold; }
    .left                              { font-weight:bold; text-align:left; }
    .right                              { font-weight:bold; text-align:right; }
    .added                              { background:#D7D7FF; }
    .removed                    { background:#FFCECE; color:#f00; }
    .changed                    { background:#FFB; }

    http://tahoepossystems.businesscatalyst.com/services.html
    Services page is missing quite a bit of stuff.
    This code from a working page is correct:
    <link href="/StyleSheets/ModuleStyleSheets.css" type="text/css" rel="StyleSheet" />
    <script type="text/javascript">var jslang='EN';</script>
    <script type="text/javascript" src="../js/jquery.js"></script>
    <script type="text/javascript" src="../js/needsomethinghere.js"></script>
    <script type="text/javascript" src="../js/slider.js"></script>
    <script type="text/javascript">  // This is the script for the banner slider
    $(document).ready(function() {
    $('#slider').s3Slider({
    timeOut: 6000
    </script>
    <link href="../css/styles.css" rel="stylesheet" css" media="screen">
    <link href="../css/print.css" rel="stylesheet" css" media="screen">
    <link href="../css/slider.css" rel="stylesheet" type="text/css" media="screen">
    In contrast, this is all you have in the <head> of your services.html page:
    <link href="/StyleSheets/ModuleStyleSheets.css" type="text/css" rel="StyleSheet" />
    <script type="text/javascript">var jslang='EN';</script>
    <script type="text/javascript" src="../js/jquery.js"></script>
    <link href="../css/styles.css" rel="stylesheet" type="text/css" media="screen">
    <link href="../css/print.css" rel="stylesheet" type="text/css" media="screen">
    If you reconcile those difference in your code, it should work.
    Nancy O.

  • Bit Locker 48-digit Code Need?

    Hello
    my external HDD has bit locker
    when i remove my windows7 & install new windows8
    i can't open my hard, windows need 48-digit code but i have not it
    furthermorei have my password but windows don't need my pass
    and directly say you forgotten your pass and need 48-digit code
    my question is: how enter my password to open HDD without 48-digit code ?
    like this:
    http://social.technet.microsoft.com/Forums/getfile/389032
     thanks a Bunch

    http://social.msdn.microsoft.com/Forums/windowsazure/en-US/b42d7e23-a41d-4fc7-a8fb-a441712b2a0d/bit-locker-48digit-code-need?forum=windowsazuresecurity
    Your Problem is Already Resolve Same Question You Ask Above Link
    Moderator Please Take Any Action  
    DushYant'

  • I can´t select rownum in a query, when inner query contains SDO_ANYINTERACT

    I have written a query in Oracle that looks like this:
    select ID, NAME, GEOMETRY from
    select a.*, rownum as rnm from
    select ID, NAME, GEOMETRY from MY_TABLE
    where SDO_ANYINTERACT(GEOMETRY, SDO_UTIL.SDO_GEOMETRY('POLYGON ((670000 6268000, 670000 6269000, 700000 6269000, 700000 6268000, 670000 6268000))')) = 'TRUE'
    order by NAME asc
    ) a
    where rnm <= 50 and rnm >= 40
    The inner query is selecting rows from MY_TABLE using a bounding box. The outer queries are included to enable paging for the results.
    For some odd reason this query does not yield any results. If I try and run the subquery:
    select ID, NAME, GEOMETRY from MY_TABLE
    where SDO_ANYINTERACT(GEOMETRY, SDO_UTIL.SDO_GEOMETRY('POLYGON ((670000 6268000, 670000 6269000, 700000 6269000, 700000 6268000, 670000 6268000))')) = 'TRUE'
    order by NAME asc
    It yields a list of results as expected. If i run the subquery:
    select a.*, rownum as rnm from
    select ID, NAME, GEOMETRY from MY_TABLE
    where SDO_ANYINTERACT(GEOMETRY, SDO_UTIL.SDO_GEOMETRY('POLYGON ((670000 6268000, 670000 6269000, 700000 6269000, 700000 6268000, 670000 6268000))')) = 'TRUE'
    order by NAME asc
    ) a
    the result set is empty. Somehow rownum is preventing the query from yielding any results. If I remove rownum the results are returned as in the innermost query:
    select a.* from
    select ID, NAME, GEOMETRY from MY_TABLE
    where SDO_ANYINTERACT(GEOMETRY, SDO_UTIL.SDO_GEOMETRY('POLYGON ((670000 6268000, 670000 6269000, 700000 6269000, 700000 6268000, 670000 6268000))')) = 'TRUE'
    order by NAME asc
    ) a
    What am I doing wrong here?? I am running Oracle 10g..
    Edited by: user12456076 on 2010-01-15 06:14

    What version of Oracle are you running?
    I tried your query on 10.2.0.2 on some data I have and your query works properly.
    Though I would shorten the query to:
    select ID, NAME, GEOMETRY from
      select rownum as rnm, ID, NAME, GEOMETRY
        from MY_TABLE
       where SDO_ANYINTERACT(GEOMETRY, SDO_UTIL.SDO_GEOMETRY('POLYGON ((470000 5268000, 470000 5269000, 500000 5269000, 500000 5268000, 470000 5268000))')) = 'TRUE'
       order by NAME asc
    ) a
    where rnm <= 50 and rnm >= 40;regards
    Simon

  • How to create a DB Adapter with select query having inner query

    Hi All,
    I am trying to create a DB Adapter with select query. The query has some inner queries in it. It is just like this select a, b, c, (select d from e) d, (select e from e) e from tablename.
    The problem here is with the xsd generated for this query. Xsd is not getting generated properly for all the fields it is just getting generated till c element and when it encounters
    the inner query it is stopping the generation of xsd. So for the above query the xsd is something similar to the below
    <xs:complexType name="rewOutput">
    <xs:sequence>
    <xs:element name="a" type="xs:string" nillable="true"/>
    <xs:element name="b" type="xs:string" nillable="true"/>
    <xs:element name="c" type="xs:string" nillable="true"/>
    <xs:element name="select_d" type="xs:string" nillable="true"/>
    </xs:sequence>
    </xs:complexType>
    as shown above the xsd is just getting generated till the first inner query. What should be done to get the full fledged xsd. Should it be manually built ?? Please help me on this.
    Thanks In Advance.
    Edited by: 959766 on Nov 30, 2012 1:20 AM

    Hi,
    I don't think the parser will be able to understand your query properly... I would try building the xsd manually...
    Cheers,
    Vlad

  • [svn:fx-trunk] 5465: Now that padding set on a TextInput does not affect the inner textView, we need to add a custom TextInput skin for the TextInput a Spark NumericStepper contains .

    Revision: 5465
    Author: [email protected]
    Date: 2009-03-20 11:52:56 -0700 (Fri, 20 Mar 2009)
    Log Message:
    Now that padding set on a TextInput does not affect the inner textView, we need to add a custom TextInput skin for the TextInput a Spark NumericStepper contains. Jim ok'ed the addition of the new FxNumericStepperTextInputSkin.mxml class into the spark.skins and wireframe packaged.
    SDK-18275, SDK-19849
    Reviewer: Glenn
    Checkintests: Pass
    Ticket Links:
    http://bugs.adobe.com/jira/browse/SDK-18275
    http://bugs.adobe.com/jira/browse/SDK-19849
    Modified Paths:
    flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxNumericStepper.as
    flex/sdk/trunk/frameworks/projects/flex4/src/mx/skins/spark/FxNumericStepperSkin.mxml
    flex/sdk/trunk/frameworks/projects/wireframe/src/wireframe/FxNumericStepperSkin.mxml
    Added Paths:
    flex/sdk/trunk/frameworks/projects/flex4/src/mx/skins/spark/FxNumericStepperTextInputSkin .mxml
    flex/sdk/trunk/frameworks/projects/wireframe/src/wireframe/FxNumericStepperTextInputSkin. mxml

    Revision: 5465
    Author: [email protected]
    Date: 2009-03-20 11:52:56 -0700 (Fri, 20 Mar 2009)
    Log Message:
    Now that padding set on a TextInput does not affect the inner textView, we need to add a custom TextInput skin for the TextInput a Spark NumericStepper contains. Jim ok'ed the addition of the new FxNumericStepperTextInputSkin.mxml class into the spark.skins and wireframe packaged.
    SDK-18275, SDK-19849
    Reviewer: Glenn
    Checkintests: Pass
    Ticket Links:
    http://bugs.adobe.com/jira/browse/SDK-18275
    http://bugs.adobe.com/jira/browse/SDK-19849
    Modified Paths:
    flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxNumericStepper.as
    flex/sdk/trunk/frameworks/projects/flex4/src/mx/skins/spark/FxNumericStepperSkin.mxml
    flex/sdk/trunk/frameworks/projects/wireframe/src/wireframe/FxNumericStepperSkin.mxml
    Added Paths:
    flex/sdk/trunk/frameworks/projects/flex4/src/mx/skins/spark/FxNumericStepperTextInputSkin .mxml
    flex/sdk/trunk/frameworks/projects/wireframe/src/wireframe/FxNumericStepperTextInputSkin. mxml

  • Google app renewed issue. Your APK's version code needs to be higher than 1000000

    Hi
    I am updating a previous AIr based Android app with a new version.
    I had the following error
    Your APK's version code needs to be higher than 1000000.
    The issue is that I have carefully override the app version number but it keep given me this address.
    Any clue?

    ok, find the solution
    I had to add several ZERO to the version number to be able to upload properly the APK

  • Problem in a inner query- order by clause

    hi...
    I have a update statement with a simple select clause present as inner query..
    (select col1 from table1 where col2='abc' and rownum=1 order by col3 desc)
    since it is a inner query, thats why i can not remove the brackets.
    col3 may be 0 or 1(1 can occur only once...0 can be multiple times)
    my target is to fetch the record if the col3 is 1
    if it is not 1, then it will fetch the first record with col3=0...thats why i have put order by col3.
    moreover i want only one record, thats why i have put rownum=1.
    but it is failing with 'missing right parenthesis'.
    please help..

    Hi,
    Remember that the ORDER BY clause is applied last, after the WHERE clause is completed, so when you way
    WHERE     ROWNUM = 1
    ORDER BY  col3    DESCin the same sub-query, you're picking one row (arbitrarily), and then "sorting" that one row.
    Here's one way to get the results you want:
         SELECT     col1
         FROM     (
                   SELECT  col1
                   ,     ROW_NUMBER () OVER (ORDER BY  col3  DESC)
                                  AS r_num
                   FROM     table1
                   WHERE     col2     = 'abc'
                   AND     col3     IN (0, 1)
         WHERE     r_num     = 1
    )Depending on how this is used in your complete query, there may be better ways to get the same results.

Maybe you are looking for