Pencil/Paintbrush vs. Pen

I'm still learning to use the Pen tool, in the meantime, I'm drawing artwork with the Pencil and Paintbrush.
1. After mastering the Pen tool, are there reasons to still use the Pencil or the Paintbrush?
2. I drew two shapes once with the Pencil and once with the Paintbrush. It seems like after drawing with both tools, that I have access to the same options in the Control Panel for chaning the stroke size, variable width profile, and brush definition, essentially making the end result from the two different tools the same. What are the main differences or reasons to use the Pencil vs. the Paintbrush?
Thank you.

They all create paths that when viewed in outline view look the same. The pen and pencil tools are two different ways to create the same thing. With the pen you manually put the points and control the shape of the curves with handles. With the pencil you draw like using a real life pencil and based on your movements and speed Illustrator adds the points automatically and creates the shape of the curves according to parameters that you can set in the options of the tool. You can start creating a path with one tool and continue drawing or editing the path with the other tool. Also the Smooth and Path Eraser tools under the Pencil group in the tool box are basically the pencil tool in special mode.
The brush tool functions and is basically the same like the pencil but the only difference that makes it unique is that it can react to pressure sensitivity input which creates variable width of the stroke and is built into the path. This pressure sensitivity appearance cannot be edited or reused on other paths. You can apply a brush appearance to any path being drawn with any tool  even during its creation by clicking a brush in the brushes panels. This doesn’t change the current tool but applies the brush appearance to the path.
Another way to create variable width stroke is using the Width tool which can be used on paths without pressure sensitive input. The appearance created with the Width tool can be edited and reused on other paths using the Profile menu in the Stroke panel.
You can remove the variable width and pressure sensitive brush appearance from paths as you have already found out by playing around.
Just experiment, play around and  you will discover what tool is most suitable for certain tasks. I use all of them depending on the job. But naturally the pen and brush tools are best used when using digital pen. I don’t think I would ever use these tools if I have to use the mouse. I is like in real life trying to draw by pushing and dragging a brick.

Similar Messages

  • I can not change the style of a pencil,brush, or pen. The options are greyed out. Anyone know what I am doing wrong???

    I can not change the style of a pencil,brush, or pen. The options are greyed out. Anyone know what I am doing wrong???

    Hi,
    Stroke styles are disabled in HTML5 Canvas document type as the target platform doesn't support those. Please check your document tab if it reads '<yourfilename> (Canvas)' then you have created a HTML5 Canvas document.
    If you have created HTML5 document by mistake, then you can copy paste your layers into AS3 document then you can change the stroke style to your desired option.
    Thanks!
    Mohan

  • Pencil & Paintbrush Tools do not show line while drawing

    I am using CS4.
    When I use the Pencil Tool or the Paintbrush Tool, I do not get the blue dotted "preview line" I am supposed to get. Actually, with the Paintbrush Tool, isn't it supposed to show the actual brush stroke as you paint?
    Anyway, it's very difficult to draw when I can't see what I am drawing at all. The final line only shows up when I release. Is there some setting I am missing?
    thank you

    Oops I do not know what happened I went back and as I realized that I was seeing it with the pencil tool and now I see it with the paint brush.
    I wonder why I wasn't seeing it seeing this?
    I would say reset your preferences on Windows i think you hold the control alt shift keys as you restart Illustrator. Or you move the Adobe Illustrator CS (#) Settings folder to a new location.
    C:>Documents and Settings > User >Application Data > Adobe > Adobe Illustrator CS2 Settings

  • Applescript Utility insists on non-existent Script Editor.app 2.1.2

    I recently got Script Editor to work after years of being bugged (was a 4 step process ending with replacing the resources folder in the package). It hadn't worked across several OSX clean installs, so there's no clue to what caused the corruption.
    Now, even though the Editor works, Utility only has 2.1.2 in it's pulldown. I have tried numerous times, including with a shut-down, to get this to "Select" the working Editor (2.1.1), but even though it is selected through the file-selector, it never gets set in the pulldown. The utility is 1.0. I've also checked system archives from 1, 2, and 3 years ago, and there has never been a version 2.1.2 on the computers we use.
    Will Applescript work properly with this incorrect listing for a non-existent version, and therefore unlocatable Editor? It would be very foolish to start writing scripts if the foundation upon which they are written is still fundamentally damaged. And will the only effect of this be that all Editor access must be done by clicking on an icon or alias?
    --Thanks

    The '2.1.2' version, which is only 404 kb, does not launch. Version 2.1.1 opens correctly and is 12.4 mb. Also, version '2.1.2' has a generic application icon (the pencil/paintbrush-A over blank document) whereas the 2.1.1 version has a script/pen icon if that helps. Both versions are, however, 2.1._ (either 2.1.1 or 2.1.2), not 2.2._, which I believe is the Leopard version that you had mentioned.
    I can't say for sure that this folder/app hasn't been in my finder for a while or not as it has only been as of this week that I switched my Finder's view from the standard icon view to 'columns' view without preview icons (that's how I noticed the duplicate folders with the same names stacked on top of each other). Thanks again for all your help.
    Best,
    John

  • PL/SQL 101 : Exception Handling

    Frequently I see questions and issues around the use of Exception/Error Handling in PL/SQL.  More often than not the issue comes from the questioners misunderstanding about how PL/SQL is constructed and executed, so I thought I'd write a small article covering the key concepts to give a clear picture of how it all hangs together. (Note: the examples are just showing examples of the exception handling structure, and should not be taken as truly valid code for ways of handling things)
    Exception Handling
    Contents
    1. Understanding Execution Blocks (part 1)
    2. Execution of the Execution Block
    3. Exceptions
    4. Understanding Execution Blocks (part 2)
    5. How to continue exection of statements after an exception
    6. User defined exceptions
    7. Line number of exception
    8. Exceptions within code within the exception block
    1. Understanding Execution Blocks (part 1)
    The first thing that one needs to understand is almost taking us back to the basics of PL/SQL... how a PL/SQL execution block is constructed.
    Essentially an execution block is made of 3 sections...
    +---------------------------+
    |    Declaration Section    |
    +---------------------------+
    |    Statements  Section    |
    +---------------------------+
    |     Exception Section     |
    +---------------------------+
    The Declaration section is the part defined between the PROCEDURE/FUNCTION header or the DECLARE keyword (for anonymous blocks) and the BEGIN keyword.  (Optional section)
    The Statements section is where your code goes and lies between the BEGIN keyword and the EXCEPTION keyword (or END keyword if there is no EXCEPTION section).  (Mandatory section)
    The Exception section is where any exception handling goes and lies between the EXCEPTION keyword at the END keyword. (Optional section)
    Example of an anonymous block...
    DECLARE
      .. declarative statements go here ..
    BEGIN
      .. code statements go here ..
    EXCEPTION
      .. exception handlers go here ..
    END;
    Example of a procedure/function block...
    [CREATE OR REPLACE] (PROCEDURE|FUNCTION) <proc or fn name> [(<parameters>)] [RETURN <datatype>] (IS|AS)
      .. declarative statements go here ..
    BEGIN
      .. code statements go here ..
    EXCEPTION
      .. exception handlers go here ..
    END;
    (Note: The same can also be done for packages, but let's keep it simple)
    2. Execution of the Execution Block
    This may seem a simple concept, but it's surprising how many people have issues showing they haven't grasped it.  When an Execution block is entered, the declaration section is processed, creating a scope of variables, types , cursors, etc. to be visible to the execution block and then execution enters into the Statements section.  Each statment in the statements section is executed in turn and when the execution completes the last statment the execution block is exited back to whatever called it.
    3. Exceptions
    Exceptions generally happen during the execution of statements in the Statements section.  When an exception happens the execution of statements jumps immediately into the exception section.  In this section we can specify what exceptions we wish to 'capture' or 'trap' and do one of the two following things...
    (Note: The exception section still has access to all the declared items in the declaration section)
    3.i) Handle the exception
    We do this when we recognise what the exception is (most likely it's something we expect to happen) and we have a means of dealing with it so that our application can continue on.
    Example...
    (without the exception handler the exception is passed back to the calling code, in this case SQL*Plus)
    SQL> ed
    Wrote file afiedt.buf
      1  declare
      2    v_name VARCHAR2(20);
      3  begin
      4    select ename
      5    into   v_name
      6    from   emp
      7    where  empno = &empno;
      8    dbms_output.put_line(v_name);
      9* end;
    SQL> /
    Enter value for empno: 123
    old   7:   where  empno = &empno;
    new   7:   where  empno = 123;
    declare
    ERROR at line 1:
    ORA-01403: no data found
    ORA-06512: at line 4
    (with an exception handler, we capture the exception, handle it how we want to, and the calling code is happy that there is no error for it to report)
    SQL> ed
    Wrote file afiedt.buf
      1  declare
      2    v_name VARCHAR2(20);
      3  begin
      4    select ename
      5    into   v_name
      6    from   emp
      7    where  empno = &empno;
      8    dbms_output.put_line(v_name);
      9  exception
    10    when no_data_found then
    11      dbms_output.put_line('There is no employee with this employee number.');
    12* end;
    SQL> /
    Enter value for empno: 123
    old   7:   where  empno = &empno;
    new   7:   where  empno = 123;
    There is no employee with this employee number.
    PL/SQL procedure successfully completed.
    3.ii) Raise the exception
    We do this when:-
    a) we recognise the exception, handle it but still want to let the calling code know that it happened
    b) we recognise the exception, wish to log it happened and then let the calling code deal with it
    c) we don't recognise the exception and we want the calling code to deal with it
    Example of b)
    SQL> ed
    Wrote file afiedt.buf
      1  declare
      2    v_name VARCHAR2(20);
      3    v_empno NUMBER := &empno;
      4  begin
      5    select ename
      6    into   v_name
      7    from   emp
      8    where  empno = v_empno;
      9    dbms_output.put_line(v_name);
    10  EXCEPTION
    11    WHEN no_data_found THEN
    12      INSERT INTO sql_errors (txt)
    13      VALUES ('Search for '||v_empno||' failed.');
    14      COMMIT;
    15      RAISE;
    16* end;
    SQL> /
    Enter value for empno: 123
    old   3:   v_empno NUMBER := &empno;
    new   3:   v_empno NUMBER := 123;
    declare
    ERROR at line 1:
    ORA-01403: no data found
    ORA-06512: at line 15
    SQL> select * from sql_errors;
    TXT
    Search for 123 failed.
    SQL>
    Example of c)
    SQL> ed
    Wrote file afiedt.buf
      1  declare
      2    v_name VARCHAR2(20);
      3    v_empno NUMBER := &empno;
      4  begin
      5    select ename
      6    into   v_name
      7    from   emp
      8    where  empno = v_empno;
      9    dbms_output.put_line(v_name);
    10  EXCEPTION
    11    WHEN no_data_found THEN
    12      INSERT INTO sql_errors (txt)
    13      VALUES ('Search for '||v_empno||' failed.');
    14      COMMIT;
    15      RAISE;
    16    WHEN others THEN
    17      RAISE;
    18* end;
    SQL> /
    Enter value for empno: 'ABC'
    old   3:   v_empno NUMBER := &empno;
    new   3:   v_empno NUMBER := 'ABC';
    declare
    ERROR at line 1:
    ORA-06502: PL/SQL: numeric or value error: character to number conversion error
    ORA-06512: at line 3
    SQL> select * from sql_errors;
    TXT
    Search for 123 failed.
    SQL>
    As you can see from the sql_errors log table, no log was written so the WHEN others exception was the exception that raised the error to the calling code (SQL*Plus)
    4. Understanding Execution Blocks (part 2)
    Ok, so now we understand the very basics of an execution block and what happens when an exception happens.  Let's take it a step further...
    Execution blocks are not just a single simple block in most cases.  Often, during our statements section we have a need to call some reusable code and we do that by calling a procedure or function.  Effectively this nests the procedure or function's code as another execution block within the current statement section so, in terms of execution, we end up with something like...
    +---------------------------------+
    |    Declaration Section          |
    +---------------------------------+
    |    Statements  Section          |
    |            .                    |
    |  +---------------------------+  |
    |  |    Declaration Section    |  |
    |  +---------------------------+  |
    |  |    Statements  Section    |  |
    |  +---------------------------+  |
    |  |     Exception Section     |  |
    |  +---------------------------+  |
    |            .                    |
    +---------------------------------+
    |     Exception Section           |
    +---------------------------------+
    Example... (Note: log_trace just writes some text to a table for tracing)
    SQL> create or replace procedure a as
      2    v_dummy NUMBER := log_trace('Procedure A''s Declaration Section');
      3  begin
      4    v_dummy := log_trace('Procedure A''s Statement Section');
      5    v_dummy := 1/0; -- cause an exception
      6  exception
      7    when others then
      8      v_dummy := log_trace('Procedure A''s Exception Section');
      9      raise;
    10  end;
    11  /
    Procedure created.
    SQL> create or replace procedure b as
      2    v_dummy NUMBER := log_trace('Procedure B''s Declaration Section');
      3  begin
      4    v_dummy := log_trace('Procedure B''s Statement Section');
      5    a; -- HERE the execution passes to the declare/statement/exception sections of A
      6  exception
      7    when others then
      8      v_dummy := log_trace('Procedure B''s Exception Section');
      9      raise;
    10  end;
    11  /
    Procedure created.
    SQL> exec b;
    BEGIN b; END;
    ERROR at line 1:
    ORA-01476: divisor is equal to zero
    ORA-06512: at "SCOTT.B", line 9
    ORA-06512: at line 1
    SQL> select * from code_trace;
    TXT
    Procedure B's Declaration Section
    Procedure B's Statement Section
    Procedure A's Declaration Section
    Procedure A's Statement Section
    Procedure A's Exception Section
    Procedure B's Exception Section
    6 rows selected.
    SQL>
    Likewise, execution blocks can be nested deeper and deeper.
    5. How to continue exection of statements after an exception
    One of the common questions asked is how to return execution to the statement after the one that created the exception and continue on.
    Well, firstly, you can only do this for statements you expect to raise an exception, such as when you want to check if there is no data found in a query.
    If you consider what's been shown above you could put any statement you expect to cause an exception inside it's own procedure or function with it's own exception section to handle the exception without raising it back to the calling code.  However, the nature of procedures and functions is really to provide a means of re-using code, so if it's a statement you only use once it seems a little silly to go creating individual procedures for these.
    Instead, you nest execution blocks directly, to give the same result as shown in the diagram at the start of part 4 of this article.
    SQL> ed
    Wrote file afiedt.buf
      1  create or replace procedure b (p_empno IN VARCHAR2) as
      2    v_dummy NUMBER := log_trace('Procedure B''s Declaration Section');
      3  begin
      4    v_dummy := log_trace('Procedure B''s Statement Section');
      5    -- Here we start another execution block nested in the first one...
      6    declare
      7      v_dummy NUMBER := log_trace('Nested Block Declaration Section');
      8    begin
      9      v_dummy := log_trace('Nested Block Statement Section');
    10      select empno
    11        into   v_dummy
    12        from   emp
    13       where  empno = p_empno; -- Note: the parameters and variables from
                                         parent execution block are available to use!
    14    exception
    15      when no_data_found then
    16        -- This is an exception we can handle so we don't raise it
    17        v_dummy := log_trace('No employee was found');
    18        v_dummy := log_trace('Nested Block Exception Section - Exception Handled');
    19      when others then
    20        -- Other exceptions we can't handle so we raise them
    21        v_dummy := log_trace('Nested Block Exception Section - Exception Raised');
    22        raise;
    23    end;
    24    -- ...Here endeth the nested execution block
    25    -- As the nested block handled it's exception we come back to here...
    26    v_dummy := log_trace('Procedure B''s Statement Section Continued');
    27  exception
    28    when others then
    29      -- We'll only get to here if an unhandled exception was raised
    30      -- either in the nested block or in procedure b's statement section
    31      v_dummy := log_trace('Procedure B''s Exception Section');
    32      raise;
    33* end;
    SQL> /
    Procedure created.
    SQL> exec b(123);
    PL/SQL procedure successfully completed.
    SQL> select * from code_trace;
    TXT
    Procedure B's Declaration Section
    Procedure B's Statement Section
    Nested Block Declaration Section
    Nested Block Statement Section
    No employee was found
    Nested Block Exception Section - Exception Handled
    Procedure B's Statement Section Continued
    7 rows selected.
    SQL> truncate table code_trace;
    Table truncated.
    SQL> exec b('ABC');
    BEGIN b('ABC'); END;
    ERROR at line 1:
    ORA-01722: invalid number
    ORA-06512: at "SCOTT.B", line 32
    ORA-06512: at line 1
    SQL> select * from code_trace;
    TXT
    Procedure B's Declaration Section
    Procedure B's Statement Section
    Nested Block Declaration Section
    Nested Block Statement Section
    Nested Block Exception Section - Exception Raised
    Procedure B's Exception Section
    6 rows selected.
    SQL>
    You can see from this that, very simply, the code that we expected may have an exception was able to either handle the exception and return to the outer execution block to continue execution, or if an unexpected exception occurred then it was able to be raised up to the outer exception section.
    6. User defined exceptions
    There are three sorts of 'User Defined' exceptions.  There are logical situations (e.g. business logic) where, for example, certain criteria are not met to complete a task, and there are existing Oracle errors that you wish to give a name to in order to capture them in the exception section.  The third is raising your own exception messages with our own exception numbers.  Let's look at the first one...
    Let's say I have tables which detail stock availablility and reorder levels...
    SQL> select * from reorder_level;
       ITEM_ID STOCK_LEVEL
             1          20
             2          20
             3          10
             4           2
             5           2
    SQL> select * from stock;
       ITEM_ID ITEM_DESC  STOCK_LEVEL
             1 Pencils             10
             2 Pens                 2
             3 Notepads            25
             4 Stapler              5
             5 Hole Punch           3
    SQL>
    Now, our Business has told the administrative clerk to check stock levels and re-order anything that is below the re-order level, but not to hold stock of more than 4 times the re-order level for any particular item.  As an IT department we've been asked to put together an application that will automatically produce the re-order documents upon the clerks request and, because our company is so tight-ar*ed about money, they don't want to waste any paper with incorrect printouts so we have to ensure the clerk can't order things they shouldn't.
    SQL> ed
    Wrote file afiedt.buf
      1  create or replace procedure re_order(p_item_id NUMBER, p_quantity NUMBER) is
      2    cursor cur_stock_reorder is
      3      select s.stock_level
      4            ,r.stock_level as reorder_level
      5            ,(r.stock_level*4) as reorder_limit
      6      from stock s join reorder_level r on (s.item_id = r.item_id)
      7      where s.item_id = p_item_id;
      8    --
      9    v_stock cur_stock_reorder%ROWTYPE;
    10  begin
    11    OPEN cur_stock_reorder;
    12    FETCH cur_stock_reorder INTO v_stock;
    13    IF cur_stock_reorder%NOTFOUND THEN
    14      RAISE no_data_found;
    15    END IF;
    16    CLOSE cur_stock_reorder;
    17    --
    18    IF v_stock.stock_level >= v_stock.reorder_level THEN
    19      -- Stock is not low enough to warrant an order
    20      DBMS_OUTPUT.PUT_LINE('Stock has not reached re-order level yet!');
    21    ELSE
    22      IF v_stock.stock_level + p_quantity > v_stock.reorder_limit THEN
    23        -- Required amount is over-ordering
    24        DBMS_OUTPUT.PUT_LINE('Quantity specified is too much.  Max for this item: '
                                     ||to_char(v_stock.reorder_limit-v_stock.stock_level));
    25      ELSE
    26        DBMS_OUTPUT.PUT_LINE('Order OK.  Printing Order...');
    27        -- Here goes our code to print the order
    28      END IF;
    29    END IF;
    30    --
    31  exception
    32    WHEN no_data_found THEN
    33      CLOSE cur_stock_reorder;
    34      DBMS_OUTPUT.PUT_LINE('Invalid Item ID.');
    35* end;
    SQL> /
    Procedure created.
    SQL> exec re_order(10,100);
    Invalid Item ID.
    PL/SQL procedure successfully completed.
    SQL> exec re_order(3,40);
    Stock has not reached re-order level yet!
    PL/SQL procedure successfully completed.
    SQL> exec re_order(1,100);
    Quantity specified is too much.  Max for this item: 70
    PL/SQL procedure successfully completed.
    SQL> exec re_order(2,50);
    Order OK.  Printing Order...
    PL/SQL procedure successfully completed.
    SQL>
    Ok, so that code works, but it's a bit messy with all those nested IF statements. Is there a cleaner way perhaps?  Wouldn't it be nice if we could set up our own exceptions...
    SQL> ed
    Wrote file afiedt.buf
      1  create or replace procedure re_order(p_item_id NUMBER, p_quantity NUMBER) is
      2    cursor cur_stock_reorder is
      3      select s.stock_level
      4            ,r.stock_level as reorder_level
      5            ,(r.stock_level*4) as reorder_limit
      6      from stock s join reorder_level r on (s.item_id = r.item_id)
      7      where s.item_id = p_item_id;
      8    --
      9    v_stock cur_stock_reorder%ROWTYPE;
    10    --
    11    -- Let's declare our own exceptions for business logic...
    12    exc_not_warranted EXCEPTION;
    13    exc_too_much      EXCEPTION;
    14  begin
    15    OPEN cur_stock_reorder;
    16    FETCH cur_stock_reorder INTO v_stock;
    17    IF cur_stock_reorder%NOTFOUND THEN
    18      RAISE no_data_found;
    19    END IF;
    20    CLOSE cur_stock_reorder;
    21    --
    22    IF v_stock.stock_level >= v_stock.reorder_level THEN
    23      -- Stock is not low enough to warrant an order
    24      RAISE exc_not_warranted;
    25    END IF;
    26    --
    27    IF v_stock.stock_level + p_quantity > v_stock.reorder_limit THEN
    28      -- Required amount is over-ordering
    29      RAISE exc_too_much;
    30    END IF;
    31    --
    32    DBMS_OUTPUT.PUT_LINE('Order OK.  Printing Order...');
    33    -- Here goes our code to print the order
    34    --
    35  exception
    36    WHEN no_data_found THEN
    37      CLOSE cur_stock_reorder;
    38      DBMS_OUTPUT.PUT_LINE('Invalid Item ID.');
    39    WHEN exc_not_warranted THEN
    40      DBMS_OUTPUT.PUT_LINE('Stock has not reached re-order level yet!');
    41    WHEN exc_too_much THEN
    42      DBMS_OUTPUT.PUT_LINE('Quantity specified is too much.  Max for this item: '
                                  ||to_char(v_stock.reorder_limit-v_stock.stock_level));
    43* end;
    SQL> /
    Procedure created.
    SQL> exec re_order(10,100);
    Invalid Item ID.
    PL/SQL procedure successfully completed.
    SQL> exec re_order(3,40);
    Stock has not reached re-order level yet!
    PL/SQL procedure successfully completed.
    SQL> exec re_order(1,100);
    Quantity specified is too much.  Max for this item: 70
    PL/SQL procedure successfully completed.
    SQL> exec re_order(2,50);
    Order OK.  Printing Order...
    PL/SQL procedure successfully completed.
    SQL>
    That's better.  And now we don't have to use all those nested IF statements and worry about it accidently getting to code that will print the order out as, once one of our user defined exceptions is raised, execution goes from the Statements section into the Exception section and all handling of errors is done in one place.
    Now for the second sort of user defined exception...
    A new requirement has come in from the Finance department who want to have details shown on the order that show a re-order 'indicator' based on the formula ((maximum allowed stock - current stock)/re-order quantity), so this needs calculating and passing to the report...
    SQL> ed
    Wrote file afiedt.buf
      1  create or replace procedure re_order(p_item_id NUMBER, p_quantity NUMBER) is
      2    cursor cur_stock_reorder is
      3      select s.stock_level
      4            ,r.stock_level as reorder_level
      5            ,(r.stock_level*4) as reorder_limit
      6            ,(((r.stock_level*4)-s.stock_level)/p_quantity) as finance_factor
      7      from stock s join reorder_level r on (s.item_id = r.item_id)
      8      where s.item_id = p_item_id;
      9    --
    10    v_stock cur_stock_reorder%ROWTYPE;
    11    --
    12    -- Let's declare our own exceptions for business logic...
    13    exc_not_warranted EXCEPTION;
    14    exc_too_much      EXCEPTION;
    15  begin
    16    OPEN cur_stock_reorder;
    17    FETCH cur_stock_reorder INTO v_stock;
    18    IF cur_stock_reorder%NOTFOUND THEN
    19      RAISE no_data_found;
    20    END IF;
    21    CLOSE cur_stock_reorder;
    22    --
    23    IF v_stock.stock_level >= v_stock.reorder_level THEN
    24      -- Stock is not low enough to warrant an order
    25      RAISE exc_not_warranted;
    26    END IF;
    27    --
    28    IF v_stock.stock_level + p_quantity > v_stock.reorder_limit THEN
    29      -- Required amount is over-ordering
    30      RAISE exc_too_much;
    31    END IF;
    32    --
    33    DBMS_OUTPUT.PUT_LINE('Order OK.  Printing Order...');
    34    -- Here goes our code to print the order, passing the finance_factor
    35    --
    36  exception
    37    WHEN no_data_found THEN
    38      CLOSE cur_stock_reorder;
    39      DBMS_OUTPUT.PUT_LINE('Invalid Item ID.');
    40    WHEN exc_not_warranted THEN
    41      DBMS_OUTPUT.PUT_LINE('Stock has not reached re-order level yet!');
    42    WHEN exc_too_much THEN
    43      DBMS_OUTPUT.PUT_LINE('Quantity specified is too much.  Max for this item: '
                                  ||to_char(v_stock.reorder_limit-v_stock.stock_level));
    44* end;
    SQL> /
    Procedure created.
    SQL> exec re_order(2,40);
    Order OK.  Printing Order...
    PL/SQL procedure successfully completed.
    SQL> exec re_order(2,0);
    BEGIN re_order(2,0); END;
    ERROR at line 1:
    ORA-01476: divisor is equal to zero
    ORA-06512: at "SCOTT.RE_ORDER", line 17
    ORA-06512: at line 1
    SQL>
    Hmm, there's a problem if the person specifies a re-order quantity of zero.  It raises an unhandled exception.
    Well, we could put a condition/check into our code to make sure the parameter is not zero, but again we would be wrapping our code in an IF statement and not dealing with the exception in the exception handler.
    We could do as we did before and just include a simple IF statement to check the value and raise our own user defined exception but, in this instance the error is standard Oracle error (ORA-01476) so we should be able to capture it inside the exception handler anyway... however...
    EXCEPTION
      WHEN ORA-01476 THEN
    ... is not valid.  What we need is to give this Oracle error a name.
    This is done by declaring a user defined exception as we did before and then associating that name with the error number using the PRAGMA EXCEPTION_INIT statement in the declaration section.
    SQL> ed
    Wrote file afiedt.buf
      1  create or replace procedure re_order(p_item_id NUMBER, p_quantity NUMBER) is
      2    cursor cur_stock_reorder is
      3      select s.stock_level
      4            ,r.stock_level as reorder_level
      5            ,(r.stock_level*4) as reorder_limit
      6            ,(((r.stock_level*4)-s.stock_level)/p_quantity) as finance_factor
      7      from stock s join reorder_level r on (s.item_id = r.item_id)
      8      where s.item_id = p_item_id;
      9    --
    10    v_stock cur_stock_reorder%ROWTYPE;
    11    --
    12    -- Let's declare our own exceptions for business logic...
    13    exc_not_warranted EXCEPTION;
    14    exc_too_much      EXCEPTION;
    15    --
    16    exc_zero_quantity EXCEPTION;
    17    PRAGMA EXCEPTION_INIT(exc_zero_quantity, -1476);
    18  begin
    19    OPEN cur_stock_reorder;
    20    FETCH cur_stock_reorder INTO v_stock;
    21    IF cur_stock_reorder%NOTFOUND THEN
    22      RAISE no_data_found;
    23    END IF;
    24    CLOSE cur_stock_reorder;
    25    --
    26    IF v_stock.stock_level >= v_stock.reorder_level THEN
    27      -- Stock is not low enough to warrant an order
    28      RAISE exc_not_warranted;
    29    END IF;
    30    --
    31    IF v_stock.stock_level + p_quantity > v_stock.reorder_limit THEN
    32      -- Required amount is over-ordering
    33      RAISE exc_too_much;
    34    END IF;
    35    --
    36    DBMS_OUTPUT.PUT_LINE('Order OK.  Printing Order...');
    37    -- Here goes our code to print the order, passing the finance_factor
    38    --
    39  exception
    40    WHEN exc_zero_quantity THEN
    41      DBMS_OUTPUT.PUT_LINE('Quantity of 0 (zero) is invalid.');
    42    WHEN no_data_found THEN
    43      CLOSE cur_stock_reorder;
    44      DBMS_OUTPUT.PUT_LINE('Invalid Item ID.');
    45    WHEN exc_not_warranted THEN
    46      DBMS_OUTPUT.PUT_LINE('Stock has not reached re-order level yet!');
    47    WHEN exc_too_much THEN
    48      DBMS_OUTPUT.PUT_LINE('Quantity specified is too much.  Max for this item: '
                                  ||to_char(v_stock.reorder_limit-v_stock.stock_level));
    49* end;
    SQL> /
    Procedure created.
    SQL> exec re_order(2,0);
    Quantity of 0 (zero) is invalid.
    PL/SQL procedure successfully completed.
    SQL>
    Lastly, let's look at raising our own exceptions with our own exception numbers...
    SQL> ed
    Wrote file afiedt.buf
      1  create or replace procedure re_order(p_item_id NUMBER, p_quantity NUMBER) is
      2    cursor cur_stock_reorder is
      3      select s.stock_level
      4            ,r.stock_level as reorder_level
      5            ,(r.stock_level*4) as reorder_limit
      6            ,(((r.stock_level*4)-s.stock_level)/p_quantity) as finance_factor
      7      from stock s join reorder_level r on (s.item_id = r.item_id)
      8      where s.item_id = p_item_id;
      9    --
    10    v_stock cur_stock_reorder%ROWTYPE;
    11    --
    12    exc_zero_quantity EXCEPTION;
    13    PRAGMA EXCEPTION_INIT(exc_zero_quantity, -1476);
    14  begin
    15    OPEN cur_stock_reorder;
    16    FETCH cur_stock_reorder INTO v_stock;
    17    IF cur_stock_reorder%NOTFOUND THEN
    18      RAISE no_data_found;
    19    END IF;
    20    CLOSE cur_stock_reorder;
    21    --
    22    IF v_stock.stock_level >= v_stock.reorder_level THEN
    23      -- Stock is not low enough to warrant an order
    24      [b]RAISE_APPLICATION_ERROR(-20000, 'Stock has not reached re-order level yet!');[/b]
    25    END IF;
    26    --
    27    IF v_stock.stock_level + p_quantity > v_stock.reorder_limit THEN
    28      -- Required amount is over-ordering
    29     

    its nice article, have put up this one the blog
    site,Nah, I don't have time to blog, but if one of the other Ace's/Experts wants to copy it to a blog with reference back to here (and all due credit given ;)) then that's fine by me.
    I'd go for a book like "Selected articles by OTN members" or something. Does anybody have a list of links of all those mentioned articles?Just these ones I've bookmarked...
    Introduction to regular expressions ... by CD
    When your query takes too long ... by Rob van Wijk
    How to pipeline a function with a dynamic number of columns? by ascheffer
    PL/SQL 101 : Exception Handling by BluShadow

  • How to Use WACOM Tablet on PS and AI

    Have just purchased a used WACOM Intuos tablet and just getting started using it.
    Was sad to see that there is no forum here for Illustrator as I'm trying to solve a problem using my tablet to draw in AI.  Simply put when I'm using a pencil or a brush to draw or paint, it seems AI is modifying the path after I lay it down.  For what reason, I have no idea.  So I don't get what I draw or paint the way I laid it down.  I've run into avid tablet users on AI so maybe there is some adjustment to make it usable w/o this problem?
    Anyone have any ideas or can you direct me to another forum?  Any thoughts greatly appreciated.
    Now, has anyone drawn or painted in PS?  Would this be an easier prospect since it's raster based?  (suspect that would eliminate the problem of my lines being modified)  I will keep playing with it and maybe that's my solution, just stick with PS.  I used the tablet on Corel PainterX last night with more predictable results.
    Many thanks for your ideas as I learn this new tool.
    Mike

    I've been trying to do this myself with some success.
    Be as forgiving of the tool as you need to be forgiving of yourself. This is not as fast as using pencil and paper, pen and ink. It is not as messy either. With the computer you can quickly erase or take back a portion of a stroke. Look into brush options in both AI and PS. You may find some brushes that better support your style.
    As for getting quick results with a tablet, there is a tendency with both AI and PS to digitize a stroke, like what old digitizers did in other software (AutoCAD, etc.) If you want more capabilities, you might consider spending more on a tablet and stylus. Sensitivity or lack or it seems to be an issue with tablets. The sensitivity is less than we want it to be. Slow down and let the computer processor keep up with the complexity of your stroke. You may also benefit from working larger, then decreasing the size of the final image to something that satisfies your design intent. For example, if your final image size is 8.5X11 inches, work twice as large and scale the final image down to something useful once you are done.
    Beware dialing up PS files to too high in size or resolution or this can slow a computer or make a file that is difficult to manage and keep due to its size. There are lots of brush types you can create, too, if you look into the capabilities of these "power tools."
    Have fun and you will master this tool like you have mastered so many others. 

  • IPhoto won't open after a reinstall.....

    You'll have to excuse my lack of specific Mac details, as I'm relatively new on the system. I've got a Mac mini, had it for about 8 months, and the system froze up and would not restart. I talked to an associate in an Apple store, told me to reinstall the discs, holding down ctrl C, i believe. (some function button and "c"). Everything was reinstalled with no glitches, with the exception of iPhoto.
    It is present in the finder, although the icon has changed to the general application icon of the pencil, paintbrush, and ruler formed A. When I double click on it, it opens up briefly in the toolbar, but then disappears. everytime I do this, it repeats. I can open up the photos in iPhoto in a preview screen, but nothing within iPhoto. I've tried repairing the disc utilities. I've tried dragging it down to the toolbar, which when I do this, it stays, but won't open anything.
    Sorry for my wordiness. Just trying to describe as much as possible, due to my lack of mac savviness.
    Thanks for any help or suggestions.
    Mini    

    I ran disk utility as it was restarting.
    I can't imagine what this means. Disk Utility can't run until the computer has started.
    After it is completed, it tells me that 1HFS volume checked, No repiars were necessary.
    Good — that's what you want to see.
    Should I run the verify disk option now...
    Verifying the disk is pointless, now and always, since it carries out the same diagnostic tests as the Repair Disk function, but doesn't repair anything that it finds to be out of order.
    ...or just let the restart resume?
    Again, I can't imagine what you mean by this. When you quit Disk Utility, you are returned to the Installer. If you quit the installer, your computer restarts. I don't see how you could possibly have interrupted the restart and then performed any other operation.

  • How can I restore missing icons?

    The Skype icon has been replaced with the default paper, pencil, paintbrush icon. It shows this way in the dock and when i search for it in the finder. The program still works normally. If I duplicate the app, the Skype icon shows properly on the dupe version. If I then delete the old one and then rename the copy to "Skype" instead of "Skype copy," then it returns to the missing icon. I Googled this issue and everyone seems to have a different answer. I ran disk permission repair and that did nothing. I'm weary of doing anything with the terminal unless I know for sure it is a fix. Thanks.
    iMac 27-inch, late 2013
    3.2 GHz Intel Core i5
    8 GB 1600 MHz DDR3

    Hello killheroes,
    So if you duplicate the Skype app the correct icon is seen, but if you rename it back to Skype you lose the icon again?
    What happens if you copy the correct icon into the renamed Skype?
    OS X Yosemite: Create custom icons for files or folders
    Use an icon from another file or folder
    Select the file or folder whose icon you want to use, then choose File > Get Info.
    At the top of the Info window, click the icon, then choose Edit > Copy.
    Select the other file or or folder, then choose File > Get Info.
    Click the icon, then choose Edit > Paste.
    Restore the original icon for an item
    Select the file or folder, then choose File > Get Info. 
    At the top of the Info window, select the custom icon, then choose Edit > Cut.
    Best,
    Nubz

  • Logo blues

    OK, this is my first time doing this. Well, i'm doing a logo and right now i'm basically having a few problems, mainly dealing with actually carrying out the process of making my sketch some what of a reality on the computer. Heres the problem I have a great idea for my logo its all sketched on paper and looks really nice and stuff, my concept is set, but im having problems drawing it in illustrator, I dont have a tablet so im forced to use my mouse. One of the main component of my logo are three stick figures joined  together( it may sound kinda too much for a logo, but thats what i want), what I want to know is what would be the best tool to use to draw my stick figure, should i use a brush, the pencil tool, the pen tool, the blob brush or the line segment? im really not too sure what to use, by the way im completely new to illustrator in general, i downloaded a trial a few days ago but i have been doing a few tutorials. I was experimenting with brushes, so one more thing I would like to know is what would be the best brush style to give my stick people a sort of professional and finished look but still have a sort of underplayed sketch. I thank any one that responds to this post.

    Sweetnessa,
    I have a great idea for my logo its all sketched on paper and looks really nice and stuff, my concept is set,
    You may scan the drawn logo File>Place it in the bottom Layer and lock it, and then trace the strokes with the Pen Tool, as mentioned, using a small/moderate Stroke Weight. You may reduce the transparency of the new strokes (Window>Transparency (panel) setting Opacity  < 100, when you have placed the first Anchor Point); this will allow you to see through it for greater accuracy. You may (create and) apply brushes later for enhanced appearance.
    Click for straight segments and corners, ClickDrag for curved segments, also hold Shift for specific angles (such as horizontal/vertical); in the latter case, do not let go until you are done with each Anchor Points. Among the obvious positions for Anchor Points are transitions between curved and straight segments, positions where the direction is known (such as horizontal/vertical), and positions on either side of points where the curvature switches.
    The initial click will determine the (initial) position of the current Anchor Point, and you may adjust the curvature by moving the mouse and thereby the Handles, and you may adjust the position of the Anchor Points by pressing the Space key while moving the mouse.
    Afterwards, and after deselecting the object, you may adjust each Anchor Point and each Handle (set) by ClickHolding with the Direct Selection Tool (for Handle, first select the Anchor Point); initially, you can select the Anchor Point by ClickDragging over it, avoiding the others.

  • Item overview line number

    Hi all,
    I have a doubt regarding the line item number in P.Req or P.O or any
    other document..
    To make it more clear..Is it possible to change or configure the line
    item number such as 10, 20, 30 etc to 1, 2, 3 etc...
    10. Pencils
    20. Pen
    30. Eraser
    I want to make it like..
    1. Pencils
    2. Pen
    3. Eraser
    If yes, could you please explain where i should make these settings??
    Thanking you
    Sonu
    <b></b>

    Hello Sonu,
    Pls goto the below path to change
    1.IMG-Material Management-Purchasing-Purchase Order-Define Document Types
    3rd Column says "ItmInt." change the value to 1 from 10.
    2.IMG-Material Management-Purchasing-Purchase Requistion-Define Document Types
    I think this helps you,
    Rgds,
    Balaji.

  • Acrobat Scanning

    Hi,
    I have been experimenting with different scanning settings in Acrobat 9.  I have about a 60 page document that is B&W.  However, I wrote on the first page with pencil and colored pen.  Going from B&W to gray to color does not increase the file size significantly.  If I scan in color, does Acrobat recognize that a page is B&W and store it as B&W with JBIG2 compression, or is it stored in color and just use a compression algorithm that produces results close to B&W?
    Thanks,
    David

    Hi,
    I realize that Acrobat uses a TWAIN driver to acquire the image.  However, Acrobat process, compresses, and stores the image as a PDF.  I am just wondering if it processes each page - each image - intelligently enough to know the color depth and store and compress based on what is scanned, rather than just the settings used.  For example, I scan a document in color, but Acrobat only stores the pages in color that have color, and pages that are B&W are stored in B&W?
    Thanks,
    David

  • Tidy up scanned hand drawings

    Dear forum,
    I have several hundred TIF images at 1200 dpi+ which represent scans of hand drawings on parchment paper using pencil or ink-pen (.2mm or thereabouts) of 4000 year old cuneiform documents. The drawings were made over an extended period of time, the paper varied, and ultimately, the scans reflect this in that some lines are darker than others and there are occasional 'smudgy' areas etc.
    What I would like to do prior to publication is to sharpen the images and make them consistent across the repertoire as black on white background.
    I'm not well versed in the details of how various Photoshop (CS5, Mac) commands do what they do, but I've found several that seem like they might get me where I want to go: Levels (Auto?), Threshold, Shadows/Highlights... and there may be more that I don't know about.
    I'm hoping someone can point me in the ideal direction for this sort of task, which I'd like to automate to run over a directory of images if possible. At the same time, I might have to change the dpi and output format of the new images.
    I've attached a sample. In this case, the drawing is fairly clear (not much 'grey' background) but the lines are not as black and sharp as they could be.
    Many thanks for any help that anyone can offer!
    Best
    KF

    Thanks to everyone who offered suggestions on how to go about this. I finally came up with the following method, which may not be the most efficient, but it works...
    Tidy up the drawings using pen (fill in unclosed loops) and eraser (remove overshot of original pen).
    Add new adjustment layer: levels. Manually adjust to remove mid-tones and get a reasonably but not over-dark image.
    Save.
    Apply magic want to background (i.e. 'white' area).
    Select inverse.
    Refine edges with smooth set to 20, output to layer mask.
    Add new layer, fill with white; move to just above background layer.
    Add new layer, fill with black; move the layer mask from above to this layer.
    Move the levels adjustment layer to just above background layer.
    Hide background.
    Flatten image.
    Save in 1200dpi output directory.
    Change image size to 600dpi.
    Save in 600dpi output directory.
    I saved this as an action, with pause at the levels adjustment layer, since it seems best to adjust for each image. I've also found that since it is best to touch up all the drawings individually, I may as well run this action right afterwards, rather than as a big batch job.
    Hope this may be helpful to someone else.
    Best
    KF

  • Delayed live screen drawing with tools in Photoshop. Video driver update?

    Delayed live screen drawing with tools in Photoshop CS5 on my iMac running system 10.6.7.
    Hi there. Recently, I've been having issues with the tools. There's a distinct DELAY in the live drawing. For example, if I open a random image, take the pencil, paintbrush, or even eraser tool, and I draw a large line across the image, I don't see anything. If I zoom in or out 1 click, I see the line. If I draw ANOTHER line, same thing - I need to zoom in or out to see it. With all of the tools. I've never had this issue before and it's incredibly frustrating (that might be an understatement as you can imagine - I use PS daily as I am a full-time designer.) Any ideas or solutions? I've already TRASHED my preferences and reset the tool. If it IS a driver issue (which is weird, because this issue just recently started happening) I contacted the driver manufacturer (AMD) and was told:
    "Unfortunately, Apple does not authorize us to release drivers for their products.
    All drivers are provided to Apple who then customize and release them to their customers.
    You will need to contact Apple to obtain the most current drivers for your product."

    You are correct - only Apple can deliver display drivers to you.  That's what you get with a Mac as Apple wants to be your "one stop shop" for support..
    Just curious:  Are you painting with large brushes and very small Spacing values?  That can cause some delay, though it normally catches up on its own - you don't have to do anything to make it happen.
    Have you tried disabling OpenGL Drawing in your Photoshop Edit - Preferences - Performance menu.  Restart Photoshop after making that change and before testing.
    -Noel

  • Going from 10.4.3 to 10.4.4 - PROBLEM

    Hey All... listen to this and tell me what you think.
    I recently purchased Tiger to put on my PowerBook G4 1.5GHz which originally had 10.3.9 (Jaguar) on it. When I installed Tiger, it went and found all the new software updates available including 10.4.4 because the disc I had purchased came with 10.4.3. While Software Update was busy downloading and installing of the updates, I took the time to customize all the settings in Finder/Safari/et cetera as well as System Preferences to my liking. Just to make it clearer I did things such as:
    -Turned Magnification & Auto-Hide on for the Finder as well as made it smaller.
    -Made it so the Finder always displays the window in Column View
    -Made it so the Finder displays "Computer" as one of the items on the sidebar.
    -et cetera...
    Once all the software updates had finished downloading and installing, it prompted me for a reboot. The PowerBook shut down and restarted, but once it loaded back up again ALL of my settings that I had previously set up were gone and EVERYTHING returned to how it was "default." That includes, all the system prefences settings, the finder settings, the safari prefrences, everything I'd customized.
    The other curious thing is that normally when you open up the Finder, there are specific logos next to the "Documents," "Movies," "Music," and "Pictures" folders that help describe what they are. (e.g. A picture of a piece of paper to the right of "Documents," the letter A made out of a pencil, ruler and pen next to "Applications." Well once I rebooted, those logos disappeared and all that is next to Documents, Movies, Music and Pictures, is just a plain old Folder Icon. Not that this is a problem, but what is going on?
    I thought maybe it did all this because I upgraded to 10.4.4, from 10.4.3, but my settings never did that as I upgraded to further builds on Jaguar.
    I set to the task of re-customizing all of my preferences and rebooted the machine. When it booted up, all my settings were AGAIN erased.
    Suggestions! I don't want to continue "moving in" to Tiger if I'm just going to keep getting set back, I'm seriously almost tempted to go back to Jaguar.
    I thought maybe the install was bad, so I erased the disc and did a clean install of Tiger again- same problem.
    In peering around some other threads, I found a standalone update for 10.4.4 off of the Apple Mac OS X downloads page. When I scrolled down to the bottom and looked at the left, I clicked on "Mac OS X 10.4.4 Combined Update" as opposed to "Mac OS X 10.4.4 Update" (Not sure of the difference) - DLed and installed. Still no help.
    Help!

    Hi Chris,
    first of all: WELCOME TO THE DISCUSSIONS!
    Using the Combo update is a very good idea and is suggested with all updates. Do not forget to Repair permissions before and after an update!
    Working on a computer while it is updating the system is probably the second most inappropriate action you can do (right after pulling the plug during installation). Who knows what was damaged...
    I suggest you zap the PRAM as a first step. Then run Cocktail (or TigerCacheCleaner or Onyx) and clean the caches: MacOS X 10.3/10.4: System maintenance.

  • No Printer Setup Utility

    Somehow I've accidentally deleted, or otherwise lost the printer setup utility that should be in my utilities folder. There is a file called Printer Setup Utility in the Utilities folder, but it's only 650KB, which tells me that's not it. There's also a strange icon representing it (two pieces of paper, a paintbrush, a pen [looks like an Appleworks icon or something]). Basically, I have no print center. Is there away of reinstalling this application without having to reinstall Tiger completely? I've reinstalled the printer drivers with the custom install option, but I can't figure out a way to install the actually printer setup utility application. Any help would be great.

    I think this will do the trick:
    Restoring Lost OS X Files
    If you erase or otherwise "lose" an OS X system application or utility (such as Mail or Disk Utility, for example) you can restore them without having to reinstall OS X.
    Download the shareware utility Pacifist. Read the documentation. Use Pacifist to extract a fresh copy of the missing application from the file archives on your OS X Installer disc. The file archives are usually found on the installer disc in the /System/Installations/ folder.
    After restoring the application you need to reinstall the OS X Combo Updater for the version of OS X you currently have installed. This assures the new copy of the application is updated to the current version.
    Lastly, it's a good idea to repair permissions.
    Mac Pro 2.66 Ghz; MacBook Pro C2D 2.33 Ghz; MacBook Pro 2.16 Ghz   Mac OS X (10.4.8)   Intel iMac C2D 17 "; iBook G3 800 Mhz; 30 GB iPod Video (Black); iPod Nano 2 GB

Maybe you are looking for

  • Cannot send email from Verizon to a specific domain using the web UI

    I'm trying to send an email to a specific address on a domain I own from a Verizon account using the web UI. Whenever I click send, a popup appears saying "Your e-mail contains the following invalid e-mail addresses:" followed by the email address. I

  • Ship Complete at the order header level

    Hi all, how do we configure the system to force a sales order to be shipped complete? I think that we have two requirements: 1) The instructions from some of our customers is that all the item / schedule lines on a sale order MUST be shipped at the s

  • 2 different expresscard/34s with 2 firewire 800 ports are not fully recognized on new macbook pro 17" under lion

    We have 2 expresscard/34s, a Belkin ec1394b2 and a Startech "FireWire 800 ExpressCard". Both are "reported" to suppport OS X but neither does more than show "PCI FireWire 800 ExpressCard" in the available interfaces list in Network Preferences with a

  • Problems Starting SAP WAS

    Hi, We have a fresh installation of a Central Instance (ABAP, Unicode on Oracle) and a Database Instance. Both installations ended successfully, but when we try to get the server running to install a Java AddIn for ABAP, we get these errors: SAP Basi

  • Production Order (Control Key)

    Hi All, Scenario: At present after the MRP run, a planned order is created for materials which are to be manufactured in-house & it is then converted to a production order. A control key is being automatically selected for the operation. I would like