Use Stored Outlines to replace ANALYZE  with "do nothing" ?

Has anyone used Stored Outlines to replace statements like "ANALYZE TABLE abc COMPUTE STATISTICS" ?
Say you have an application that issues a number of 'ANALYZE TABLE' statements at different times during a batch run and you want some of the ANALYZE calls to succeed (eg for tables 'stu' and 'xyz') but others to "do nothing" (eg for table 'abc').
Could you replace "ANALYZE TABLE abc COMPUTE STATISTICS" with a (for example) "select 'x' from dual" call ?

Hemant K Chitale wrote:
Has anyone used Stored Outlines to replace statements like "ANALYZE TABLE abc COMPUTE STATISTICS" ?
Say you have an application that issues a number of 'ANALYZE TABLE' statements at different times during a batch run and you want some of the ANALYZE calls to succeed (eg for tables 'stu' and 'xyz') but others to "do nothing" (eg for table 'abc').
Could you replace "ANALYZE TABLE abc COMPUTE STATISTICS" with a (for example) "select 'x' from dual" call ?
If i understood it right, you seem to mean query rewrite.
As you know already, stored outline is a series of hints to guide optimizer to emulate previous plan.
It cannot be used to replace query text itself.
Advanced query rewrite(10g) seems to be promising, but it can only be used for select statement.
Dion Cho
PS) Rewriting query is very powerful, but very dangerous both for performance and security.
That is maybe the reason why Oracle does not provide those kinds of functionality.

Similar Messages

  • Oracle not using the stored outline

    SQL> create table emp as select * from sys.emp;
    Table created.
    SQL> alter session set create_stored_outlines = TRUE;
    Session altered.
    SQL> create outline emp_dept for category scott_outlines on select empno from emp where ename = 'SCOTT';
    Outline created.
    SQL> set autot on exp
    SQL> select empno from emp where ename = 'SCOTT';
    EMPNO
    7788
    Execution Plan
    Plan hash value: 3956160932
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
    | 0 | SELECT STATEMENT | | 1 | 20 | 2 (0)| 00:00:01 |
    |* 1 | TABLE ACCESS FULL| EMP | 1 | 20 | 2 (0)| 00:00:01 |
    Predicate Information (identified by operation id):
    1 - filter("ENAME"='SCOTT')
    Note
    - dynamic sampling used for this statement (level=2)
    SQL> create unique index i on emp(ename);
    Index created.
    SQL> select empno from emp where ename = 'SCOTT';
    EMPNO
    7788
    Execution Plan
    Plan hash value: 3262377121
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time
    |
    | 0 | SELECT STATEMENT | | 1 | 20 | 1 (0)| 00:00:
    01 |
    | 1 | TABLE ACCESS BY INDEX ROWID| EMP | 1 | 20 | 1 (0)| 00:00:
    01 |
    |* 2 | INDEX UNIQUE SCAN | I | 1 | | 0 (0)| 00:00:
    01 |
    Predicate Information (identified by operation id):
    2 - access("ENAME"='SCOTT')
    SQL> alter session set use_stored_outlines = SCOTT_OUTLIN
    2 ;
    Session altered.
    SQL> alter session set use_stored_outlines = SCOTT_OUTLINS
    2 ;
    Session altered.
    SQL> select empno from emp where ename = 'SCOTT';
    EMPNO
    7788
    Execution Plan
    Plan hash value: 3262377121
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time
    |
    | 0 | SELECT STATEMENT | | 1 | 20 | 1 (0)| 00:00:
    01 |
    | 1 | TABLE ACCESS BY INDEX ROWID| EMP | 1 | 20 | 1 (0)| 00:00:
    01 |
    |* 2 | INDEX UNIQUE SCAN | I | 1 | | 0 (0)| 00:00:
    01 |
    Predicate Information (identified by operation id):
    2 - access("ENAME"='SCOTT')
    Note
    - outline "SYS_OUTLINE_11050409142489113" used for this statement
    SQL> SELECT name, category, used FROM user_outlines;
    NAME CATEGORY USED
    EMP_DEPT SCOTT_OUTLINES UNUSED
    SYS_OUTLINE_11050408594412502 DEFAULT USED
    SYS_OUTLINE_11050408591781301 DEFAULT UNUSED
    SYS_OUTLINE_11050408594415603 DEFAULT UNUSED
    SYS_OUTLINE_11050408595648404 DEFAULT UNUSED
    SYS_OUTLINE_11050409003554705 DEFAULT UNUSED
    SYS_OUTLINE_11050409030340606 DEFAULT UNUSED
    7 rows selected.
    Execution Plan
    Plan hash value: 1195863419
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Ti
    me |
    | 0 | SELECT STATEMENT | | 1 | 81 | 2 (0)| 00
    :00:01 |
    | 1 | NESTED LOOPS | | | | |
    |
    | 2 | NESTED LOOPS | | 1 | 81 | 2 (0)| 00
    :00:01 |
    | 3 | TABLE ACCESS FULL | OL$ | 1 | 64 | 2 (0)| 00
    :00:01 |
    |* 4 | INDEX UNIQUE SCAN | I_USER1 | 1 | | 0 (0)| 00
    :00:01 |
    |* 5 | TABLE ACCESS BY INDEX ROWID| USER$ | 1 | 17 | 0 (0)| 00
    :00:01 |
    Predicate Information (identified by operation id):
    4 - access("CREATOR"="U"."NAME")
    5 - filter("U"."USER#"=USERENV('SCHEMAID'))
    Note
    - outline "SYS_OUTLINE_11050409030340606" used for this statement
    SQL>
    Note : I have dropped all default outlines in dba_outlines but they are being created automatically.(Why)
    Please give me good article to understand more on stored outlines.

    Please post your 4 digits Oracle version.
    It looks like that Oracle has only 1 stored outline for the SQL statement and that the second execution plan with the index has replaced the first outline (execution plan with full table scan).
    Here is a good article on stored outlines http://www.oracle-base.com/articles/misc/Outlines.php (except that the used Oracle version is also missing).
    Here is a short demo based on your demo that I have modified (note that I disabled stored outlines just after creating the first one):
    SQL> select * from v$version;
    BANNER
    Oracle Database 10g Express Edition Release 10.2.0.1.0 - Product
    PL/SQL Release 10.2.0.1.0 - Production
    CORE    10.2.0.1.0      Production
    TNS for 32-bit Windows: Version 10.2.0.1.0 - Production
    NLSRTL Version 10.2.0.1.0 - Production
    SQL> drop table emp purge;
    Table dropped.
    SQL> drop outline emp_dept;
    Outline dropped.
    SQL> whenever sqlerror exit failure;
    SQL> --
    SQL> create table emp as
      2  select object_name ename, object_id empno
      3  from all_objects
      4  where object_id < 5000;
    Table created.
    SQL> --
    SQL> alter session set create_stored_outlines = TRUE;
    Session altered.
    SQL> create outline emp_dept for category scott_outlines on
    select empno from emp where ename = 'SCOTT';
    Outline created.
    SQL> set autot on exp
    SQL> select empno from emp where ename = 'SCOTT';
    no rows selected
    Execution Plan
    Plan hash value: 3956160932
    | Id  | Operation         | Name | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT  |      |     1 |    30 |     5   (0)| 00:00:01 |
    |*  1 |  TABLE ACCESS FULL| EMP  |     1 |    30 |     5   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       1 - filter("ENAME"='SCOTT')
    Note
       - dynamic sampling used for this statement
    SQL> -- disable stored outline creation
    SQL> alter session set create_stored_outlines = FALSE;
    Session altered.
    SQL> create index i on emp(ename);
    Index created.
    SQL> select empno from emp where ename = 'SCOTT';
    no rows selected
    Execution Plan
    Plan hash value: 4079916893
    | Id  | Operation                   | Name | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT            |      |     1 |    30 |     1   (0)| 00:00:01 |
    |   1 |  TABLE ACCESS BY INDEX ROWID| EMP  |     1 |    30 |     1   (0)| 00:00:01 |
    |*  2 |   INDEX RANGE SCAN          | I    |     1 |       |     1   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       2 - access("ENAME"='SCOTT')
    Note
       - dynamic sampling used for this statement
    SQL> -- use stored outlines
    SQL> alter session set use_stored_outlines = SCOTT_OUTLINES;
    Session altered.
    SQL> select empno from emp where ename = 'SCOTT';
    no rows selected
    Execution Plan
    Plan hash value: 3956160932
    | Id  | Operation         | Name | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT  |      |    10 |   300 |     5   (0)| 00:00:01 |
    |*  1 |  TABLE ACCESS FULL| EMP  |    10 |   300 |     5   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       1 - filter("ENAME"='SCOTT')
    Note
       - outline "EMP_DEPT" used for this statement
    SQL> -- do not use stored outlines
    SQL> alter session set use_stored_outlines=false;
    Session altered.
    SQL> select empno from emp where ename = 'SCOTT';
    no rows selected
    Execution Plan
    Plan hash value: 4079916893
    | Id  | Operation                   | Name | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT            |      |     1 |    30 |     1   (0)| 00:00:01 |
    |   1 |  TABLE ACCESS BY INDEX ROWID| EMP  |     1 |    30 |     1   (0)| 00:00:01 |
    |*  2 |   INDEX RANGE SCAN          | I    |     1 |       |     1   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       2 - access("ENAME"='SCOTT')
    Note
       - dynamic sampling used for this statementEdited by: P. Forstmann on 4 mai 2011 13:34

  • Stored outline issue

    Hi experts,
    i have an issues with stored outlines.i am on oracle 9.2.0.1
    i created and outline as
    CREATE OR REPLACE OUTLINE JOB1 FOR CATEGORY JOB_TBL2 ON
    SELECT EMPLID FROM PS_JOB WHERE ACTION LIKE :1
    then
    ALTER SESSION SET use_stored_outlines=JOB_TBL2;
    after that if i run the query SELECT EMPLID FROM PS_JOB WHERE ACTION LIKE :1 then my stored outline is used
    but if i run as SELECT EMPLID FROM PS_JOB WHERE ACTION LIKE 'HIR' it doesnot use stored outline.
    i test with both cursor sharing =similar\exact
    Please help.

    Loading at non lev0 members and aggregating with SET AGGMISSIG OFF may protect the data at non lev0 combinatioons that time.
    It will not protect the data permanantly as future calc operations has always a chance to overwrite that data.
    Follow the below prctices
    1) Load high at the non lev0 combination
    2) Run the push down calculation to allocate this data to lev0 combinations.
    3) Aggregate the data.
    Second approch is
    If you dont like to tie this data to the any available lev0 members for any reasons.Consider the below hierarchy
    ---PG
    -------PG1
    -------PG2
    -------PG3
    You want to load data at PG member level and dont like to tie for any of the members PG1, PG2 and PG3.
    Then add a place holder member PG_I as a sibling to PG3 and load the data to that PG_I.
    Then you can see the expected data at PG with out loading high and applying conditions.

  • Stored Outlines on 10g as was on 9i

    Hi everyone,
    I built lots of stored outlines in 9i for our production database. The interface to do that by then was the java client/server enterprise manager.
    When I upgraded to 10g the only outlines I could find was the sql advisor from the web enterprise manager, but it do not let me customize the plans the way I did on 9i.
    I found out to be a packaged called dbms_sqltune, I wasn't able to do much with that package its kinda a way complex and less pratical.
    How do I create a stored outlines on 10g?
    Many will ask why to force a execution plan as the optimizer is very good? Well, in my experience sometimes the optimizer just don't know "business rules" enought to find the best execution plan for a report, he can guess on the cardinality of the columns but he can't guess that if a report is build to sales dept. then they will only use the 1000 and 1005 contracts on 99% of the cases that will represent a very small part of a huge table. To complete the scenario, many vendors do not open the code for us to "hint" their queries, so stored outlines was the way to go on those (many on my case) cases.
    Thanks in advance for comments!
    Ricardo Rodriguez

    Ricardo,
    Allow me to say a few words as I read your question just now.
    Stored outlines will do exactly what you mentioned.Stored outlines are used to make sure that optimizer wont go for another plan from what you had opted.That's the basic goal in making and conceptulating outlines.The same concept is also there in 11g with Sql Plan Baselines.Therefore, stored outlines and SQL plan baselines are used to:
    - ensure that a given execution plan is always used
    - do SQL tuning without changing the code of the application
    Stored outlines are indeed there in 10g.Please see this line here for 10gR2,
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14211/outlines.htm#sthref1341
    Now in the EM,there is no option(atleast I havenot seen one) to create them as the idea to use stored outlines never really got so popular.I agree those who use it,they like it very much but on a generic part, they were actualy a problem.Too many restrictions are there to implement and use them.
    In 10g, this funcionality seems to be missing, you cannot 'hand made' a exection plan for the query anymore, you could just click on the advice of the sql advisor and pray to him find an solution.
    In 10g the concept is enhanced a step further.Its always a bad idea to "hard-code" a plan for optimizer taking away its decision making sense.So Oracle is promoting for the same reasons which were there for outlines i.e. the query is a part of vendor application,you don't want to chance n number of parameters to tune one query only,they formulated stored profiles to do the job which does the same job but doesn't hard code the plan.SQL profiles are designed to provide to the query optimizer the information like:
    - execution environment (e.g. optimizer mode)
    - object statistics
    - corrections related to the estimations performed by the query optimizer
    As you can see, the aim of a SQL profile is "only" to change the environment in which the query optimizer works. The idea is that by changing the environment the query optimizer should be able to generated a more efficient execution plan.
    I guess you would be clear with the part now.I wont even sya that outlines store the plan itself.Stored outlines, SQL plan baselines and SQL profile do not plans. They store hints which can be used to make up a plan.Yes the option in 10g from GUI is to just create Stored Profiles but not Stored Outlines which stands as a manualy done task.
    Just my 2 cents on the topic.
    Aman....

  • Stored Outlines in SAP

    Hi,
    is anyone using stored outlines within SAP?
    Would you pleas share your experience with it's implementation.
    Thanks
    Volker

    Volker Borowski wrote:>
    > >
    YukonKid wrote:
    > > If you go for outlines you would need to
    > >
    > > a) capture the query exactly as it is executed by the application, hints and all
    > > yk
    > http://forums.sdn.sap.com/post!reply.jspa?messageID=8458029
    > Hi YK,
    >
    > this would be a major "gotcha".
    > My statement has bind variables and I am not able to force the plan
    > to the correct one by invalidating an index.
    > I either need a hint (which will not be in the generated code) or
    > change the sequence of the tables in the from clause.
    >
    > So in both ways the stored outline would refer to a statement,
    > that is literally diffrent.
    >
    > So if I got you correctly, I will not be able to like the plan of a statement to a diffrent one?
    no - it works the other way round:
    Statement A -> worse plan
    you would make it to use the more efficient plan (i.e. using session parameters and such)
    capture that plan and use it on Statement A.
    >
    >
    > The change I'd have to do would be
    >
    > :
    > FROM
    >   table1  T_00,
    >   table2  T_01,
    >   table3  T_02,
    >   table4  T_03,
    >   table5  T_04,
    >   table6  T_05,
    >   table7  T_06,
    >   table8  T_07,
    > WHERE
    > :
    >
    > to
    >
    > :
    > FROM
    >   table2  T_01,
    >   table3  T_02,
    >   table1  T_00,
    >   table4  T_03,
    >   table5  T_04,
    >   table6  T_05,
    >   table7  T_06,
    >   table8  T_07,
    > WHERE
    > :
    >
    > Now as for the SQL Syntax, this make absolutely no diffrence.
    > But the plan changes to effectively 50% less consistent gets (~12000 -> ~6500)
    > and the total optimizer costs for both plans are identical.
    >
    > So I would like to link the plan for statement 2 to the literal statement 1.
    If you have control over the statement check out the ORDERED hint and forget stored outlines
    SELECT /*+ ORDERED */ ....FROM ....WHERE
    tables get joined in the order of the from clause.
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/sql_elements006.htm#SQLRF50601
    But same applies: Don't try to be more clever than the CBO (99% of the time he is smarter than you)....
    >
    > Volker

  • Stored Outline for Bind Variable

    Hi,
    Please let me know the use of stored outline to maintain the same execution plan for a sql which contains bind variable.
    I know how to use stored outline for a sql which does not contain bind variable. But I want the use of stored outline for sql where bind variables have been used. Please provide an example.
    Thanks,
    Mrinmoy
    Edited by: user3001930 on Aug 10, 2010 11:22 PM

    Not sure as I don't use them myself, but on AskTom:
    http://asktom.oracle.com/pls/apex/f?p=100:11:0::::P11_QUESTION_ID:1396058400346694178
    He says:
    >
    stored outlines are deprecated in 11g - replaced by query plan baselines.
    http://download.oracle.com/docs/cd/B28359_01/server.111/b28318/sqlplsql.htm#sthref2589

  • Stored outlines & plan stability

    I am trying to use stored outlines, for plan stability (Oracle 8i).
    Oracle documents says that; the query from my
    application must literally match to the one
    in stored outline (OL$ table). Does that mean
    that the parameter value(s) also should
    match ??
    Example: The following query was stored
    in OL$ table, thru stored outlines procedure.
    select cust_name, sum(revenue)
    from accounts
    where country_code = '225'
    and account_type = 'C'
    group by cust_name;
    Now my question: Is it necessary that my application should throw exact same query,
    including parameter values (i.e.country_code)
    to take advantage of the store outline ?
    If I pass country_code = '436', does it make use of the stored outline or not ?
    Any input is highly appreciated, since this option is very useful in my application
    context.
    thanks and regards
    subbu

    The stored outline need not take the same parameter values .we can give different parameter values.In your case if country_code = '436', it makes use of stored outline.

  • Replace title with contents in h1 tag

    I am using the find and replace function with regular
    expression to update the text between <title></title>
    with the text between <h1></h1>.
    I have the regular expression
    "<title>(<%=PageTitle%>)((.|)((.|\n)*)(<h1><!--
    InstanceBeginEditable name="main heading"
    -->)([A-Za-z0-9.\s]+)(<!-- InstanceEndEditable
    --></h1>)" which can find all the code from the
    <title> to the </h1>. I used the following code at the
    replace textbox: "<title>$5$2$4$5$6"
    Because some of the content are template and nothing happens
    after the replace.
    Anyone has any good ideas to help me implement that? I have
    thousands of pages need to do.
    Thank you very much

    I am not really replace any the template text. I just replace
    the title text with $5, and the rest keep what they were.
    Thanks

  • Use Powershell to replace text with image in Word document

    I have a powershell script that uses a Word document as a template to create signatures that I am pushing out to my organization.
    The document is populated with text formatted the way I want the signature to look, that I then do a FindText and ReplaceText on.  This works fine for replacing text with text, but I can't figure out how to properly replace some of the holder text with
    an image and a link.  I found a few posts about adding images to word documents, but none that seem to work properly in this scenario.
    Any insight would be greatly appreciated, thanks!

    Dear BOFH,
    You are correct that method I outlined is not for inserting an image into a signature block (which would be in Outlook, not Word).  The links you post do certainly deal with outlook signatures, well done... Except that the question was about how to
    use a Powershell script to replace text in a Word document with an image.  Sure it was framed in the context of creating signatures, but the poster expressed that they already had a method of generating and replacing text, and just needed to know, as
    I did, how to do the thing they actually asked.
    Please BOFH... Please forgive my audacity in hoping to find a reference (any reference) to how to replace Word text with images via Powershell in a thread titled "Use Powershell to replace text with image in Word document".
    This is certainly a scripting question, and even something as simple as "You will need to call the .NET methods for the Word find/replace functionality.  Please ask in the Word forums for the correct method to use. 
    If you need help on calling .NET methods look HTTP ://here"support you offered combined with the contempt you offer in response to my actual substantive help to the actual question asked.
    BOFH, you are not better than us, just more arrogant.
    Can you please start your own question as this one has been closed.  Please see scripting guidelines.
    We cannot guarantee you satisfaction as this is a user supported forum.  The is no SLA for community support.  Perhaps if you posted a better worded question as a new topic someone might be able to help you resolve your issue.
    The topic you are posting on is closed and answered.
    ¯\_(ツ)_/¯

  • How much performance is impacted if the Stored outline is used globally?

    Hi,
    One of the queries that we are having problem with and we are trying to use the Stored outline so that we freeze the execution plan. The vendor is telling us that it should set globally (ALTER SYSTEM not SESSION) , but we disagreed because this would have negative effect on our db performance. We ask to enable session only iusing LOGON trigger filtered by program/username nstead of system like below
    Vendor preference: ALTER SYSTEM SET CREATE_STORED_OUTLINES=TRUE
    We prefer: ALTER SESSION SET CREATE_STORED_OUTLINES=TRUE
    BTW, we are on HP UX 10.2.0.3. Any recommendations or suggestions would be greatly appreciated. Thank you so much.
    Rich.

    No Oracle version number.
    No information as to the vendor or the product.
    No information indicating why a stored outline might be of value in one or many cases.
    And most importantly ... no evidence of testing to see if it really makes things better or worse.
    Throw this into a test environment and validate your prejudices. There is no way we can possibly
    know and there are no general rules when it comes to tuning other than the fact that only testing
    on your hardware with your system has value.

  • Parallel query hint with stored outlines

    Hi,
    Can I use parallel query hint with stored outlines.
    Regards
    MMU

    I'm not quite sure what you're asking, since stored outlines themselves implement hints to try to maintain plan stability.
    If you're asking if stored outlines will utililze the parallel query hints I'd have to assume "yes" but would test the idea anyway.
    Message was edited by:
    riedelme

  • Use of Stored Outlines

    I would like to know if the following workaround is possible thru' stored outlines...
    Can I create a stored outline for the following statement?
    SELECT TRIM(EMPNAME) FROM EMP WHERE EMPID=:B1 FOR UPDATE OF EMPNAME;
    Can I create a stored outline for the following statement?
    SELECT TRIM(EMPNAME) FROM EMP WHERE EMPID=:B1 FOR UPDATE;
    If the outlines could be created for both of the above sql statements, then I want to replace the outline for 1st sql with the outline of the 2nd sql...
    Let me know, if someone could help me on that as soon as possible...
    Thanks
    Siva

    ...and how exactly are the two SQLs different?There is a pretty big difference in terms of locking. When a 'select .... for update' statement doesn't have a 'of columnname' clause, the rows in ALL the select statement tables are locked. If the 'of columnname' clause is appended to the 'select .... for update' statement, only the rows in the table that have that column are locked. E.g.
    Session 1 SQL> select d.dname, e.empno from scott.dept d, scott.emp e where e.deptno = d.deptno for update;
    DNAME               EMPNO
    RESEARCH             7369
    SALES                7499
    SALES                7521
    RESEARCH             7566
    SALES                7654
    SALES                7698
    ACCOUNTING           7782
    RESEARCH             7788
    ACCOUNTING           7839
    SALES                7844
    RESEARCH             7876
    SALES                7900
    RESEARCH             7902
    ACCOUNTING           7934
    Session 2 SQL> update scott.dept set dname = 'Research' where dname = 'RESEARCH' ; .................Session 2 locks since session 1 holds exclusive locks on rows from emp and dept.
    Session 1 SQL> commit;
    Commit complete........going back to the locked session 2.....
    Session 2 SQL> update scott.dept set dname = 'Research' where dname = 'RESEARCH' ;
    1 row updated.
    Session 2 SQL> rollback;
    Rollback complete.Now lets try the select for update clause with the 'of columname' clause.
    Session 1 SQL> select d.dname, e.empno from scott.dept d, scott.emp e where e.deptno = d.deptno for update of empno;
    DNAME               EMPNO
    RESEARCH             7369
    SALES                7499
    SALES                7521
    RESEARCH             7566
    SALES                7654
    SALES                7698
    ACCOUNTING           7782
    RESEARCH             7788
    ACCOUNTING           7839
    SALES                7844
    RESEARCH             7876
    SALES                7900
    RESEARCH             7902
    ACCOUNTING           7934
    Session 2 SQL> update scott.dept set dname = 'Research' where dname = 'RESEARCH';
    1 row updated.As you can see, Session 2 does not lock.
    -Raj

  • Need help in using replace function with special characters

    I have a column in a table where the data can contain ascii code for special characters such as an apostrophe.
    The data looks like this:
    CREEK&#39;S LANE
    ie for a street named CREEK'S LANE.
    I want to replace the ascii representation with the apostrophe and have the returned data show up as: CREEK's LANE
    When I try the query below I get prompted for substitution variable value.
    I don't seem to be able to find the right syntax to make this query work.
    SELECT REPLACE (street_name, '&#39;', '''')
    FROM
    streets WHERE street_id = 1
    Does anybody know how to do this?
    Any help would be much appreciated.
    Thanks.
    George

    george91 wrote:
    I have a column in a table where the data can contain ascii code for special characters such as an apostrophe.
    The data looks like this:
    CREEK'S LANE
    ie for a street named CREEK'S LANE.
    I want to replace the ascii representation with the apostrophe and have the returned data show up as: CREEK's LANE
    When I try the query below I get prompted for substitution variable value.
    I don't seem to be able to find the right syntax to make this query work.
    SELECT REPLACE (street_name, ''', '''')
    FROM
    streets WHERE street_id = 1
    Does anybody know how to do this?
    Any help would be much appreciated.
    Thanks.
    GeorgeHa! The codes you specified rendered in the HTML, but showed properly when I listed your original posting above. I didn't understand what you meant initially because the 5-character string represenation got rendered as the quote that you said you weren't able to get - a display problem.
    You're getting prompted for the substituon variable because of the ampersand; you appear to be doing this in SQL*PLUS. The first thing I would try is to SET DEFINE OFF when using the ampersands to see if that works. If That doesn't work check the docs to delmit the ampersand (I think its a backslash before it but can't remember offhand). Another, harder option might be to use the TRANSLATE function replacing the literal character instead of using REPLACE (though replacing a quote will be a little tricky). If you're on 10g also consider using the advanced quoting
    Good luck!
    Edited by: riedelme on May 22, 2009 12:45 PM

  • Hi,I have made a new Apple ID and logged in on my phone, on settings, but the app store is still using my old one. How do I get rid of the old ID and replace it with the new one?

    Hi, I have made a new Apple ID and logged in on my phone, settings > iTunes & app stores, but the app store is still using my old Apple ID. How do I get rid of the old ID and replace it with the new one?

    HAYDONISRAD wrote:
    ...  Maybe I'll stick with hers for now :-)
    OR...
    You could use your preferred Apple ID from now on, but you can still access your purchased items such as music, movies, or software using your other Apple IDs.
    From Here   http://support.apple.com/kb/HE37
    I have multiple Apple IDs. Is there a way for me to merge them into a single Apple ID?

  • Is there a way to tie to iPads together so that when you turn a page with a tap on one, both iPads turn a page.  I am using the ipad to replace piano sheet music.  The challenge is that ordinary sheet music is on both a left and right page.

    We are trying to use an ipad to replace ordinary paper sheet music on a piano.  When truning ordinary paper pages, it is sometimes hard to grasp one page, turn it quickly and get it to stay turned.  The idea with using an ipad is that a tap turns the page, it stays turned.  However,,,,,ordinary sheet music is on both left and right pages.  With one turn you get 2 new pages.  The ipad, being smaller results in only one page and therefore twice as many page turn taps; more taps equals less hands on the piano.  If we could tie 2 ipads together and get them both to turn the page simultaneously it would be nice.  We are trying to get used to using the ipad.  We are using ForScore app to get sheet music into the ipad; we could load one with odd pages and one with even pages.  Maybe this is getting too complicated.
    Anyway to tie 2 units together
    John

    No way to control one device from the other.  But, according to ForScore, you should be able to display two sheets side by side in landscape mode (2-up view)?  Not sure if that helps as it must make the actual print smaller to do so.
    http://www.forscoreapp.com/about/#interface

Maybe you are looking for

  • Restore mountain lion from Time Machine after HD replacement?

    Which key sequence do I use to completely restore a time machine backup to my iMac after HD went bad and was replaced at Apple store? Tried holding down shift while powering on but comes up with galaxy desktop.  I am afraid that I may overwrite my TM

  • Shared Mailbox not archiving

    We have in place archiving setup in Exchange 2013. Archiving is functioning perfectly for our standard mailboxes however for our shared mailboxes they are not archiving automatically, we have enabled the in-place archive, and it has been switched on

  • Blacked out images in Lab Color mode

    This problem relates to Camera Raw 4.5 and 4.4.1. I first noticed this when I opened a file in Lab color. When it opened the image went black. Also the top thumbnail in the channels panel was black. In RGB mode the top thumbnail in the History panel

  • Tunning query with LIKE clause

    Hi, is there any chance to improve execution plan for SQL query which is using LIKE clause? Query: SELECT * FROM [TABLE_NAME] WHERE ADDRESS LIKE :1 ESCAPE '\'; | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | | 0 | SELECT STATEMENT | | 11

  • Partitioning 1TB with Disk Utility

    I have 1TB external drive which I want to partition, but I have some questions regarding format, size, compatibility with both Snow Leopard and Windows (eugh, but necessary). Can someone help me out? I have a few gaps. _*Main Questions*_ _*Partition