Adding a virtual column derived from sdo_geometry?

Hi guys - maybe just a quick: do I do specifically to add a virtual as column the based on a geometry object?

SQL> select *
  2    from v$version;


BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
PL/SQL Release 11.2.0.3.0 - Production
CORE    11.2.0.3.0      Production
TNS for Linux: Version 11.2.0.3.0 - Production
NLSRTL Version 11.2.0.3.0 - Production


5 rows selected.


SQL> create table foo (id number
  2                   ,locn mdsys.sdo_geometry);


Table created.


SQL>
SQL> alter table foo add (x number as (locn.sdo_point.x));
alter table foo add (x number as (locn.sdo_point.x))
                                  *
ERROR at line 1:
ORA-54016: Invalid column expression was specified

I know that in a query, the table must be qualified with an alias as below:

don't know how to apply this to a virtual column.


SQL> insert into foo values (1,MDSYS.SDO_GEOMETRY(2001,8307,MDSYS.SDO_POINT_TYPE(151.213376,-33.865623,NULL),NULL,NULL));


1 row created.


SQL> select *
  2    from
  3
SQL>
SQL>
SQL> select f.locn.sdo_point.x
  2    from foo f;


LOCN.SDO_POINT.X
----------------
      151.213376


1 row selected.


SQL>


Edit: what should we do to make the display in a fixed rate code in shape with a police?

For me it works with a user defined function:

SQL> select * from v$version;

BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Express Edition Release 11.2.0.2.0 - Production
PL/SQL Release 11.2.0.2.0 - Production
CORE    11.2.0.2.0    Production
TNS for 32-bit Windows: Version 11.2.0.2.0 - Production
NLSRTL Version 11.2.0.2.0 - Production    

SQL> create table foo (id number
  2                      ,locn mdsys.sdo_geometry);

Table created.

SQL> insert into foo (id, locn) values (1,MDSYS.SDO_GEOMETRY(2001,8307,MDSYS.SDO_POINT_TYPE(151.213376,-33.865623,NULL),NULL,NULL));

1 row created.

SQL> create or replace function get_geometry_x (g mdsys.sdo_geometry) return number deterministic as
  2  begin
  3  return g.sdo_point.x;
  4  end;
  5  /

Function created.

SQL> alter table foo add (x number as (get_geometry_x(locn)));

Table altered.

SQL> select x from foo;

         X
----------
151,213376

Message geändert durch hm

Tags: Database

Similar Questions

  • Repeat the value of the column derived from formulas

    I need to repeat a value derived for a particular combination of column and line to all the rows in the table. However when I put the 'case' function it does not repeat the values I want. The value is displayed only in the line of 1at

    The formulas used are the following

    CASE WHEN D_MILLS.MILL_NO = 1 THEN (F_MILL_PRODUCTION. FN_YTD_CPO_PRODUCED/F_MILL_PRODUCTION. FN_YTD_CROP_PROCESSED) ELSE (FILTER (F_MILL_PRODUCTION. FN_YTD_CPO_PRODUCED/F_MILL_PRODUCTION. WITH THE HELP OF FN_YTD_CROP_PROCESSED (D_MILLS.MILL_NO = 1.00))) END


    Note: No. Mill is the Dimension user for the report on the ground that I have. and I need the value of the derivative for mill = 1 to be repeated for all the other mills (mill No. = 2,3, etc.)

    Published by: Shaz01 on August 7, 2010 01:45

    Hello

    Use the formula like this,

    Max (CASE WHEN D_MILLS.MILL_NO = 1 THEN (F_MILL_PRODUCTION. FN_YTD_CPO_PRODUCED/F_MILL_PRODUCTION. FN_YTD_CROP_PROCESSED) ELSE (FILTER (F_MILL_PRODUCTION. FN_YTD_CPO_PRODUCED/F_MILL_PRODUCTION. (WITH THE HELP OF FN_YTD_CROP_PROCESSED (D_MILLS.MILL_NO = 1.00))) END)

    You must also, for all values don't indicate the value of factory No 1, so no need of instruction box.

    MAX (FILTER (F_MILL_PRODUCTION. FN_YTD_CPO_PRODUCED/F_MILL_PRODUCTION. WITH THE HELP OF FN_YTD_CROP_PROCESSED (D_MILLS.MILL_NO = 1.00)))

    Thank you
    Vino

  • ORA-00936: missing expression when adding virtual column

    I am having this error when you add virtual column am in database 11 g

    having error

    ORA-00936: lack of expression

    in select superior

    My sql is

    Employees ALTER TABLE ADD (user name (select upper (substr (first_name, 1, 1)) | initcap (last_name) user name of employees));

    http://docs.Oracle.com/CD/E11882_01/server.112/e41084/statements_3001.htm#sthref3374

    Adding a column of Table virtual: example, the following statement adds a copy of the hr.employees table a column named income , which is a combination of salary more commission. Wages and the commission are NUMBER columns, so the database creates the virtual column as a NUMBER same column if the data type is not specified in the statement:

    CREATE TABLE emp2 AS SELECT * FROM employees; ALTER TABLE emp2 ADD (income AS (salary + (salary*commission_pct)));
    

    ALTER TABLE ADD employees (AS username (upper (substr (first_name, 1, 1)) | initcap (last_name)));

    Concerning

    Etbin

  • ORA-54017: excluded from the regime of virtual columns UPDATE Operation

    Referenced to

    ORA-54017: excluded from the regime of virtual columns UPDATE Operation

    There are problems with v4.0_4.121.1.0 knew?

    Thank you

    Sorry, but after setting StoreGeneratedPattern to Computed in the EF model I have the same problem.

    Thank you

  • ORA-01733-virtual column not allowed here - insert using inline view

    Does anyone know why I get ORA-01733-virtual column not allowed here

    SQL > select * from v version $;

    BANNER
    --------------------------------------------------------------------------------
    Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production
    PL/SQL release 11.1.0.6.0 - Production
    CORE 11.1.0.6.0 Production
    AMT for 32-bit Windows: Version 11.1.0.6.0 - Production
    NLSRTL Version 11.1.0.6.0 - Production



    -no error without the WITH CHECK option

    SQL > INSERT INTO
    2 (SELECT
    3 location_id,
    4 city
    5 l.country_id
    6 OF country c, localities, regions r l
    7 where l.country_id = c.country_id
    8 and c.region_id = r.region_id
    9 and r.region_name = 'Asia')
    10 VALUES (5500, 'Common Wansdworth', 'UK');

    1 line of creation.

    SQL > rollback;

    Complete restoration.


    -error with WITH CHECK OPTION


    SQL > INSERT INTO
    2 (SELECT
    3 location_id,
    4 city
    5 l.country_id
    6 OF country c, localities, regions r l
    7 where l.country_id = c.country_id
    8 and c.region_id = r.region_id
    9 and r.region_name = 'Asia' WITH CHECK OPTION)
    10 VALUES (5500, 'Common Wansdworth', 'UK');
    INSERT INTO
    *
    ERROR on line 1:
    ORA-01733: virtual column not allowed here




    I was expecting

    ORA-01402: discovers the violation of where WITH CHECK OPTION clause

    for the second. Am I missing here?

    Coskan wrote:
    Randolf

    Thanks a lot for the update of this old question
    After reading the link, I think I should ignore this error and accept him as ORA-01402

    The information that you have asked me to check me do not have an understanding of the different error types.

    Coskan,

    I didn't know this is an old thread that somehow got updated by someone else.

    Regarding your question: you're right that the output of the script is not really that useful.

    I have just run on 10.2.0.4 and in general, it seems that the output of USER_UPDATABLE_COLUMNS is incorrect regarding the views of join using the WITH CHECK OPTION.

    For example although the location_id from the TEST_V_2 column appears as non-editable (probably because of the rule that "the columns used in the join expression" cannot be modified in a join view when you use the WITH CHECK OPTION) I can run successfully your insert if statement I choose a location_id less than 2000.

    It seems that summed up the difference if you join more than two tables, you'll always get the error "ORA-01733" when you try to insert in the join with the enabled OPTION CHECK view. For example to add a third table TEST_V_2 which does not change the original view, but simply joined meaning for example COUNTRIES to LOCATIONS, will show the same behavior to throw an ORA-01733, however it works fine when the omission of the WITH CHECK OPTION.

    So overall, I tend to say it is really a limitation of the implementation and it is not actually an ORA-01402 but looks like Oracle is simply trying to tell you: Amendment No. INSERT in this possible view. Updates however seem to work, at least I can find some examples of work.

    There seems to be other restrictions of implementation with the WITH CHECK OPTION in place even when the only membership as two tables, for example when trying to join the COUNTRIES and PLACES but by selecting only in PLACES and by using a filter on the COUNTRY_ID predicate fails with ORA-01733 when this predicate is applied to the COUNTRY. COUNTRY_ID but it works if this predicate is applied to PLACES. COUNTRY_ID.

    I could imagine that Oracle has quietly added some of these restrictions with each patch set due to the angle of the case/adverse reactions encountered. I saw this for other features, too.

    Kind regards
    Randolf

    Oracle related blog stuff:
    http://Oracle-Randolf.blogspot.com/

    SQLTools ++ for Oracle (Open source Oracle GUI for Windows):
    http://www.sqltools-plusplus.org:7676 /.
    http://sourceforge.NET/projects/SQLT-pp/

  • json_list to varchar/string to use in the virtual column

    Hello Experts,

    Environment:

    Database Oracle 12 c Enterprise Edition Release 12.1.0.2.0 - 64 bit Production

    PL/SQL Release 12.1.0.2.0 - Production

    I have the following function that returns JSON_LIST.

    {code}

    CREATE OR REPLACE FUNCTION GENERATE_JSON (STRING2CONVERT IN VARCHAR2)

    RETURN JSON_LIST

    DETERMINISTIC

    IS

    RET json_list;

    V_ERROR VARCHAR2 (31000);

    BEGIN

    RET: = json_dyn.executeList (STRING2CONVERT);

    RET. Print;

    RETURN RET;

    EXCEPTION WHEN OTHERS THEN

    V_ERROR: = SQLERRM;

    RETURNS A NULL VALUE.

    END;

    -test the query see the output in the output of DBMS

    SELECT GENERATE_JSON (' select ' |) Chr (39) | ' AJ' | Chr (39) |' like c_name,' | Chr (39) | ' BOY ' | Chr (39): ' c_type, like '

    || Chr (39) | ' HUMAN '. Chr (39): ' as c_category,' | Chr (39) | ' TEST SUBJECT ' | Chr (39) | 'as c_desc from dual')

    FROM DUAL;


    {code}


    The SQL query above in the DBMS output output

    [{

    "C_NAME": "AJ."

    "C_TYPE": "BOY."

    "C_CATEGORY": "HUMAN."

    'C_DESC': 'GUINEA PIG '.

    }]


    Question: How can I have it return the same structure of String (varchar).


    Why would I want to convert JSON_LIST to string?

    So that I can use this call to service as part of a virtual column in a table to store Json and have a constraint to enforce structureof Json.


    If this is not the right way?

    Kindly share how I can take a few columns in the same table, convert to json format and store in a virtual column in the same table and enforce the Json structure?


    Thank you

    AJ



    with

    data in the form of

    (select q'~ select "AJ" as c_name, 'BOY' as c_type, 'HUMAN' as c_category, 'SUBJECT of TEST' as the double c_desc ~' source)

    of the double

    ),

    Converter (SRC, res, Step) as

    (select regexp_replace (ltrim (upper (substr (source, 1, instr (upper (source), "FROM") - 1)), "SELECT"), '\s+AS\s+',': ') |) ',', null, 1

    from the data

    Union of all the

    Select substr (src, instr(src,',') + 1)

    '"' || substr (substr (SRC, 1, InStr (CBC, ',') - 1), instr (substr (src, 1, instr (CBC, ',') - 1),': ') + 1) | '" : ' ||

    Replace (substr (substr (SRC, 1, InStr (CBC, ',') - 1), 1, instr (substr (src, 1, instr (CBC, ',') - 1),': ')-1), "','" ' "),

    Step + 1

    converter

    where the CBC is not null

    )

    Select the source'[{' | listagg(res,',') Group (order by step) |}] '] "converted

    data converter

    SOURCE CONVERTED
    Select "AJ" as c_name, 'BOY' as c_type, 'HUMAN' as c_category, 'SUBJECT of TEST' as double c_desc [{'C_NAME': 'AJ', 'C_TYPE': 'BOY', 'C_CATEGORY': 'HUMAN', 'C_DESC': 'GUINEA PIG'}]

    Concerning

    Etbin

  • ORA-54002 on creating virtual column

    I wonder on what follows.

    I'm in the middle of a migration project.

    I load the data received from the source database into the staging tables.

    The data in these tables must remain absolutely intact to be able to check where things have gone wrong if something is not the way we expected after migration.

    Obviously, the data includes dates. Those who are in the DATE data type columns.

    However, the values represent the date and time UTC.

    The values are NOT timestamps with time zone, but simply date that contains the date time and something that has passed, but expressed in the date and time utc.

    Now, the database target also expects that DATEs, so I seem to be home free.

    However, the target database expect the passage of time to express the time zones (Europe/Amsterdam).

    No problem I know how to do this.

    And because I want to do a million times in the transformation before insertion in the target code (and almost certainly forget a few times) I thought: I'll add virtual columns for the staging tables that allow to calculate the local time of the date and time utc.

    This way the data is intact, but the transformation code can simply use the column (virtual) replacement and does not bother with the calculations of time.

    Great, I thought.

    Until I tried to create the table.

    CREATE TABLE utc_test

    (createddate_utc DATE

    createddate GENERATED DATE ALWAYS

    AS (CAST (FROM_TZ (CAST (createddate_utc AS TIMESTAMP)

    , "UTC".

    )

    At the time of the ZONE "Europe/Amsterdam".

    AS DATE

    )

    )

    VIRTUAL

    );

    And Oracle says:

    At the time of the ZONE "Europe/Amsterdam".

    *

    ERROR on line 7:

    ORA-54002: only pure functions can be specified in a virtual column expression

    Excuse me?

    Not deterministic?

    Oracle is probably right, and even if it isn't yet I have to live with that.

    But no matter how hard I try I can't understand why this code would not deterministic.

    IMHO any form of date I put in createddate_utc, if I put the same date in here a million times I'll get the same answer a million times.

    I know, FROM_TZ to the ZONE SCHEDULE will give different answers for different time zones.

    But not for a same time zone.

    And is this not the essence of deterministic: always the same result, given the same input?

    Anyone who can teach me Oracle ;-)

    My question (I may not was clear on that) was: why Oracle claims that the function is not deterministic?

    Because this is not the case.

    Zone information (and therefore the conversion between TZs) are governed by the zone files, see: Datetime and time zones Support Data Types.

    Since these data may vary, it is not deterministic.

    To solve this 'problem', you can always create a standalone function transformation of packaging and declare it deterministic, even if it is not in the strict sense.

  • Function index and virtual columns

    I just read the documentation of Oracle on the FBI. In the context of optimization with a function-based index, it is said that "a virtual column is useful for speed of access to data from expressions.". Here is the link Index-Organized Tables and indexes.

    My question is, does Oracle already not create a virtual column when we create a function-based index?

    Concerning

    Charlie

    Hi Charlie
    Yes, the database engine creates a virtual column. But this column is hidden. Reproduced in 11.2.0.3 example:
    SQL> CREATE TABLE t (n NUMBER);SQL> CREATE INDEX i ON t (round(n,0));
    SQL> SELECT column_name, hidden_column, virtual_column  2  FROM user_tab_cols
      3  WHERE table_name = 'T';
    
    COLUMN_NAME                    HIDDEN VIR
    ------------------------------ ------ ---
    N                              NO    NO
    SYS_NC00002$                  YES    YES
    

    HTH

    Chris Antognini

    Troubleshooting performance Oracle, Apress 2008/2014

  • details of the virtual columns and deterministic function

    Hello

    First time that I post a question after the migration of the Forums. So please excuse me if you see errors in format.

    Below, I have created a function as deterministic and a table with a virtual column (column refers to the function)

    Here are my questions

    (1) if I run SELECT * FROM t whenever Oracle will perform the function add_fn?

    (2) what is the advantage of DETERMINISTIC? (Documentation says that if we declare a function as deterministic he will attempt to use previously caluculated results for the same set of values. So, when I ever I run SELECT * FROM t oracle executes add_fn only once and it will use the result for the next time. Is my understanding correct.)

    Here's the code.

    SQL> create or replace function add_fn ( p_n1 in number
      2                                                   ,p_n2 in number )
      3  return number deterministic
      4  is
      5  begin
      6      return p_n1+p_n2;
      7  end;
      8  /
    Function created
    SQL> create table t ( n1 number
      2                       ,n2 number
      3         ,n3 number generated always as (add_fn(n1,n2)) virtual
      4         );
    Table created
    SQL> insert into t (n1,n2) values (10,20);
    1 row inserted
    SQL> select * from t;
            N1         N2         N3
    ---------- ---------- ----------
            10         20         30
    SQL> select * from t;
            N1         N2         N3
    ---------- ---------- ----------
            10         20         30
    SQL>
    

    Hello

    ...
    (1) if I run SELECT * FROM t whenever Oracle will perform the function add_fn?

    (2) what is the advantage of DETERMINISTIC? (Documentation says that if we declare a function as deterministic he will attempt to use previously caluculated results for the same set of values. So, when I ever I run SELECT * FROM t oracle executes add_fn only once and it will use the result for the next time. Is my understanding correct.)

    ...

    (1) oracle will have to evaluate the function.  Because only deterministic functions are allowed, this means that it will not necessarily perform the function again; He can get the value cached from a previous call.

    I think that the indexed values are actually stored in the index.  "SELECT * FROM t;" do not use an index, but if you make another request, then you should be able to get the value of the virtual table of the index, without calling the function or obtaining the value of a cache.

    (2) If a function is DETERMINISTIC, the optimizer may decide whether to actually call the function each time, or the cache for better performance results.  There is no guarantee that it will always be one or the other.  Replace "will be" in your description "may", and then what you say is correct.

  • Support virtual column?

    Hello

    There is some support planning add/edit the virtual columns?

    Kind regards.

    Hi, Giuseppe.

    Some information on the support of the virtual column (first available in Oracle 11 g Release 1) with SQL Developer.

    In the current version of the production, 3.2.20.09.87, manifested a definition of existing virtual column in the column default data tab of columns from the display of table help Add Action of the tab, there is no way to set a virtual column. Using the Edit from the context menu of the node of the table option, try to change a virtual column (or add a new virtual column) by updating the default text box will fail with something like the following error message:

    Invalid  Default Value
    Expression cannot use columns or user functions. Literal strings should be quoted....
    

    Looking the next development version, it seems that the user of Table Edit interface has been enhanced to include support for virtual column; However, trying to use the parser actually complained to virtual column expression is not valid. Maybe this improvement does not hangs properly still. Our Quality Assurance is aware of the issue and will record a bug later in the development cycle if the developer intercepts her.

    Kind regards
    Gary
    SQL development team

  • Addition of virtual column: ORA-12899: value too large for column

    I am using Oracle 11g, OS Win7, SQL Developer

    I'm trying to add the virtual column to my test table, but get ORA-12899: value too large for column error. Here are the details.
    Can someone help me in this?
    CREATE TABLE test_reg_exp
    (col1 VARCHAR2(100));
    
    INSERT INTO test_reg_exp (col1) VALUES ('ABCD_EFGH');
    INSERT INTO test_reg_exp (col1) VALUES ('ABCDE_ABC');
    INSERT INTO test_reg_exp (col1) VALUES ('WXYZ_ABCD');
    INSERT INTO test_reg_exp (col1) VALUES ('ABCDE_PQRS');
    INSERT INTO test_reg_exp (col1) VALUES ('ABCD_WXYZ');
    ALTER TABLE test_reg_exp
    ADD (col2 VARCHAR2(100) GENERATED ALWAYS AS (REGEXP_REPLACE (col1, '^ABCD[A-Z]*_')));
    
    SQL Error: ORA-12899: value too large for column "COL2" (actual: 100, maximum: 400)
    12899. 00000 -  "value too large for column %s (actual: %s, maximum: %s)"
    *Cause:    An attempt was made to insert or update a column with a value
               which is too wide for the width of the destination column.
               The name of the column is given, along with the actual width
               of the value, and the maximum allowed width of the column.
               Note that widths are reported in characters if character length
               semantics are in effect for the column, otherwise widths are
               reported in bytes.
    *Action:   Examine the SQL statement for correctness.  Check source
               and destination column data types.
               Either make the destination column wider, or use a subset
               of the source column (i.e. use substring).
    When I try to, I get the correct results:
    SELECT col1, (REGEXP_REPLACE (col1, '^ABCD[A-Z]*_'))
    FROM test_reg_exp;
    Thank you.

    Yes, RP, it works if you give col2 size > = 400.

    @Northwest - could you please test the same w/o having a clause of regex in col2?
    I have a doubt about using a REGULAR expression in this case Dynamics col.

    Refer to this (might help) - http://www.oracle-base.com/articles/11g/virtual-columns-11gr1.php
    Below excerpt from above link... see if that helps...
    >
    Notes and restrictions on the virtual columns include:

    The indexes defined on the virtual columns are equivalent to a function-based index.
    Virtual columns can be referenced in the updates and deletions WHERE clause, but they cannot be manipulated by DML.
    The tables containing virtual columns may still be eligible for result caching.
    Functions in expressions must be deterministic when the table is created, but can then be recompiled and non-deterministic without for as much invalidate the virtual column. In such cases, the following steps must be taken after the function is recompiled:
    Constraint on the virtual column must be disabled and re-enabled.
    On the virtual column indexes must be rebuilt.
    Materialized views that access the virtual column must be fully refreshed.
    The result cache must be flushed if the virtual column acceded to the request (s).
    Statistical table must be regathered.
    The virtual columns are not supported for the organized and external object in index, cluster or temporary tables.
    The expression used in the virtual column definition has the following restrictions:
    It cannot refer to another virtual column by name.
    It can refer to the columns defined in the same table.
    If it refers to a deterministic user-defined function, it cannot be used as a partitioning key column.
    The result of the expression must be a scalar value. It cannot return that an Oracle supplied the data type, a type defined by the user, LOB or LONG RAW.
    >

    Published by: Vanessa B on October 16, 2012 23:48

    Published by: Vanessa B on October 16, 2012 23:54

  • Virtual column NOT NULL

    Hello dear colleagues,

    Anyone able to replicate this?
    BANNER
    --------------------------------------------------------------------------------
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
    PL/SQL Release 11.2.0.1.0 - Production
    CORE    11.2.0.1.0      Production
    TNS for 32-bit Windows: Version 11.2.0.1.0 - Production
    NLSRTL Version 11.2.0.1.0 - Production
    Create a small table:
    SQL> create table t(x number not null);
    
    Table created.
    Now, add a virtual column, using decode:
    SQL> alter table t add (y varchar2(1) as (decode(x, 1, 'A', 'B')) not null);
    
    Table altered.
    'The same', using case column
    SQL> alter table t add (z varchar2(1) as (case x when 1 then 'A' else 'B' end));
    
    Table altered.
    Only it wasn't the same, I wanted to NOT NULL.
    If I do, I get:
    SQL> alter table t add (w varchar2(1) as (case x when 2 then 'A' else 'B' end) not null);
    alter table t add (w varchar2(1) as (case x when 2 then 'A' else 'B' end) not null)
                                                                     *
    ERROR at line 1:
    ORA-03113: EOF pÕ kommunikationskanal
    Process ID: 3400
    Session ID: 140 Serial number: 213
    This is consistent with this database on my laptop.


    Concerning
    Peter

    Looks like you have perhaps hit Bug Bug 9277263: ORA-07445 [ATBNUL () + 299] WHEN ADDING a CONSTRAINT INLINE ON a VIRTUAL COLUMN

  • ORA-01733: virtual column not allowed here

    UPDATE (
    SELECT callingnumber, calledcallzone, b.callzone callzone, b.ndc
              FROM (SELECT DISTINCT SUBSTR (connectedcallingnumber, 3, 3) callingnumber,
                             calledcallzone,rownum 
                        FROM rating_temp
                       WHERE calltype = 0) a,
                   (SELECT *
                      FROM callzone cc
                     WHERE LENGTH (ndc) = 3) b
             WHERE callingnumber = ndc
             )
       SET calledcallzone = callzone-----VIRTUAL COLUMN NOT ALLOWED HERE
    Published by: user8731258 on November 29, 2010 12:45 AM

    Its simple you used SEPARATE in your first view inline. And so you cannot use columns for UPDATE.

  • 'CREATE JAVA' error: ORA-29506: derived from the USING clause invalid query

    Hello

    I created a table with the following attributes:

    name varchar2 (200);
    LOB_DATA blob


    I loaded a java source file in the lob_data blob.

    I then called the SQL:

    create or replace and compile the java source named "RemoteCommand" using blob
    Select lob_data from str_blob_table where name = 'RemoteCommand.java ';

    and I get the error:

    ORA-29506: invalid query from the USING clause
    ORA-00936: lack of expression
    29506 00000 - "query invalid derived from USING clause.
    * Cause: The USING clause does not form a valid query.
    * Action: Correct the USING clause.



    If I simply copy and paste the query part of the USING clause:

    Select lob_data from str_blob_table where name = 'RemoteCommand.java ';

    I get a valid result in SQLDeveloper.


    Any thoughts on what is happening here?

    A few notes:
    1. it is a 8i database.
    2. it works very well on a 9i database, but according to the SQL reference for 8i, it should work as well.

    Thank you
    Brent

    Try to delete "select" in the USING clause, that is to say change the SELECT BLOB SUPPORT... for BLOB to HELP... The original form of the syntax of JAVA to CREATE did not expect the SELECT token must be explicitly provided. Somewhere between 8i and 9i the parser was changed to try the provided text as well as what, with SELECT prefixed. So a CREATE JAVA statement you tried working in 9i but in 8i fails because SELECT would always be added before you try using the clause as a query, resulting a SELECT duplicate token.

  • Change the sentence to a unique new virtual column in an existing view of Oracle

    Hello

    I'm using the Oracle 11 g on Windows. I need a need a new single virtual column (integer) in an existing Oracle view called RAIL_VIEW.

    Can someone help me with a sentence simple alter to add a virtual column that had a unique ID defined system - it does not matter what it contains, it should be just a unique id all the time (is there something like a GUID or allows the sysdate?).

    Thank you!
    Dejan

    something like that?

    select t1.fid
          ,t1.oznaka
          ,t1.st_xxx
          ,t1.ime_xxx
          ,t1.id_upr_fk
          ,t2.geom
          ,t2.length
          ,t2.tip_spr
          ,t2.id
          ,t2.id_upr
          ,t2.sif_vrste
          ,t2.cc_klas
          ,t2.topo
          ,t2.nat_yx
          ,t2.z
          ,t2.nat_z
          ,t2.gji
          ,t2.dat_vir
          ,t2.mat_st
          ,t2.mat_gjs
          ,t2.id_el
          ,t2.dat_el
          ,t2.dim_yx
          ,t2.dim_z
          ,t2.opu
          ,t2.atr1
          ,t2.atr2
          ,t2.atr3
          ,t2.atr4
          ,t2.atr5
          ,t2.opis
          ,t2.vir
          , sys_guid() the_other_column
      from ges_os_tira           t1
          ,zkgji.l1200_zeleznice t2
     where t1.id_upr_fk = t2.id_upr
    

Maybe you are looking for

  • How to stop the module loading bar?

    I see a few other similar questions without answers, so thought that I post the question to see if someone has thought of it. I DON'T want the bar the module at the bottom of my browser window... so why should I do? Firefox does a wonderful job in al

  • Skype app

    so before I used to be able to use the Skype application on my laptop with windows 8.1, but now everytime I open the app, it starts to load, but then closes and brings back me to my office... help me please, I use this app a lot, and I want to be abl

  • New bios update (f.29) causes my computer overheating and close

    New bios update (f.29) causes my computer to overheat and shut down. What should I do?

  • How can I download my photos on my PC, I have a samsung GTN7000 Galaxy note

    I have a samsung GTN7000 Galaxy note I HAVE SPENT HOURS TRYING TO UPLOAD MY PICTURES ON MY pc I AM KNOW TRY THE MEMORY CARD IN A reader of CARDS, BUT I GET ALWAYS KNOW WHERE please help me

  • How to beat the Windows password?

    I'm the only user on this system and every time I turn on the computer I have to put a stoopid password. It is particularly annoying when it resets on its own, then made snot run programmed events until I have this password.  What can I do to have th