Run arithmitic in query...

I have a page of the inventory that pulls the following information about each a point...
inv_id - PK
inv_item - the model of article number
man_name - manufacturer
inv_cost - our item unit cost
inv_price the price we sell the item for
inv_desc - long description of the item

All this information is fired for each record that is drawn. I want to display a column that will be titled 'margin '.
The margin is the percentage of profit that we make off of each unit sale, if the cost is $ 200, the price is $ 349.99, then the margin would be 57.1%. You get the number in the formula: margin = cost-price.
I want to calculate this amount for each record and put it in a column named 'margin '. The reason why I want to calculate before she moves back to CF is because I want users to be able to sort on the sidelines.
I'm not sure if this is even possible, especially in the access, but I will go to SQL server 2000 in about 2 weeks, so if you have a solution in access or sql server 2000, please report it here. I have a version of sql server dev to check to see if it works.
Thanks guys,.
Mike

The obvious answer works.

some price, cost, cost/price as margin
etc.

Tags: ColdFusion

Similar Questions

  • Error message when I run delete the query in SQL Server 2008.

    Error message when I run delete the query in SQL Server 2008 SP3.

    Error message:

    MSG 0, level 11, State 0, line 0
    A serious error occurred on the current command.  The results, if any, should be discarded.

    I never got any problem since 5 years.

    Please let me know what is the cause of the problem.

    You can get a response better/faster if repost you your question in the instances of SQL Server dedicated from Microsoft here:

    http://social.technet.microsoft.com/Forums/en-us/category/sqlserver .

    Thank you.   :)

    (I'm sorry, but I can't move this thread for you because the two forums are working on separate platforms)

  • How do I check how much time running on the query server

    Hello

    I work as a junior DBA. The guys on the team application gives the SID from v$ session and asking me how long running this query.
    I'm connecting ther server and get the PID and cpu utilization on unixbox, but cannot get it question time.
    Pls help help get duration/how running queries. Verion Oracle's 9i.

    SQL > select * from v version $;

    BANNER
    ----------------------------------------------------------------
    Oracle9i Enterprise Edition Release 9.2.0.8.0 - Production
    PL/SQL Release 9.2.0.8.0 - Production
    CORE Production 9.2.0.8.0
    AMT for Solaris: 9.2.0.8.0 - Production Version
    NLSRTL Version 9.2.0.8.0 - Production

    Kind regards
    Vincent

    >
    This means 113547 minutes. Right?
    >

    Yes, it's true. But it is not a few Minutes but microseconds. ELAPSED_TIME is microseconds (10g or higher. Not sure about 9i. Please check the doc)

    >
    Number of executions increasing very fast now its 29999. with in wrigting mail its increase. to get the output why this query execution of this many times.
    >

    This means there are a few sessions by running the same query (which is fine). Only, you will need to tell us why the query is run that many times :) Maybe, you need it!

    Published by: user12035575 on September 11, 2011 14:38

  • ADF how can I run a parameter query when the page is displayed

    Hello
    I use web ADF 11 g
    I need to run a parameter query when the page is displayed
    Thank you

    protected DCIteratorBinding getItrtBindings (String binding) {}
    DCIteratorBinding outIterBinding is getBindingsForDCB () .findIteratorBinding (binding);.
    Return outIterBinding;
    }

    public DCBindingContainer getBindingsForDCB() {}
    If (this.bindings == null) {}
    FacesContext fc = FacesContext.getCurrentInstance ();
    This.Bindings = (DCBindingContainer) fc.getApplication (.evaluateExpressionGet(fc,"#{bindings}",DCBindingContainer.class));
    }
    return (DCBindingContainer) this.bindings;
    }

    BindingContainer links protected;

    public BindingContainer {} getBindings()

    Return this.bindings;
    }

    public void setBindings (links BindingContainer) {}
    This.Bindings = links;
    }

  • How to run a Select query stored in a Variable

    Hello

    I have a following requirement:

    Select a query result on Var1, result of another request selection in Var2,
    If Va2 = "value11" or Var2 = "Value2" then Var1 = "select query. Now how can I run this SQL at the end of the Pl/SQL query?

    so I write request for the same thing:

    DECLARE
    qry nvarchar2 (500);
    result nvarchar2 (500);

    BEGIN

    Select "choose TEXTVAL as 'CHARGER' FROM TABLE1 WHERE LOC =" [ParameterValue] "and KEYNAME =" < < REPLACE > > "' double INTO qry ;"

    SELECT CASE County WHEN (RW." CountofBATCH') > 1 then "mixture."
    WHEN count (RW." CountofMAT') = 0 then 'None '.
    ANOTHER 'other '.
    END
    AS a result
    TABLENAME2 TT, XMLTable ('/ sets of lines/lines/lines ' PASSAGE TT.) XMLCOL
    COLUMNS
    "CountofBATCH" PATH "/ row [CLABS > 0] / LOADED ',"
    "CountofMAT" PATH "/ row [MATNR = '[parameter value]'] / MAST '"
    ) AS RW

    where
    TT.PL = '[parameter value]' and
    TT. TANK = "[value settings]";

    IF result = 'Mixture' result GOLD = 'None' THEN
    qry: replace = (qry, "< < REPLACE > >", result);
    on the other
    qry: = 'nothing. '
    END IF;

    Thus the qry variable will have select statement. Now how can I use this to get the select result of this statement in the same query qry?

    You can use execute immediately if the output of the query is in the same query.

    It's very simple.
    a query string signle and then go like this

    declare
    qry VARCHAR2 (255);
    result varcharf2 (2500);
    number of vempid: = 1;

    Start
    qry: =' select empname emp where empid =: empid ";

    run immediately qry in the result using vempid;
    -now the result of data is as a result
    end;

  • Qosmio X 500-116 - running Firefox & hard query by car

    Hello world

    Just a couple of queries if you let (I'm not very irritable)

    So far, I was unable to run Mozilla Firefox without it crashing. It seems to download & install OK but hangs at 100% of the time when I try and run it. Does anyone else have this problem. Trawling around the net, it seems that some users running 64-bit systems I have this problem, although some seem to have no problem! Any thoughts suggestions would be appreciated. I'll have to do with Explorer that came with 2 versions - normal and a 64 bit one!

    Second, my system says my model spec has two hard drives of 500 GB but when I look in 'computer' appears to have disks hard 3 c/d & F - is this normal? C is windows & programs stuff / D is HARD drive recovery and F is totally free. The freespace on all readers come to approximately 800 GB.

    THX

    Bren

    Hello

    I have Satellite P500 with pre-installed 64-bit Win7 Home Premium and use Firefox every day. It works well and there is no problem at all.

    Hard drives:
    Your laptop comes with two hard drives
    HDD1 with two partitions (C and D)
    HDD2 with no partitions

    So, with hard drives, all is OK.
    Please note: this folder HDDRecovery contains recovery of disk image and you can use it for installing the OS. Do not do any changes there, don't move it or delete it. It is not the partition recovery or something like that. It is a usual folder with the data inside. I recommend you to change folder HDDrecovery properties. Change of status in the attributes and set it as hidden. Thus, it will be there, but you will not be able to delete it or move it to another position.

  • run the view query Obj in memory mode

    Hello world

    I use Jdeveloper 11.1.1.6.0

    I have a table on a filtered on my page, view Obj when I add a new line to view Obj, this line showed in the table while he should not appear (depending on where the view clause Obj).

    As I understood I should use a test of display and set its Mode of query: "in memory" or "both", but I want to just use a view obj. How can I do?

    Habib

    Hello

    If you want to get the filter in memory.

    You should do as

    RowMatch rm = new RowMatch ("X = 2"); a clause such as where clause

    vo.setQueryMode (ViewObject.QUERY_MODE_SCAN_VIEW_ROWS);

    vo.setRowMatch (rm);

    vo.executeQuery ();

    Thank you

  • How to prune the spaces in a field and run with lov query

    Hello

    I have a customized OPS page and one of the field's element is of type message entered lov. When the user enters the values for this field lov will validate and it will survey exception if the invalid value is entered in the field.

    Suppose that lov is to have values like 100,200,300,400,500.

    Suppose that user enters the value 100 with spaces for towing, so I want to trim left and right and validate the value after all ready for the values of lov. How can we approach for the same thing?

    Concerning

    Sree

    Hi Mary,

    Using formValue for the validation of the LOV? If Yes, then I guess that's the problem.

    If not, try setting the property to disable the LOV Validation point. This will disable your LOV validation. But in turn, you can check that your trim code works correctly. Recursive debug from here to share your results.

    Kind regards

    Zahid

  • Run the query with multiple parameters

    Dear

    Motion code below for the data is of per_all_people_f, who works for only one setting, when I pass 2 parameters, then is to take the last of them fail times two, could you pls advice how it both join in where clause.

    ================================================================================

    --------------------------------control file ----------------------------------

    ================================================================================

    ' Public Sub processFormRequest (pageContext OAPageContext, OAWebBean webBean)

    {

    super.processFormRequest (pageContext, webBean);

    Am = (OAApplicationModule) pageContext.getApplicationModule (webBean) OAApplicationModule;

    OAApplicationModule am = pageContext.getRootApplicationModule ();

    String model = pageContext.getParameter ("ALL");

    String pempno = pageContext.getParameter ("paramEmpNo");

    String phiredt = pageContext.getParameter ("paramHireDate");

    System.out.println ("control controller exucution");

    If (pageContext.getParameter ("GetData")! = null)

    {

    System.out.println ("controller exucution");

    Boolean ExecuteQuery = BooleanUtils.getBoolean (false);

    [Serializable] parameters = {pempno, phiredt, model, executeQuery};

    Class [] paramTypes = {String.class, String.class, String.class, Boolean.class};

    am.invokeMethod ("initSummary", parameters, paramTypes);

    OAAdvancedTableBean = table

    (OAAdvancedTableBean) webBean.findChildRecursive ("ResultsTable");

    When a user of handling started looking, we always need to run

    the query, so we move on 'false' to queryData().

    table.queryData (pageContext, false);

    }

    }

    ================================================================================

    -Request module file-

    ================================================================================

    public void initSummary (string model,

    String ParmEmpNum,

    String ParmHireDt,

    String created,

    String showMyOrders,

    Boolean ExecuteQuery)

    {

    xxEmployeeVOImpl vo = getxxEmployeeVO1();

    If (vo is nothing)

    {

    Tokens [] MessageToken = {new MessageToken ("parameter", "xxEmployeeVO")};

    throw new OAException ("AK", "FWK_TBX_OBJECT_NOT_FOUND", chips);

    }

    vo.initQuery (model, ParmEmpNum, ParmHireDt, executeQuery);

    System.out.println ("calling vo...");

    }

    ================================================================================

    -xxEmployeeVOImpl-

    ================================================================================

    public void initQuery (String, String ParamEmpNum, String ParmHireDt, Boolean executeQuery model)

    {

    StringBuffer whereClause = new StringBuffer (100);

    Whole CheckWhere;

    Vector of parameters = new Vector (3);

    setWhereClause (null);

    setWhereClauseParams (null);

    Integer bindCount = 0;

    String WhereClause = null;

    If ((ParamEmpNum! = null) & & (!("".)) Equals (ParamEmpNum.Trim ()))

    {

    setWhereClause (null);

    setWhereClauseParams (null);

    setWhereClause ("EMPLOYEE_NUMBER =:" + CheckWhere);

    setWhereClauseParam(0,ParamEmpNum);

    System.out.println ("request" + this.getQuery ());

    System.out.println ("ParamEmpNum" + ParamEmpNum);

    CheckWhere = CheckWhere ++;

    }

    If ((ParmHireDt! = null) & & (!("".)) Equals (ParmHireDt.Trim ()))

    {

    CheckWhere = CheckWhere ++;

    If (CheckWhere > 1)

    {

    setWhereClause (null);

    setWhereClauseParams (null);

    setWhereClause ("AND START_DATE =:" + CheckWhere);

    setWhereClauseParam(0,ParmHireDt);

    System.out.println ("request" + this.getQuery ());

    }

    on the other

    {

    {setWhereClause (null);

    setWhereClauseParams (null);

    setWhereClause ("START_DATE =:"+ CheckWhere ");

    setWhereClauseParam(0,ParmHireDt);

    System.out.println ("request" + this.getQuery ()) ;}

    }

    System.out.println ("ParamEmpNum" + ParmHireDt);

    }

    System.out.println ("request" + this.getQuery ());

    executeQuery();

    Try this:

    public void initQuery(String dummy,String ParamEmpNum,String ParmHireDt, Boolean executeQuery)
    {
      System.out.println("ParamEmpNum: "+ ParamEmpNum);
      System.out.println("ParmHireDt : "+ ParmHireDt);
    
      setWhereClause(null);
      setWhereClauseParams(null);
    
      String WhereClause = null;
    
      int bindCount = 0;
      HashMap paramMap = new HashMap();
    
      if  ( (ParamEmpNum != null) && (!("".equals(ParamEmpNum.trim())))  )
      {
      paramMap.put(bindCount,ParamEmpNum);
      WhereClause = "EMPLOYEE_NUMBER = :"+ (++bindCount) + " AND ";
      }
      if  ( (ParmHireDt != null) && (!("".equals(ParmHireDt.trim())))  )
      {
      paramMap.put(bindCount,ParmHireDt);
      WhereClause = WhereClause + ("START_DATE = :"+ (++bindCount) + " AND ");
      }
      if(bindCount > 0)
      {
      // Remove the AND at the end
      WhereClause = WhereClause.substring(0, WhereClause.length()-5);
    
      setWhereClause(WhereClause);
      for(int i = 0; i < bindCount; i ++) {
      setWhereClauseParam(i,paramMap.get(i));
      }
      }
    
      System.out.println("Query "+ this.getQuery());
      executeQuery();
    }
    

    You may need to change the START_DATE whereclause as below:

    WhereClause = WhereClause + ("START_DATE = TO_DATE (:" + (++ bindCount) + ', "MON-DD-YYYY" ") AND" ' ");

    Note:-need to specify the correct format.

    See you soon

    AJ

  • Cursor from multiple children to a single query (run once)

    Hello

    in a database Standard Edition version 11.2.0.3 I see a strange behavior that I can not explain this now: if I run a simple query on dba_temp_free_space I get children several sliders for the first run:

    -the first execution of the query (which returns 3 rows)

    Select / * test: double cursor * / *.

    of dba_temp_free_space;

    Select child_number, open_versions, extractions, rows_processed

    executions, px_servers_executions, parse_calls, buffer_gets

    v $ sql

    where sql_id = "69azwxdshhffc."

    order of child_number;


    CHILD_NUMBER OPEN_VERSIONS GET PX_SERVERS_EXECUTIONS PARSE_CALLS BUFFER_GETS ROWS_PROCESSED EXECUTIONS

    ------------ ------------- ---------- -------------- ---------- --------------------- ----------- -----------

    0             1          2              3          1                     0           1           7

    1             0          0              0          0                     1           1          55

    2             0          0              0          0                     1           1           2

    Select VERSION_COUNT, LOADED_VERSIONS, EXECUTIONS, PX_SERVERS_EXECUTIONS, PARSE_CALLS, BUFFER_GETS, ROWS_PROCESSED

    v $ sqlarea

    where sql_id = "69azwxdshhffc."

    VERSION_COUNT LOADED_VERSIONS PX_SERVERS_EXECUTIONS PARSE_CALLS BUFFER_GETS ROWS_PROCESSED EXECUTIONS

    ------------- --------------- ---------- --------------------- ----------- ----------- --------------

    3               3          1                     2           3          64              3


    -second run

    Select / * test: double cursor * / *.

    of dba_temp_free_space;


    Select child_number, open_versions, extractions, rows_processed

    executions, px_servers_executions, parse_calls, buffer_gets

    v $ sql

    where sql_id = "69azwxdshhffc."

    order of child_number;


    CHILD_NUMBER OPEN_VERSIONS GET PX_SERVERS_EXECUTIONS PARSE_CALLS BUFFER_GETS ROWS_PROCESSED EXECUTIONS

    ------------ ------------- ---------- -------------- ---------- --------------------- ----------- -----------

    0             0          2              3          1                     0           1           7

    1             0          0              0          0                     1           1          55

    2             0          0              0          0                     1           1           2

    3             1          2              3          1                     0           1           7

    4             0          0              0          0                     1           1          55

    5             0          0              0          0                     1           1           2

    Select VERSION_COUNT, LOADED_VERSIONS, EXECUTIONS, PX_SERVERS_EXECUTIONS, PARSE_CALLS, BUFFER_GETS, ROWS_PROCESSED

    v $ sqlarea

    where sql_id = "69azwxdshhffc."

    VERSION_COUNT LOADED_VERSIONS PX_SERVERS_EXECUTIONS PARSE_CALLS BUFFER_GETS ROWS_PROCESSED EXECUTIONS

    ------------- --------------- ---------- --------------------- ----------- ----------- --------------

    6               6          2                     4           6         128              6

    Just for completeness: the given system is a cluster with two nodes-CARS.


    Thus, every next run creates new child cursors:

    • I don't understand why I get child to run three sliders.
    • I don't understand why the subsequent executions do not re-use a cursor existing.

    Take a look at v$ sql_shared_cursor I see the reasons the optimizer mentions for not to reuse the sliders - but again, I don't understand

    Select child_number

    PX_MISMATCH

    USE_FEEDBACK_STATS

    TOP_LEVEL_RPI_CURSOR

    v $ sql_shared_cursor

    where sql_id = "69azwxdshhffc."

    order of child_number;

    CHILD_NUMBER P U T

    ------------ - - -

    0 N O N

    1 O N N

    2 O N N

    3 N N Y

    4 O N N

    5 O N N

    Yet once I don't see why these reasons must be valid. If I run the query frequently enough I see strange plan renderings when I use dbms_xplan.display_cursor - as described by Timur Akhmadeev in https://timurakhmadeev.wordpress.com/2012/03/19/obsolete-cursors/.

    So the question is: someone knows something like that before? And there at - it an explanation why the server constantly reusing cursors?

    Thanks for your replies in advance.

    Concerning

    Martin Preiss

    Martin:

    It's a slow day before a long weekend, and this kind of intrigued me.  There are a few bugs listed on MOS, at least one of them remarked that it is supposed to be a regression in 11.2.0.3:

    Bug 14016187 - GV$ queries cause high version due to the PX_MISMATCH County to the CARS (Doc ID 14016187.8)

    Bug 14711917 - County high version to the CCR because of the px_mismatch (Doc ID 14711917.8)

    John

  • Query is running slowly (30 sec) first, then quickly - how to find out why?

    Hi all

    First of all, a warning: we are a company of rapidly growing software which provides a SaaS-like solution and is hosting an Oracle database for our own software running at client locations. I'm still not a DBA, but I've been learning for a while now and will follow appropriate courses, next year. This problem becomes urgent enough, however.

    We have an Oracle 12 c (12.1.0.1.7) running on a pretty Beefy hardware (card SSD 8 cores, 72GO,) and it works fine. One of our applications raise queries that run slowly very often, but when I run the same query through Toad, it is very fast again. Sometimes I can make the same query to be slow again by changing settings, adding values to an in(), etc., but not always. By not being is not in a position to know WHY the query is slow, I can not as a solution. We have been struggling with this problem for some time (more than a year, I think) and had the same problem when you still run Oracle 11.

    Some more bits of information that might be relevant:

    -This user defines cursor_sharing for force, per my request (the software itself does not lie)

    -J' put optimizer_index_caching at 25, because I know the DB all be in memory.

    -J' put optimizer_index_cost_adj at 50, because I saw full table scan too for my taste. The two parameters when it is while the queries were not already productive.

    -Memory: memory_target = 40 GB, db_cache_size = 5.5 GB, pga_aggregate_target = 8 GB sga_target = 30 GB

    -Optimizer_dynamic_sampling is the default, 2.

    -J' saw a few query plans have a note, something like "Explain plan was made with the statistics from previous executions. All do not have this, however.

    -J' saw some explain plans in which the actual recordings differ a large amount of the expected records, planned somethings was 1, real was 4 billion...

    -We actually had to add / * ordered * / for some queries to speed up execution. It's been a few other issues have better results (20 sec every time! to 200 ms), but worse when Oracle has finally found the execution plan (40ms).

    -Many queries seemed to start with arrays of harm to our taste.

    -A copy of the database, running locally, also had some problems with queries - the plan of the explain command took 2 seconds, the query itself only a few Ms. the same database of course does not receive any insert/update statements.

    It may be important to note that this scheme receives a lot of updates and inserts, so I thought that it could screw up the statistics?

    As I wrote, we have been struggling with this problem for a long, long time. We have made changes to hardware, the parameters of the Oracle, the client software, everywhere, but are no closer to a permanent solution. Any help would be greatly appreciated!

    Kind regards

    Jelmer

    Post edited by: optimizer_cursor_caching 1449188-> optimizer_index_caching

    1449188 wrote:

    Time for a summary:

    -We switched off forced cursor sharing. This reduces overall Oracle CPU usage a bit.

    -We removed the / + SORTED * / in queries with a theatrical performance

    -optimizer_dynamic_sampling was fixed at 11, but _optimizer_use_feedback is always enabled

    -All the tables and indexes were analyzed, I created statistics expanded on the task, address, person

    Many queries work MUCH better, another big thank you to all who have helped me so far.

    ...

    In particular the line 25 confuses me. Always this BITMAP AND even that crazy E-lines / difference A-lines. I'm sure that's the only reason for the poor performance of this query...

    I think you have a mixture of different effects here, which doesn't makes it really simple to understand exactly what is happening. To some extent this seems to be caused by the new features added in 11g and 12 c.

    1. looking at the trace of the files provided above, there seems to be some problem with dynamic sampling overload (DS). This seems to be one of the reasons why you have this "first slow exec", the second fast exec, in this case without a change of regime. In this trace file, it takes 5 seconds or more to run all these queries recursive dynamic sampling as part of the generation of the plan, and there are two DS queries that contribute significantly to that time (more than 3 seconds for these two DS queries).

    In order to have OPTIMIZER_DYNAMIC_SAMPLING 11 value causes these additional queries. The advantage of this setting is that you get good enough (join) estimates. Of course, it is difficult to judge how much you make this setting and how you lose the overhead of generating plan. New DS queries make use of the RESULT_CACHE have, in principle, reassessment of the same DS queries should come from the RESULT_CACHE. However, if your RESULT_CACHE is too small to contain all of the query results (although these result sets is usually very small) you can sometimes get slowdowns in generational terms if these queries need to be run instead of pull results from the cache.

    2. the function of vibration of statistics of course is involved and sometimes leads to a re-optimizing. Once again, this could then lead to the problem mentioned in point 1., if DS requests takes a long time to generate the plan.

    So these two functions together could lead to some difficult to predict behavior (slow first => possibly caused by DS, second time slow => caused by Feedback: statistics, leading again to DS, third etc. quick time.). It may also explain why you see 'first exec' slow, second fast exec, if re-optimizing na not take too much time and lead to a better execution plan.

    3. the special regard that seems to be the wide track as part of an internal source of lines join nested loop - and in this case, the estimates are * iterative *, so be careful when comparing E-lines (iteratively) with A-lines (cumulative across all iterations). The index used functionality combine to combine two indexes TASK_IDX1 and TASK_IDX2 suggest that it would be beneficial to add PERSON_ID to TASK_IDX1 and maybe get rid of TASK_IDX2 - but it might be appropriate to other queries, which I can't really judge. You can then check if adding more attributes to TASK_IDX1 it would make even more selective about the level of the index, as most of the lines for this particular query is filtered on the WORK table, so adding TASK level. FIXED, TASK. CLOSED and/or TASK. PLAN_START / PLAN_END it would make an even more effective operation. But adding PERSON_ID should solve this particular problem.

    4. the 'quick' this query (mentioned somewhere at the beginning) variation has no merge view inline (SELECT HELP... GROUP BY...), then you can try this by adding a NO_MERGE hint to the inline query (SELECT / * + NO_MERGE * / AID...), just to see if that gives you several times the plan 'rapid '. I still think that the index change described might be the best choice.

    5 SQL Directives of the Plan have been mentioned a couple of times, and I think that it is not quite clear to you what they are. They are not "advice", but are a new feature added to 12 c where Oracle persists some information on bad estimates and then evaluates these SQL Plan plan generation for dynamic additional sample queries and the production of statistics to create additional guidance extended statistics. I don't have enough experience with this new feature and therefore cannot judge how they play a role here. You can ask DBA_SQL_PLAN_DIR_OBJECTS and DBA_SQL_PLAN_DIRECTIVES to see if there are tickets for your particular objects in question.

    Randolf

  • NoAvailableServersException when you run the query in applications

    I only run the UI applications connected to a carrier co-located in my distributed system. When I run a query of the applications I have a NoAvailableServersException. The trace of the full stack of the applications log is below. I can run the same query successfully in gfsh on the same machine, the I'm running the applications. I' wvv looked through the applications documentation but can't find problems with my setup. Please let me know if you need more information.

    Tom

    [06/02/2013 INFO 17:39:19.135 IS main] Manual applications path is C:\vmware\vfabric-gemfire\vFabric_GemFire_70_b38623\tools\DataBrowser\docs\index.html
    [06/02/2013 INFO 17:39:19.512 IS main] Start interviewing for the results link to JMX Manager operation.
    [17:39:19.692 JMXCallExecutorThread IS SERIOUS 2013/02/06] An exception occurred while connecting to the mark on the host: idcprdgflocator2.carecorenational.com and port: 1099: com.gemstone.gemfire.management.ManagementException: Locator has failed. It is normal if the index was arrested. If it wasn't not check his diary for exceptions.
    [06/02/2013 INFO 17:39:19.692 IS JMXCallExecutorThread] Try to connect to a JMX Manager on the host: idcprdgflocator2.carecorenational.com and port: 1099
    [06/02/2013 INFO 17:39:19.793 IS JMXCallExecutorThread] Connected to the Gemfire distributed system
    [06/02/2013 INFO 17:39:21.666 IS JMXCallExecutorThread] Added members: ccnscupadsgf01 (10552) < v14 >: 4709
    [06/02/2013 INFO 17:39:21.679 IS JMXCallExecutorThread] Updated the refreshInterval to 60000
    [06/02/2013 INFO 17:39:23.594 IS JMXCallExecutorThread] GemFire (7.0) Cache is created. Support PDX is available.
    [06/02/2013 INFO 17:39:23.710 IS JMXCallExecutorThread] GemFire jar in the classpath version: 7.0
    [06/02/2013 INFO 17:39:23.710 IS JMXCallExecutorThread] Is the system of GemFire version: 7.0
    [06/02/2013 INFO 17:39:23.710 IS JMXCallExecutorThread] The LIMIT clause is supported by this version of the GemFire system: false
    [06/02/2013 INFO 17:39:23.711 IS JMXCallExecutorThread] The user is connected successfully to JMX Manager to idcprdgflocator2.carecorenational.com: 1099
    [06/02/2013 INFO 17:40:01.633 IS query run] Pool preparation for members:
    [06/02/2013 SERIOUS, 17:40:04.692 IS run query] Error occurred during execution of the query: com.gemstone.gemfire.mgmt.DataBrowser.controller.QueryConfigurationPrms@5608a6fc com.gemstone.gemfire.mgmt.DataBrowser.query.QueryExecutionException: com.gemstone.gemfire.cache.client.NoAvailableServersException
    at com.gemstone.gemfire.mgmt.DataBrowser.query.QueryUtil.executeQuery(QueryUtil.java:74)
    at com.gemstone.gemfire.mgmt.DataBrowser.connection.internal.GemFireClientConnectionImpl.executeQuery(GemFireClientConnectionImpl.java:122)
    to com.gemstone.gemfire.mgmt.DataBrowser.controller.internal.QueryExecutionHelper$ QueryExecutor.run (QueryExecutionHelper.java:169)
    at java.lang.Thread.run(Thread.java:662)
    Caused by: com.gemstone.gemfire.cache.client.NoAvailableServersException
    at com.gemstone.gemfire.cache.client.internal.pooling.ConnectionManagerImpl.borrowConnection(ConnectionManagerImpl.java:246)
    at com.gemstone.gemfire.cache.client.internal.OpExecutorImpl.execute(OpExecutorImpl.java:135)
    at com.gemstone.gemfire.cache.client.internal.OpExecutorImpl.execute(OpExecutorImpl.java:114)
    at com.gemstone.gemfire.cache.client.internal.PoolImpl.execute(PoolImpl.java:638)
    at com.gemstone.gemfire.cache.client.internal.QueryOp.execute(QueryOp.java:51)
    at com.gemstone.gemfire.cache.client.internal.ServerProxy.query(ServerProxy.java:81)
    at com.gemstone.gemfire.cache.query.internal.DefaultQuery.executeOnServer(DefaultQuery.java:282)
    at com.gemstone.gemfire.cache.query.internal.DefaultQuery.execute(DefaultQuery.java:213)
    at com.gemstone.gemfire.cache.query.internal.DefaultQuery.execute(DefaultQuery.java:195)
    at com.gemstone.gemfire.mgmt.DataBrowser.query.QueryUtil.executeQuery(QueryUtil.java:70)
    ..
    . 3 more
    [06/02/2013 SERIOUS, 17:40:04.694 IS query result processor] Error executing query: com.gemstone.gemfire.mgmt.DataBrowser.query.QueryExecutionException: com.gemstone.gemfire.cache.client.NoAvailableServersException
    at com.gemstone.gemfire.mgmt.DataBrowser.query.QueryUtil.executeQuery(QueryUtil.java:74)
    at com.gemstone.gemfire.mgmt.DataBrowser.connection.internal.GemFireClientConnectionImpl.executeQuery(GemFireClientConnectionImpl.java:122)
    to com.gemstone.gemfire.mgmt.DataBrowser.controller.internal.QueryExecutionHelper$ QueryExecutor.run (QueryExecutionHelper.java:169)
    at java.lang.Thread.run(Thread.java:662)
    Caused by: com.gemstone.gemfire.cache.client.NoAvailableServersException
    at com.gemstone.gemfire.cache.client.internal.pooling.ConnectionManagerImpl.borrowConnection(ConnectionManagerImpl.java:246)
    at com.gemstone.gemfire.cache.client.internal.OpExecutorImpl.execute(OpExecutorImpl.java:135)
    at com.gemstone.gemfire.cache.client.internal.OpExecutorImpl.execute(OpExecutorImpl.java:114)
    at com.gemstone.gemfire.cache.client.internal.PoolImpl.execute(PoolImpl.java:638)
    at com.gemstone.gemfire.cache.client.internal.QueryOp.execute(QueryOp.java:51)
    at com.gemstone.gemfire.cache.client.internal.ServerProxy.query(ServerProxy.java:81)
    at com.gemstone.gemfire.cache.query.internal.DefaultQuery.executeOnServer(DefaultQuery.java:282)
    at com.gemstone.gemfire.cache.query.internal.DefaultQuery.execute(DefaultQuery.java:213)
    at com.gemstone.gemfire.cache.query.internal.DefaultQuery.execute(DefaultQuery.java:195)
    at com.gemstone.gemfire.mgmt.DataBrowser.query.QueryUtil.executeQuery(QueryUtil.java:70)
    ... 3 more

    If you set the gemfire bind-address on the cache server, applications will be able to connect. If a bind-address is not defined in gemfire.properties for a server remote cache, applications unfortunately just silently by default is localhost. This is something that will have to solve. In the meantime, you can work around this by setting the property gemfire bind-address on the cache servers for either the IP address or host name.

  • I have run this query to get the result as below, but, even if my query is running fine, that I do not get the expected result.

    I'm looking for only column compare to my same target table as a table source.

    My query:


    Select case when column_name_s is null and column_name_t is not null

    then "alter table GRADE_CONVERSION drop | column_name_t | ';'

    When column_name_s is not null and column_name_t is null

    then "alter table GRADE_CONVERSION add | column_name_s | ' ' || data_type_s | « ; »

    else 'alter table modify GRADE_CONVERSION | column_name_t | ' ' || data_type_t | « ; »

    alterations of the end

    from (select s.column_name column_name_s, t.column_name column_name_t,

    s.data_type data_type_s, t.data_type data_type_t

    (select column_name, column_id, data_type

    of all_tab_cols@database

    where owner = 'erhan.

    and table_name = "GRADE_CONVERSION."

    + 1

    full outer join

    (select column_name, column_id, data_type

    of all_tab_cols@database

    where owner = 'sarigul.

    and table_name = "GRADE_CONVERSION."

    + 6

    on s.column_name = t.column_name

    )




    Tables:



    Target table: table GRADE_CONVERSION in sarigul@database


    LETTER_GRADEVARCHAR2 (2)
    GRADE_POINTNUMBER (3.2)
    MAX_GRADENUMBER (3)
    MIN_GRADENUMBER (3)




    Table source: Table GRADE_CONVERSION in erhan@database

    LETTER_GRADEVARCHAR2 (2)
    GRADE_POINTNUMBER (3.2)
    MAX_GRADENUMBER (3)
    MIN_GRADENUMBER (3)
    CREATED_BYVARCHAR2 (30)
    CREATED_DATEDATE
    MODIFIED_BYVARCHAR2 (30)
    MODIFIED_DATEDATE



    want to see output that is similar to this * (please ignore the names of column here it's just a clear example :))


    ALTER table Target_table change BOOK_ID Varchar2 (4);

    ALTER table Target_table I addSBN_10 Varchar2(13), null;

    ALTER table drop TITLE Target_table;

    Erhan_toronto wrote:

    1.I used src.nullable src_nullable and tgt.nullable tgt_nullable but only show Yes as below: but want to see the result as not null or null

    ALTER table TEST_TARGET change the NUMBER of MAX_GRADE (3, 2) Yes

    Ok. So it's all about the Yes and the no decoding to Default Null or Not Null, isn't it?

    So, to test, change one of the table of sample for NOT NULL columns in the source table, and then run the following query:

    with src as
    (
      select src.table_name src_table_name, src.column_name src_col_name, src.data_type src_data_type, src.data_length src_data_len, src.data_precision src_data_precision, src.data_scale src_data_scale,
             src.nullable src_nullable
        from user_tab_columns src
       where table_name = 'TEST_SOURCE'
    ),
    tgt as
    (
      select tgt.table_name tgt_table_name, tgt.column_name tgt_col_name, tgt.data_type tgt_data_type, tgt.data_length tgt_data_len, tgt.data_precision tgt_data_precision, tgt.data_scale tgt_data_scale,
             tgt.nullable tgt_nullable
        from user_tab_columns tgt
       where table_name = 'TEST_TARGET'
    ),
    col_details as
    (
      select src.src_table_name, nvl(tgt.tgt_table_name, first_value(tgt_table_name) over(order by tgt_table_name nulls last)) tgt_table_name,
             src.src_col_name, src.src_data_type, src.src_data_len, src.src_data_precision, src.src_data_scale, src.src_nullable,
             tgt.tgt_col_name, tgt.tgt_data_type, tgt.tgt_data_len, tgt.tgt_data_precision, tgt.tgt_data_scale, tgt.tgt_nullable
        from src
        left outer join tgt
          on (
              src.src_col_name = tgt.tgt_col_name
             )
    )
    select *
      from (
            select case
                    when tgt_data_type != src_data_type or tgt_data_len != src_data_len or tgt_data_precision != src_data_precision or tgt_data_scale != src_data_scale or src_nullable != tgt_nullable
                      then 'alter table ' || tgt_table_name || ' modify ' || tgt_col_name || ' ' || src_data_type || ' (' ||
                      case when src_data_type in ('DATE') then null
                           else
                                case
                                  when src_data_type in ('VARCHAR', 'VARCHAR2')
                                    then nvl(to_char(src_data_len), ' ') || ') '
                                  else  decode(nvl(src_data_precision, -1), -1, null, nvl(to_char(src_data_precision), ' ') || ', ' || nvl(to_char(src_data_scale), ' ') || ')')
                                end
                      end
                      || decode(src_nullable, 'NO', ' NOT NULL', ' DEFAULT NULL')
                    when tgt_col_name is null
                      then 'alter table ' || tgt_table_name || ' add ' || src_col_name || ' ' || src_data_type ||
                      case when src_data_type in ('DATE') then null
                           else
                                case
                                  when src_data_type in ('VARCHAR', 'VARCHAR2')
                                    then nvl(to_char(src_data_len), ' ') || ') '
                                  else  decode(nvl(src_data_precision, -1), -1, null, nvl(to_char(src_data_precision), ' ') || ', ' || nvl(to_char(src_data_scale), ' ') || ')')
                                end
                      end
                      || decode(src_nullable, 'NO', ' NOT NULL', ' DEFAULT NULL')
                   end alter_statement
              from col_details
            )
    where alter_statement is not null;
    

    Erhan_toronto wrote:

    2. when I run below under user sarigul and erhan I get the result as OWNER, TABLE_NAME, COLUMN_NAME DATA_TYPE... I have a link between two users. They have access to two tables.

    • Select * from all_tab_columns

    where owner = 'erhan' and table_name = "TEST_SOURCE."

    • Select * from all_tab_columns

    where owner = 'sarigul' and table_name = "TEST_TARGET."

    Alright. This means that you both users are on the same database. Only change, you will have to do in the above query is so change user_tab_columns to all_tab_columns and add the OWNER predicate respectively with the clause.

  • Select the query takes a long time to run the second time

    Hi all

    I have Oracle 11 GR 1 material in windows server 2008 R2.
    I have a few tables with 10 million documents. When I run the select query to the tables of first time, it gives me a result in 15 seconds, but if I run the script even twice in the same session, I get the result in 15 minutes to complete...

    Why it's happening? What can be the solution for this?

    Thank you and best regards,
    Vikash jain (DBA Junior)

    What I know is that this feedback from cardinality generates more problems than improving the performance is, in fact, its main objective. But first look at which is was written in the link I posted above

    "Return of cardinality was introduced in the Oracle 11 g database 2. The purpose of this function is to automatically improve plans for queries that are executed repeatedly, _For that the optimizer does not estimate the cardinalities in the properly_ plan"

    If the cardinality feedback kiks in your case it is certainly because you do not have an exact statistics. Get the command the explain plans that I have shown you with the E-lines and A-lines (lines estimates and actual lines) and see where things are poorly estimated.

    If you want to disable the cardinality feedback then add the indicator according to your request

    /*+ opt_param('_optimizer_use_feedback','false') */
    

    Best regards

    Mohamed Houri
    www.hourim.WordPress.com

    Published by: Mohamed Houri on November 22, 2012 02:11
    Published by: I was looking for the exact indication of how do I deactivate the cardinality feedback and I foud in an ot the Dominic post in otn :-)

    Published by: Mohamed Houri on November 22, 2012 02:15

  • Query takes too long to run after clone

    Hi all

    We have a query that works well in our development environment and take about 15 seconds to run the query. When we run the same query with the same parameters in a recently cloned instance, the query takes 1200 dry run.
    Please help us on this issue.

    Thank you
    Rambaud

    Thanks for any response.
    We have solved the problem by using indicators of index.

    Thanks for the update!

Maybe you are looking for

  • Satellite M50: laptop freezing problem

    Hello Problems with a fairly new M50. Recently it started to freeze, can only switch with switch / stop. It takes at least 15 minutes before trying again as it always freezes the OS front. But after that time will always leave you on the operating sy

  • How make the taskbar appear while I am in a browser?

    I love seeing the taskbar, while I am browsing in Firefox and it has always been there until a few days ago, he has simply disappeared.  It's there on the desk, and he said the toolbar is locked, but when I go in Firefox there is no taskbar at the bo

  • Settings of FACEBOOK Notifications of blackBerry Smartphones

    IM quite confused as to how to set up facebook with my curve, I have the App that is connected, BUT my question is, I have to add FACEBOOK MOBILE to my profile page using my computer? I wanted to get some FB txt msgs but I was getting duplicate messa

  • Incoming TCP faddr traffic

    Ciscso Forum Question: After reviewing alerts SNORT on a Win2KServer, I found a faddr TCP traffic. Log Message % PIX-6-302001: Built number of incoming TCP connection for faddr gaddr laddr x.x.x.x/80 adr_ip/port x.x.x.x3537 Journal message% PIX-6-302

  • BlackBerry Smartphones Sync does not work. Cannot select the sync check boxes

    Hello I installed the latest Desktop Software 6.0. We use outlook as our e-mail program. When I try to sync with my outlook account, I first have to configure settings for example to sync my calendar. I choose "two way sync" and select the correct pr