Privilege for creating a View from a Stored Procedure

Hi,
                     I need to create a view from a procedure. I could do it from an anonymous block whereas I am unable to do that from a Stored Procedure. Should I need a specific privilege for performing this operation? If so what would be the reason behind it? Will that privilege be given in production databases?
Code to replicate:
CREATE TABLE t11 AS SELECT * FROM DUAL;
CREATE OR REPLACE PROCEDURE p_etl_test_view
AS
BEGIN
   EXECUTE IMMEDIATE 'CREATE OR REPLACE VIEW v_t11 AS SELECT * FROM t11';
END;
PROCEDURE P_ETL_TEST_VIEW compiled
Elapsed: 00:00:00.131
BEGIN
   EXECUTE IMMEDIATE 'CREATE OR REPLACE VIEW v_t11 AS SELECT * FROM t11';
END;
anonymous block completed
Elapsed: 00:00:00.069
BEGIN
   p_etl_test_view;
END;
Error starting at line 13 in command:
BEGIN
   p_etl_test_view;
END;
Error report:
ORA-01031: insufficient privileges
ORA-06512: at "OCCSS_ENTMT_HK_DEV_01.P_ETL_TEST_VIEW", line 4
ORA-06512: at line 2
01031. 00000 -  "insufficient privileges"
*Cause:    An attempt was made to change the current username or password
           without the appropriate privilege. This error also occurs if
           attempting to install a database without the necessary operating
           system privileges.
           When Trusted Oracle is configure in DBMS MAC, this error may occur
           if the user was granted the necessary privilege at a higher label
           than the current login.
*Action:   Ask the database administrator to perform the operation or grant
           the required privileges.
           For Trusted Oracle users getting this error although granted the
           the appropriate privilege at a higher label, ask the database
           administrator to regrant the privilege at the appropriate label.
Elapsed: 00:00:00.100
The privileges I am having:
SELECT   *
    FROM dba_sys_privs
   WHERE grantee = 'OCCSS_ENTMT_HK_DEV_01'
      OR grantee IN (SELECT granted_role
                       FROM dba_role_privs
                      where grantee = 'OCCSS_ENTMT_HK_DEV_01')
ORDER BY 1;
GRANTEE
PRIVILEGE
ADMIN_OPTION
EXP_FULL_DATABASE
ADMINISTER RESOURCE MANAGER
NO
EXP_FULL_DATABASE
ADMINISTER SQL MANAGEMENT OBJECT
NO
EXP_FULL_DATABASE
BACKUP ANY TABLE
NO
EXP_FULL_DATABASE
CREATE SESSION
NO
EXP_FULL_DATABASE
CREATE TABLE
NO
EXP_FULL_DATABASE
EXECUTE ANY PROCEDURE
NO
EXP_FULL_DATABASE
EXECUTE ANY TYPE
NO
EXP_FULL_DATABASE
READ ANY FILE GROUP
NO
EXP_FULL_DATABASE
RESUMABLE
NO
EXP_FULL_DATABASE
SELECT ANY SEQUENCE
NO
EXP_FULL_DATABASE
SELECT ANY TABLE
NO
OCCSS_ENTMT_HK_DEV_01
CREATE DATABASE LINK
NO
OCCSS_ENTMT_HK_DEV_01
CREATE TABLE
NO
OCCSS_ENTMT_HK_DEV_01
DEBUG CONNECT SESSION
NO
OCCSS_ENTMT_HK_DEV_01
SELECT ANY DICTIONARY
NO
SCB_SCHEMA_ROLE
ALTER SESSION
NO
SCB_SCHEMA_ROLE
CREATE CLUSTER
NO
SCB_SCHEMA_ROLE
CREATE DIMENSION
NO
SCB_SCHEMA_ROLE
CREATE INDEXTYPE
NO
SCB_SCHEMA_ROLE
CREATE JOB
NO
SCB_SCHEMA_ROLE
CREATE MATERIALIZED VIEW
NO
SCB_SCHEMA_ROLE
CREATE OPERATOR
NO
SCB_SCHEMA_ROLE
CREATE PROCEDURE
NO
SCB_SCHEMA_ROLE
CREATE SEQUENCE
NO
SCB_SCHEMA_ROLE
CREATE SESSION
NO
SCB_SCHEMA_ROLE
CREATE SYNONYM
NO
SCB_SCHEMA_ROLE
CREATE TABLE
NO
SCB_SCHEMA_ROLE
CREATE TRIGGER
NO
SCB_SCHEMA_ROLE
CREATE TYPE
NO
SCB_SCHEMA_ROLE
CREATE VIEW
NO

BoopathyVasagam wrote:
Thank you for your answer. So should I issue the below statement? (Since I dont have dba privs i couldn't test this)
GRANT CREATE VIEW to P_ETL_TEST_VIEW;
I doubt that above will prevent the error from being thrown.
prior to running anonymous block again; just do as below
SET ROLE NONE;
doing so should result in same error being thrown when invoking
BEGIN 
   p_etl_test_view; 
END; 

Similar Messages

  • Create a View, function or stored procedure for query?

    Hi All,
    I like to know how I can create a view or function for the query below. If its going to be a function or stored procedure will I be able to union it with another view?
    DECLARE
    @BegDate DATE,
    @EndDate DATE
    SELECT
    @BegDate = MIN(vl.VoidStartDate),
    @EndDate = MAX(vl.LetDate)
    FROM #VoidLoss vl
    ;WITH d(d) AS (
    SELECT TOP (DATEDIFF(dd, @BegDate, @EndDate))
    DATEADD(dd, ROW_NUMBER() OVER (ORDER BY (SELECT NULL)) -1, @BegDate)
    FROM sys.all_objects o
    ), cal AS (
    SELECT
    d.d,
    MONTH(d.d) AS m,
    YEAR(d.d) AS y
    FROM d
    SELECT
    vl.History_IND,
    vl.PropCode,
    vl.VoidCategory,
    vl.ControlGroup,
    CASE WHEN vl.VoidStartDate < MIN(cal.d) THEN MIN(cal.d) ELSE vl.VoidStartDate END AS VoidStartDate,
    CASE WHEN vl.LetDate > MAX(cal.d) THEN MAX(cal.d) ELSE vl.LetDate END AS LetDate,
    vl.MarketRent,
    DATENAME(mm, CAST('1900-' + CAST(cal.m AS VARCHAR(2)) + '-1' AS DATE)) AS [Month],
    cal.y AS [Year],
    COUNT(*) AS DaysVoid,
    COUNT(*) * vl.MarketRent AS VoidLoss
    FROM
    #VoidLoss vl
    JOIN cal
    ON cal.d BETWEEN DATEADD(dd, 1, vl.VoidStartDate) AND vl.LetDate
    GROUP BY
    vl.History_IND,
    vl.PropCode,
    vl.VoidCategory,
    vl.ControlGroup,
    vl.VoidStartDate,
    vl.LetDate,
    vl.MarketRent,
    cal.m,
    cal.y
    ORDER BY
    vl.History_IND,
    vl.PropCode,
    vl.VoidStartDate
    Thanks

    A view or an inline-function is a single query, so this part does not fit in:
    DECLARE
    @BegDate DATE,
    @EndDate DATE
    SELECT
    @BegDate = MIN(vl.VoidStartDate),
    @EndDate = MAX(vl.LetDate)
    FROM #VoidLoss vl
    And you cannot have it multi-statement function either, since you cannot refer to temp tables in such a function. In any case, using a multi-statement function in a view definition or nest it in another function definition is likely to be a performance disaster.
    The sole alternative that remains as long as you have the temp table is a stored procedure. You cannot use a stored procedure in a view or a function.
    Erland Sommarskog, SQL Server MVP, [email protected]

  • How to view the returned data from a stored procedure in TOAD?

    Hi,
    I created ref cursor in the stored procedure to return data. The stored procedure works fine, just want to view the result in TOAD. The BEGIN... EXEC... END can execute the stored procedure, but how to make the result display?
    Thanks!

    Right click the editor and choose
    "Prompt For Substitution Variables".
    Run for example the following code:
    DECLARE
    PROCEDURE p (cur OUT sys_refcursor)
    AS
    BEGIN
    OPEN cur FOR
    SELECT *
    FROM DUAL;
    END p;
    BEGIN
    p (:cur);
    END;
    The result will display in Toad's Data Grid!
    Regards Michael

  • Best Practice for creating Excel report from SSIS.

    I have a requirement to create an Excel report on a daily basis which pulls data from SQL. I have attempted to resolve this by creating a stored procedure to save the results in SQL, a template in Excel to hold the graphs & pivot tables and an SSIS package
    to copy the data to the template.
    Problem 1: When the data turns up in Excel it is saved as text rather than numbers.
    Problem 2: When the data turns up in Excel it appends the data rather than overwriting it.
    I resolved problem 1 by having another sheet which converts the text to numbers (=int(sheet1!A1))
    I resolved problem 2 by adding some VB script to my SSIS package which clears the existing cells before copying the data
    The job runs fine, however when I schedule the job to run overnight it complains "System.UnauthorizedAccessException: Retrieving the COM class factory for component with CLSID". A little googling tells me that running the client side commands in
    my vb script (workSheet1.Range("A2:F9999").Clear(), workBook.Save(), workBook.Close() etc) from a server side task is bad practice.
    So, I am left wondering how people usually get around this problem; copy a SQL table into an existing Excel file and overwrite the data, without having the numbers turn up as text. My requirements are that the report must display pivot charts with selectable
    options and be automatically updated overnight.
    Help appreciated,
    Bish.
    Office 2013 on my PC, Office 2010 on the server, Windows Server 2008R2 Enterprise, SQL Server 2008R2.

    I think that the best practice in case like this is to Link an excel file to a view or directly to a table. So you don't have to struggle with changing template, with overnight packages, etc. If the data are too much complex and the desiderate too excessive
    then I tend to create a Cube and that's it...dashboard, graph and everyone is happy. In your case if the request is not too much try to don't use SSIS but directly build a view and point directly on SQL.
    SSIS is really strong for the ETL, to run some stored procedure too heavy, to use a cut time scheduled, etcetera , etcetera, etcetera...I love it. But sometimes we need to find the easier solutions...
    I hope this post helped you

  • Insufficient Privileges when create materialized view as user system

    If I login as system (connect sys/****@DevDB) and try to create a materialized view for another schema (e.g. XDCONTROLDB), I get the insufficient privileges error. If I login as sys as sysdba then I can create successfully.
    I have searched some ariticles in Google and grant create any snapshot, create any table, create any view, global query rewrite, select any table system privileges to system but still get the same error.
    Any other privileges I need to grant to system?
    Cheers
    below is a sample script to create the view which get the error:
    CREATE MATERIALIZED VIEW XDControlDB."XDTest1" PCTFREE 10
    PCTUSED 0 MAXTRANS 255
    STORAGE ( INITIAL 64K NEXT 0K MINEXTENTS 1 MAXEXTENTS
    2147483645 PCTINCREASE 0)
    TABLESPACE "USERS"
    BUILD IMMEDIATE
    REFRESH COMPLETE START WITH sysdate NEXT sysdate + 1/24
    ENABLE QUERY REWRITE AS
    SELECT * From XDControlDB.RiskInstance;
    Message was edited by:
    user500168
    Message was edited by:
    user500168

    Thanks for your reply. After I grant privileges to system, I login as system and try to create the view as below which I get the insufficient privileges error:
    CREATE MATERIALIZED VIEW XDControlDB."XDTest1" PCTFREE 10
    PCTUSED 0 MAXTRANS 255
    STORAGE ( INITIAL 64K NEXT 0K MINEXTENTS 1 MAXEXTENTS
    2147483645 PCTINCREASE 0)
    TABLESPACE "USERS"
    BUILD IMMEDIATE
    REFRESH COMPLETE START WITH sysdate NEXT sysdate + 1/24
    ENABLE QUERY REWRITE AS
    SELECT 1 From XDControlDB.RiskInstance;
    As you can see, I try to create the view under a schema called 'XDCONTROLDB'. If I login as sys as sysdba, then it create successfully.
    After I create UserA, and grant the privileges I mentioned in the ealier post, I login as UserA, and run the statement above I get the same privileges error. But if I change the stament to below which will create the view under UserA's schema, then it create successfully:
    CREATE MATERIALIZED VIEW UserA."XDTest1" PCTFREE 10
    PCTUSED 0 MAXTRANS 255
    STORAGE ( INITIAL 64K NEXT 0K MINEXTENTS 1 MAXEXTENTS
    2147483645 PCTINCREASE 0)
    TABLESPACE "USERS"
    BUILD IMMEDIATE
    REFRESH COMPLETE START WITH sysdate NEXT sysdate + 1/24
    ENABLE QUERY REWRITE AS
    SELECT 1 From XDControlDB.RiskInstance;
    Looking for your suggestions,
    Cheers

  • CREATE SEQUENCE from a stored procedure

    Hello,
    Is it possible, to create a sequence object from an own written stored procedure? Can I reinitialize the actual value of a sequence object without recreating it from a stored procedure?
    Thank you for recommendations,
    Matthias Schoelzel
    EDV Studio ALINA GmbH
    Bad Oeynhausen

    maybe this example might be of some help.
    SQL> create or replace procedure dy_sequence (pSeqName varchar2,
      2                                           pStart number,
      3                                           pIncrement number) as
      4    vCnt     number := 0;
      5  begin
      6    select count(*) into vCnt
      7      from all_sequences
      8     where sequence_name = upper(pSeqName);
      9 
    10    if vCnt = 0 then
    11      execute immediate 'create sequence '||pSeqName||
    12                        ' start with '||to_char(pStart)||
    13                        ' increment by '||to_char(pIncrement);
    14    else
    15      execute immediate 'alter sequence '||pSeqName||' increment by '||to_char(pIncrement);
    16    end if;
    17  end;
    18  /
    Procedure created.
    SQL> -- create the sequence by calling the dy_sequence procedure
    SQL> execute dy_sequence ('test_sequence',1,1);
    PL/SQL procedure successfully completed.
    SQL> select test_sequence.nextval from dual;
       NEXTVAL
             1
    SQL> -- alter the sequence to increment by 2
    SQL> execute dy_sequence ('test_sequence',0,2);
    PL/SQL procedure successfully completed.
    SQL> select test_sequence.nextval from dual;
       NEXTVAL
             3
    SQL>

  • Create a View from tables of different schemas

    hi all,
    can u pls give solution to create a View from tables of different schemas.
    i have to bring data from one DB Server A,
    which contains different schemas and tables in the schemas...
    i need to insert that data in another DBServer B.
    i made a procedure for this...
    but when the connection fails from A, then i could not get data...
    please suggest some solution..
    thanks,
    neelima

    I don't know what database system you use, but in the most I know it is done that way:
    SELECT
    A.COL1,A.COL2.....
    FROM
    SCHEMA_NAME.TABLENAME A,
    SCHEMA_NAME.TABLE_NAME B
    WHERE
    A.COL1 = B.COL2
    ...

  • Insufficient privileges for creating a table in a procedure

    Hello,
    I have a problem with creating a table from within a procedure. The error is
    -1031 : ORA-01031: insufficient privileges
    All objects are owned by the same user, and the procedure is run under that user. This user has CREATE ANY TABLE with Admin Option rights.
    I am working with Oracle 8i.
    Can anybody tell me how I can fix this?
    Thanks, Wouter

    Does the user have the CREATE ANY TABLE privilege granted directly to it, or through a role? Stored procedures by default don't know about any privileges granted through a role.
    Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

  • Create a view from 10 tables

    Hi Experts,
    I want to create a view from 10 pricing tables rather than write 10 different select query in my application. Most of the columns of the pricing tables are same. I want all the data from these tables into the respective columns. Further I want an indicator as to which table does this record belong to. How can I achieve this?
    Ex:
    Table 1 columns: kappl kschl vkorg vtweg vkgrp
    Table 2 columns: kappl kschl vkorg vtweg matkl matnr
    if each table has two records, I want 4 records in my view in the respective columns along with the indicator that this record belongs to a specific column.
    Regards

    Hi,
    Placing 10 tables in one view will drastically affect performance. This is highly unrecommended.
    Anyhow if you insist on doing so you can create [database view|http://help.sap.com/saphelp_nw04/helpdata/en/36/74c0358373003ee10000009b38f839/frameset.htm] or use explicitly joins in your program.
    Keep in mind that althought it is possible to use projection (only selection of choosen column) it is not logically appropriate to locate which table this column belongs to (as far as we are talking about key fields) as both have the same field as key field.
    On the other hand when using projection for non-key columns it is you who define what is to be selected and how, therefore you know which column belongs to which table.
    i.e
    data: begin of st,
              lgart type t512w-lgart,
              molga type t512w-molga,
              lgtxt   type t512t-lgtxt,
            end of st.
    select w~molga w~lgart t~lgtxt   "<- here using aliases you know which column is taken from which table
      into st
      from T512W as W
      inner join T512T as T on
         W~LGART = T~LGART.
      write: / st-lgart, st-molga, st-lgtxt.
    endselect.
    In this example lgart (key field) can be taken from either t512w or t512t, but fields mogla and lgtxt are taken from t512w and t512t respectively.
    All in all this is correct as far as up to 3-4 tables are concerned. But 10 will be a disaster...
    Hope this helps you
    Marcin

  • HOW CAN I CREATE A VIEW FROM SAME TABLE WHERE I NEED COLUMNS DETAILS FROM DIFFERENT ROWS IN THE SAME TABLE

    i have a table1 on the top, but i want to create a view from table 1 as  view mentioned beneath the table 2. Could any of you please help me.
    table1
    ID
    office
    employee
    activity
    1
    246
    -9999
    698
    2
    ##-99
    21480
    698
    3
    104
    -9999
    7025
    4
    ##-99
    88908
    7025
    5
    108
    -9999
    2415
    6
    ##-99
    17135
    2415
    7
    246
    -9999
    698
    8
    ##-99
    21480
    698
    9
    104
    -9999
    7025
    10
    ##-99
    88908
    7025
    11
    108
    -9999
    2415
    12
    ##-99
    17135
    2415
    view
    ID
    office
    ID1
    employee
    activity
    1
    246
    2
    21480
    698
    3
    104
    4
    88908
    7025
    5
    108
    6
    17135
    2415
    7
    246
    8
    21480
    698
    9
    104
    10
    88908
    7025
    11
    108
    12
    17135
    2415

    declare @forumsTable table (ID int, officeID int, employeeID INT, activityID int)
    insert into @forumsTable (ID, officeID, employeeID, activityID)
    values
    (1 ,246, -9999, 698 ),
    (2 ,-99, 21480, 698 ),
    (3 ,104, -9999, 7025),
    (4 ,-99, 88908, 7025),
    (5 ,108, -9999, 2415),
    (6 ,-99, 17135, 2415),
    (7 ,246, -9999, 698 ),
    (8 ,-99, 21480, 698 ),
    (9 ,104, -9999, 7025),
    (10 ,-99, 88908, 7025),
    (11 ,108, -9999, 2415),
    (12 ,-99, 17135, 2415)
    select f1.ID, f1.officeID, f2.ID as ID1, f1.employeeID, f1.activityID
    from @forumsTable f1
    inner join @forumsTable f2
    on f1.activityID = f2.activityID
    and f1.officeID > 0
    and f2.employeeID > 0
    and f1.id - f2.id = -1
    You really need to improve the relationship here.
    Perhaps you could make office and activity an exclusive pair.

  • How to view the returned data from a stored procedure?

    Hi,
    I created ref cursor in the stored procedure to return data. But how can I view the data when I execute it? The stored procedure works fine, just want to view the result.
    Thanks!

    SQL>set serveroutput on size 100000;
    SQL>set autoprint on
    SQL>variable cv refcursor;
    SQL>exec proc_name(param1,:cv);

  • Creating universe from MySql stored procedure?

    Hi,
    I am new to BusinessObjects. I need to create universes based on the schema in our MySql database. However, when I tried to create one from a stored procedure, I fount that I wasn't allowed to do that or the option to insert a stored procedure was grayed out.
    Is it true that universe creation from MySql stored procedures not supported, or is it just something I didn't do right? Is there any workaround?
    Thanks in advance!

    jason Lee,
    You cannot combine universes with table structures with that of the stored procedures.Thats the reason in the existing universe the option is greyed out to insert stored procedures. You need to create a new universe thru design wizard and check the option to "create a universe through the stored procedure" in the first page.
    Let me know your results
    Thanks,
    Karthik

  • What is the prerequisite for creating two hierarchies from one fact table i

    Hi,
    what is the prerequisite for creating two hierarchies from one a single fact table.
    Rgds,
    Amit

    create global temporary table t1 as select * from trn_ordbase on commit preserve rows;You CANNOT use this syntax.
    http://download-east.oracle.com/docs/cd/B19188_01/doc/B15917/sqcmd.htm
    http://download-east.oracle.com/docs/cd/B19188_01/doc/B15917/glob_tab.gif
    http://download-east.oracle.com/docs/cd/B19188_01/doc/B15917/cre_tabl.gif

  • Minimum privileges for creating table

    I wanted to know of the minimum set of privileges for creating a table in Oracle 11g database. First I created a schema and granted the create table privilege to the schema. When I tried to create a table in the schema, it was giving a message of like privileges required on the tablespace. Granting the resource privilege grants the unlimited quota on all the tablespaces including SYSTEM and SYSAUX tablespace which may not be an ideal scenario. So, my query is that what are the minimum set of privileges for creating a table in Oracle 11g database.
    I hope, my question is clear.
    Please revert with the reply to my query.
    Regards

    Hi,
    If you are going to use the read only :
    SQL> create user anar identified by anar;
    User created.
    SQL> grant create session, select any table, select any dictionary to anar;
    Grant succeeded.
    SQL> conn anar/anar
    Connected.
    SQL> create table test(id number);
    create table test(id number)
    ERROR at line 1:
    ORA-01031: insufficient privileges
    SQL> desc test.test
    Name                                      Null?    Type
    ID                                                 NUMBER
    SQL> insert into test.test values (1);
    insert into test.test values (1)
    ERROR at line 1:
    ORA-01031: insufficient privileges
    SQL> update test.test set id = 15;
    update test.t set id = 15
    ERROR at line 1:
    ORA-01031: insufficient privileges
    Thank you

  • Get variable values from a stored procedure

    I am using SQL 2008R2 and I want to replace a view inside a stored procedure with a new stored procedure to return multiple variable values. Currently I am using the code below to get values for 4 different variables.  I would rather get the 4 variables
    from a stored procedure (which returns all of these 4 values and more) but not sure how to do so.  Below is the code for getting the 4 variable values in my current sp.
    DECLARE @TotalCarb real;
    DECLARE @TotalPro real;
    DECLARE @TotalFat real;
    DECLARE @TotalLiquid real;
    SELECT @TotalCarb = ISNULL(TotCarb,0),
    @TotalPro = ISNULL(TotPro,0),
    @TotalFat = ISNULL(TotFat,0),
    @TotalLiquid = ISNULL(TotLiq,0)
    FROM dbo.vw_ActualFoodTotals
    WHERE (MealID = @MealID);

    You can replace the view with inline table valued user-defined function:
    http://www.sqlusa.com/bestpractices/training/scripts/userdefinedfunction/
    See example: SQL create  INLINE table-valued function like a parametrized view
    Kalman Toth Database & OLAP Architect
    SQL Server 2014 Design & Programming
    New Book / Kindle: Exam 70-461 Bootcamp: Querying Microsoft SQL Server 2012

Maybe you are looking for

  • ICal Print List - Why are to-dos randomly sorted?

    When printing from iCal in the list view, my To-Do List is NEVER sorted the way I sorted it in the main iCal window (whether by Calendar, Priority, or Manually). Instead it's just sorted randomly, which is very unorganized. Does anyone know why this

  • PL/SQL, Java and  Current User

    Hi there, I'm trying to get the following to work : Schema HR Contains : Procedure P_TST_01 ( p_blob blob , p_dir varchar2 AUTHID CURRENT_USER IS LANGUAGE JAVA NAME 'FileUtil.write(p_blob,p_dir)'; Java source FileUtil (also with the AUTHID CURRENT_US

  • Accessing config information in XML file in a Weblogic web service (JWS)

    Problem: I have implemented a web service for sending emails and pages via Java Mail and SNPP respectively using WebLogic Workshop on the BEA WebLogic 8.1 platform. In the service, I use certain pieces of information that are currently stored in an X

  • Any applications that can make a Pages document open in MS Office for Mac?

    I purchased MS Office for Mac and stupidly deleted Pages from my Macbook. I don't have the Mac OS installation disk, and was wondering if there is a utility to open a Pages document? Thanks for any help.

  • Help to create complex graphs in oracle 10g reports

    As my company has migrated from 6i to Oracle 10g, but as graph ogd files are obselete in Oracle 10g , I am trying to create new graphs in Oracle 10g. But problem I am facing that I cannot give axis value 'LABEL' or define my own scale or draw any lin