Need a simple  UPDATE statement for updating areas of the polygons

Hi,
I need a simple UPDATE SQL statement for updating areas of the polygons in a table shema.table (geom) with sdo_area function.
Dejan

Dejan,
Maybe I don't understand your question but I will offer this:
update SOME_TABLE t set t.areasqft = SDO_GEOM.SDO_AREA(GEOM, 0.005) where t.geom.GET_GTYPE() = 3
This assumes a "feet" based SRID.
r,
dennis
Edited by: user633187 on Dec 1, 2008 9:04 AM

Similar Messages

  • Update statement for modifying day of the month

    Hi,
    i hope there is an easy answer to a question i'm probably over thinking. i have a situation where i need to update all the days in a date field to a certain day of the month regardless of the month or year. Here is an example of a small number of dates in the table:
    07/28/2004
    04/21/2008
    12/21/2011
    08/21/2006
    04/04/2008
    04/16/2012
    08/13/2011
    03/01/2006
    04/17/2012
    So, for each of these dates the day (or DD) would need to be converted to the 15th (ie. 07/15/2004, 04/15/2008, 12/15/2011, etc). I've used to_char to pull out just the DD, but am unsure what the update statement would need to look like. Any assistance would be greatly appreciated. Thank you!

    If you don't care about the time component
    UPDATE your_table
       SET your_column = trunc(your_column,'MM') + 14Justin
    Edited by: Justin Cave on Apr 26, 2012 9:47 PM
    Off by 1. Should be +14 not +15

  • Update stats for table in dbstatc

    Hello all,
        I am very new to administrating SAP on Oracle.  My question is.  There are some tables in dbstatc with ignore flag.  I ran the below query to get that...
    select COUNT(*) from sapsr3.dbstatc
    where ACTIV = 'I';
    Now from my understanding the I flag means...do not update stats for that table...
    So i first ran below...which runs the full stats and it did not update or touched those table in dbstats with I flag
    brconnect -c -u / -f stats -t all -f collect -p 8
    so after researching i found we can update those stats with below .... even after running the below, stats still do not show up as update.... how can i update (forcefully if required) to update stats for a particular table....
    brconnect -u / -c -f stats -t SAPSR3.table_name -f allsel -p 4          
    i query dba_tables at DB level to see if that specific table was analyzed or not.  I am on 11.2 oracle version...and this is a BW SAP system....

    New User:
    1)  Which objects do you have the INACTIVE flag set for:
    col dbobj format a20
    select dbobj, activ from sapsr3.dbstatc where activ = 'I' order by 1;
    2)  Check that you have the correct DBSTATC settings per SAP Note 403704.
    If you do not, then I would suggest you update the DBSTATC table following SAP Note 403704, but before you do take a copy of the dbstatc table:
    sqlplus sapsr3/<pass.
    create table dbstatc_old as select * from dbstatc;
    3)  To check to see if you have stats on a table:
    select table_name, partitioned, last_analyzed, num_rows from dba_tables where table_name = 'TBTCO';
    TABLE_NAME                     PAR LAST_ANALYZED     NUM_ROWS
    TBTCO                          NO  19-MAY-11           163030
    If the LAST_ANALYZED shows up with NO values, then there are NO stats on the table.
    HOWEVER, be careful for partitioned tables in BW because there are stats at the partition level as well:
    select TABLE_NAME, PARTITION_NAME, LAST_ANALYZED, NUM_ROWS from dba_tab_partitions where table_name = '<table>';
    4)  To collect the statistics on a table
    brconnect -c -u / -f stats -t <TABLE> -f allsel,collect -g 4 -p 16
    5)  If the stats are still not collected with the brconnect command, it may be because the stats are locked at the table level from SAP Note 1020260:
    SELECT stattype_locked FROM dba_tab_statistics WHERE table_name = '<TABLE>';
    If the value is ALL, then the stats may be locked at the table level and may require to unlock the stats before updating.
    Good Luck,
    Mike Kennedy

  • Update statement for object table.

    Hi,
    I have created one type as
    Create type test as object(
    ins_by varchar2(30),
    ins_on date,
    upd_by varchar2( 30),
    upd_on date);
    and then created an object table as
    create table imst(
    i_code number(5),
    i_desc varchar2(35),
    i_op test);
    now i am able to insert record in this table as
    insert into imst values(1,'Hawkins cooker',test(user,sysdate,'',''));
    Above works fine.
    But I would also like to update the record with i_op.upd_by,i_op.upd_on with some other values.
    Can any body help me specifying how to write a plain update statement for the same.
    Regards.
    Soumen

    Check it out:
    SQL> Create type myTest as object(
      2  ins_by varchar2(30),
      3  ins_on date,
      4  upd_by varchar2( 30),
      5  upd_on date);
      6  /
    Type created.
    SQL> create table imst(
      2  i_code number(5),
      3  i_desc varchar2(35),
      4  i_op myTest);
    Table created.
    SQL> insert into imst values(1,'Hawkins cooker', mytest(user,sysdate,'',''));
    1 row created.
    SQL> select * from imst;
        I_CODE I_DESC
    I_OP(INS_BY, INS_ON, UPD_BY, UPD_ON)
             1 Hawkins cooker
    MYTEST('APC_LOAD', '12-JUL-04', NULL, NULL)
    SQL> update imst i set i.i_op.upd_by = USER, i.i_op.upd_on = add_months(sysdate, 1);
    1 row updated.
    SQL> select * from imst;
        I_CODE I_DESC
    I_OP(INS_BY, INS_ON, UPD_BY, UPD_ON)
             1 Hawkins cooker
    MYTEST('APC_LOAD', '12-JUL-04', 'APC_LOAD', '12-AUG-04')
    SQL> Smoke me a kipper I'll be back before breakfast.
    Cheers, APC

  • Update statement for multiple records

    i have table a and table b
    common col in both the tables is emp_id
    in table b i have district_id
    which i want to update in table a.... column district_id for all the employees
    how to write update statement for this
    Edited by: user10873676 on Oct 17, 2011 8:00 AM

    Based on your current description, we have something like this...
    SQL> create table a (emp_id number)
      2  /
    Table created.
    SQL>
    SQL> create table b (emp_id number, district_id number)
      2  /
    Table created.
    SQL>
    SQL> insert into a (emp_id)
      2  select rownum from dual connect by rownum <= 10
      3  /
    10 rows created.
    SQL>
    SQL> insert into b (emp_id, district_id)
      2  select rownum, 10-rownum from dual connect by rownum <= 10
      3  /
    10 rows created.
    SQL>
    SQL> update b
      2  set district_id = 1
      3  /
    10 rows updated.
    SQL>
    SQL> select * from a;
        EMP_ID
             1
             2
             3
             4
             5
             6
             7
             8
             9
            10
    10 rows selected.
    SQL> select * from b;
        EMP_ID DISTRICT_ID
             1           1
             2           1
             3           1
             4           1
             5           1
             6           1
             7           1
             8           1
             9           1
            10           1
    10 rows selected.Which I'm sure is NOT what you want as the update on table b has nothing to do with table a, and we have no idea what the district_id should be updated with.

  • Software Update Checks for Updates at Start Up Even When Off

    I had problems with Software Update struggling to updating my Macbook's firmware (I solved it by updating the firmware outside of Software Update with Installer), I am now having problems with Software Update.
    Software Update checks for updates everytime I start up my computer - even when I have Software Update checks turned off in System Preferences. Is there a way to correct this?

    I, too, am having this same problem. However, I'll need a little patience from everyone. The last Mac I used was an SE30 and now about 15-18 years later I have 3 PC desktops and 3 PC laptops in my house. But... I'm exploring getting back to Mac and have a MacBook Pro that's exactly 10 days old. No problems until 2 days ago and now every time I boot, the little software update icon is bouncing on my Dock. It searches and then tells me there are no updates to install. Pretty annoying having it do this every start up. I've checked apple>system preferences>software update and unchecked it (so that it should be off). Still shows up on next boot.
    So, I tried to follow your suggestion about top level HD > preferences, but haven't quite figured out the Mac OS enough to know where these preferences are that you're directing me to. Could you possibly be a bit more granular for this Mac novice?
    Thanks a ton. These little system annoyances are why I've decided to try and break the PC grip on my life and it's a little disappointing to already have one on my mac. At least on the PC I know how to get rid of these things, but I'm still learning this Mac stuff.
    Thanks again,
    E

  • I am receiving updates everyday for creative cloud, always the same updates (sometimes even two time

    i am receiving updates everyday for creative cloud, always the same updates (sometimes even two times a day . Is there a way to stop that?

    Checked out that link and everything seems to be in order on this machine at this time.
    I only have CC installed on this one machine, not even my secondary machine like is permitted. it seems odd that I'm asked to re-accept the Licence Agreement as often as I am. If I had to guess, it's almost every week, if not multiple times some weeks, that all the software will decide I should have to view the licence agreement.
    Edit: I've never had any noticeable "errors" activating or anything like that. I just get asked to do it quite frequently.
    This activation screen isn't too annoying (it involves clicking one single button), but like I stated earlier, if I'm trying to launch the software by double-clicking on a PSD, AI, PPROJ, AEP, etc... that file will fail to open.
    I feel like that's probably not really a bug, but it is frustrating, since I did launch the application with the intent to edit that specific file I tried to open.
    Again, something that you guys may consider working on.
    Another annoyance is that: agreeing to the licence agreement is a per-application task, so if I see that Licence Agreement dialogue window by opening Photoshop (for example), I know that every other piece of software I have in the suite (Illustrator, Premiere, After Effects, Audition) will be showing me that screen on it's next launch. Probably deliberate for legal purposes that I can't just agree once for the whole suite, but heck, it would save me a lot of minor headaches if it was a unified agreement.

  • Software Update - Checking for Updates

    Hi,
    I've just got my PlayBook and I've followed every step, but now I'm stuck. After plugging it in, setting up the wi-fi, logging in with my Blackberry ID, downloading and installing the updates and restarting the PlayBook I'm stuck on the same screen... For over an hour now. All it says is: "Software Update - Checking for Updates"
    Can anyone help? Please?

    Try the three button reset. Hold down Power Button, plus both volume buttons at the same time for 15 seconds. Release and wait one minute. Then hold down the power button only until the red light flashes on (about 4 seconds) , release and wait for the PB to reboot.

  • Need to change screen colours for each system in the landscape

    hi ,
    we are in need of having different themes for different systems in the landscape .
    that is
    if i click development system , the screen with 'theme1'
    if i click quality system system , the screen with 'theme2'
    if i click production system system , the screen with 'theme3'
    how to configure this colour setting in accord to the system for all the users

    Hi Susin,
    You would do this by changing the parameter sapgui/theme for each system. It uses the Tradeshow theme by default as of Web AS 6.40. As long as the SAPgui itself is set to "System Dependant" then it should work fine.
    Regards,
    Nelis

  • Sp_who2 -need only active sessions from users which are not the background sessions

    Hello,
    sp_who2 -need only active sessions from users which are not the background  sessions
    Please assist.
    Best regards,
    Vishal

    Its better to use DMV's to view only active sessions from users (spid>50) as mentioned by Shanky.
    You can do that using sp_who2 but it requires a bit of programming to list only user sessions.
    SELECT
    S.SESSION_ID,
    S.STATUS,
    S.HOST_NAME,
    C.CLIENT_NET_ADDRESS,
    CASE WHEN S.LOGIN_NAME = S.ORIGINAL_LOGIN_NAME THEN S.LOGIN_NAME ELSE S.LOGIN_NAME END LOGIN_NAME,
    S.PROGRAM_NAME,
    C.CONNECT_TIME,
    S.LOGIN_TIME,
    CASE S.TRANSACTION_ISOLATION_LEVEL
    WHEN 0 THEN 'UNSPECIFIED'
    WHEN 1 THEN 'READUNCOMITTED'
    WHEN 2 THEN 'READCOMMITTED'
    WHEN 3 THEN 'REPEATABLE'
    WHEN 4 THEN 'SERIALIZABLE'
    WHEN 5 THEN 'SNAPSHOT'
    ELSE CAST(S.TRANSACTION_ISOLATION_LEVEL AS VARCHAR(32))
    END AS TRANSACTION_ISOLATION_LEVEL_NAME,
    S.LAST_SUCCESSFUL_LOGON,
    S.LAST_UNSUCCESSFUL_LOGON,
    S.UNSUCCESSFUL_LOGONS,
    S.CPU_TIME AS CPU_TIME_MS,
    S.MEMORY_USAGE AS MEMORY_USAGE_PAGES,
    S.ROW_COUNT,
    S.PREV_ERROR,
    S.LAST_REQUEST_START_TIME,
    S.LAST_REQUEST_END_TIME,
    C.NET_TRANSPORT,
    C.PROTOCOL_TYPE,
    S.LANGUAGE,
    S.DATE_FORMAT,
    ST.TEXT AS QUERY_TEXT
    FROM
    SYS.DM_EXEC_SESSIONS S
    FULL OUTER JOIN SYS.DM_EXEC_CONNECTIONS C ON C.SESSION_ID = S.SESSION_ID
    CROSS APPLY SYS.DM_EXEC_SQL_TEXT(C.MOST_RECENT_SQL_HANDLE) ST
    WHERE
    S.SESSION_ID IS NULL
    OR S.SESSION_ID > 50
    ORDER BY
    S.SESSION_ID
    -Prashanth

  • Convert a SQL Server Update Statement for Oracle

    Hi,
    i need to convert an update statement written for SQL Server to make it work on Oracle,
    the update is the following:
    UPDATE     TABLE1
    SET     CDate = TBL2.CDate
    FROM      TABLE1 TBL1
              JOIN TABLE2 TBL2 ON TBL2.Code = TBL1.TBL2Code
              JOIN TABLE3 TBL3 ON TBL3.Id = TBL1.Id
    WHERE     TBL3.TypeCode = '07'
    how can i make it compatible with oracle?
    thanks!!

    Billy  Verreynne  wrote:
    Karthick_Arp wrote:
    Try this
    <snipped>Dislike such an approach that requires multiple hits on the same tables. This is never scalable. A key performance issue is to do only one pass through a data set when possible and not do multiple passes.Yes i understand. But to do a update on a join the table must be a Key Preserved Table. And for a normal Update it is necessory to have an EXISTS clause so that we dont update the non-matching rows to NULL.

  • How to tune the Update statement for 20 million rows

    Hi,
    I want to update 20 million rows of a table. I wrote the PL/SQL code like this:
    DECLARE
    v1
    v2
    cursor C1 is
    select ....
    BEGIN
    Open C1;
    loop
    fetch C1 bulk collect into v1,v2 LIMIT 1000
    exit when C1%NOTFOUND;
    forall i in v1.first..v1.last
    update /*+INDEX(tab indx)*/....
    end loop;
    commit;
    close C1;
    END;
    The above code took 24 mins to update 100k records, so for around 20 million records it will take 4800 mins (80 hrs).
    How can I tune the code further ? Will a simple Update statement, instead of PL/SQL make the update faster ?
    Will adding few more hints help ?
    Thanks for your suggestions.
    Regards,
    Yogini Joshi

    Hello
    You have implemented this update in the slowest possible way. Cursor FOR loops should be absolute last resort. If you post the SQL in your cursor there is a very good chance we can re-code it to be a single update statement with a subquery which will be the fastest possible way to run this. Please remember to use the {noformat}{noformat} tags before and after your code so the formatting is preserved.
    David                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Error occuring in SELECT statement FOR UPDATE when using WITH cluase

    Hi,
    Iam using oracle 11g version
    Iam having a query with fetch records for update insid with cluase as
    cursor c1 is
    With abc as (
    SELECT col1,col2 from table1, table2 where < condition>
    for update of <col1> skip locked
    select * from abc,table3 where <condition>
    union all
    select * from table4 where id not in (select * from abc)
    if i add "for update of <col1> skip locked" this cluase
    iam getting error ORA-00907: missing right parenthesis
    when i remove "for update of <col1> skip locked" the block is working fine..
    can i know why error is occuring i

    Hi, first of all, your placing of "for update" clause is wrong. It should be at the end like:
    With abc as (
    SELECT col1,col2 from table1, table2 where < condition>
    select * from abc,table3 where <condition>
    union all
    select * from table4 where id not in (select * from abc)
    for update of <col1> skip locked;Second, if you try to compile it with this syntax then you will get a new error.
    ORA-01786:     FOR UPDATE of this query expression is not allowed
    Cause:     An attempt was made to use a FOR UPDATE clause on the result of a set expression involving GROUP BY, DISTINCT, UNION, INTERSECT, or MINUS.
    Action:     Check the syntax, remove the FOR UPDATE clause, and retry the statement.So, you will not be successful with the union clause in your query.

  • Bought Used Mac Mini...need help to change email for updates

    Purchased an used Mac Mini and I want to change my defaults to my name and get rid of the sellers name, I also need help in changing the email default for getting my updates from Apple.  That's the most important to me... I've got 5 updates waiting and the message I receive is to get my updates from the sellers email address.  Thanks!!!

    What OS is on your Mini? What year/model is the Mini? The seller should have reinstalled the OS that came with the Mini instead of just selling it to you as is.
    Once you determine the OS, you can erase your Mini's Macintosh HD and reinstall the OS which will allow you to setup your own account during the Setup process.

  • Master Detail Form - Update Statement for Column in the Detail Section

    Hello,
    I've posted a demo application to apex.oracle.com
    Application# 49298
    Application Name: Street_Inventory
    Basically, on page 3 I have a Master Detail Form. In the Detail section, I want the value of On_hand to save to table ITEMS. Here's my code below.
    SOURCE
    select
    "CONSUME_DETAIL"."CONSUME_DETAIL_ID",
    "CONSUME_DETAIL"."CONSUME_HEADER_ID",
    "CONSUME_DETAIL"."ITEM_ID",
    "CONSUME_DETAIL"."CONSUMED_QUANTITY",
    ("ITEMS"."ON_HAND" - "CONSUME_DETAIL"."CONSUMED_QUANTITY") as "ON_HAND"
    from "CONSUME_DETAIL",
    "ITEMS"
    where "CONSUME_HEADER_ID" = :P3_CONSUME_HEADER_ID
    and "CONSUME_DETAIL"."ITEM_ID"="ITEMS"."ITEM_ID"
    UPDATE INVENTORY PROCESS
    UPDATE ITEMS
    SET ON_HAND = :P3_ON_HAND - :P3_CONSUMED_QUANTITY
    WHERE ITEM_ID = (select     ITEM_ID
    from     CONSUME_DETAIL
    where CONSUME_DETAIL_ID = :P3_CONSUME_DETAIL_ID);
    My code isn't working. What am I doing wrong?

    WReed,
    The first thing I see "off the bat" is that you don't have items named P3_ON_HAND and P3_CONSUMED_QUANTITY which are referenced in your code. Although it's possible to do what you want with just SQL, I updated your code with a little PL/SQL to make it easier to understand...
    As you'll see the problem now is that the design/db model is not quite right as your getting a too many rows error.
    Regards,
    Dan
    http://danielmcghan.us
    http://sourceforge.net/projects/tapigen

Maybe you are looking for

  • Ideas to improve the Rescue and Recovery System

    Hi, some weeks ago I ned to restore my system, while this process there was some difficulties with the Rescue and Recovery. But First my configuration: I'm using a T61p with Windows Vista Ultimate installed. On the System there are 5 Partitions 1. Re

  • How do I clear history/cache from safari.

    I've gone to safari settings and cleared cache/history/cookies but previous pages still show up if I go back using the browser arrow., How do I clear previously viewed web pages

  • Inserting data from database in an applet in grid view.

    I want to get data from the database, through the server, on the applet in grid view form. i have connected the applet and the server through sockets now how to put the data in the grid...... how to get the grid view in the applet..

  • Hierarchy Automation

    Hi All, This is in regard with the Automation of hierarchies in BPC, we have one dimension where in we are loading two infoobjects to automate that dimension with master data and hierarchies, we are facing strange situation Already we were maintainin

  • Depreciation Doucment

    HI Depreciation document AF : when we should mark for  batch input only and when Number range assigned is for depreciation document should be in external Is there changes in 4.7 version and ecc 6.0 regarding this Thanks and regards Ramarao.p