Modify the number of dimention of a geometry

Is it possible to modify, with a function, the number of dimension of a geometry?
I'm able to change the gtype but not the sdo_elem_info and sdo_ordinates.
....thanks for your help

Here is a function doing what you ask for.
It is not very efficient or elegant, but I think it works for most geometries :
Parameter Numd is the dimension you want of the returned geometry.
good luck
Hans
FUNCTION Convert_to( Numd PLS_INTEGER, Geo IN Mdsys.Sdo_geometry )
RETURN Mdsys.Sdo_geometry
-- converts from 4D to 2D or 3D ...
-- or converts from 3D to 2D ...
IS
Resultat Mdsys.Sdo_geometry;
V_numdims PLS_INTEGER;
V_numords PLS_INTEGER;
V_numelem PLS_INTEGER;
V_typeelem PLS_INTEGER;
V_startpos PLS_INTEGER;
V_startposnext PLS_INTEGER;
V_endpos PLS_INTEGER;
I PLS_INTEGER;
P PLS_INTEGER;
V_curpos PLS_INTEGER;
V_is_multipolygon BOOLEAN;
V_gtype PLS_INTEGER;
V_count PLS_INTEGER;
V_count_unknown PLS_INTEGER;
V_ok PLS_INTEGER;
BEGIN
Resultat := NULL;
IF ( Numd < 2 )
OR ( Numd > 3 ) THEN
RETURN Resultat;
END IF;
IF Geo IS NULL THEN -- no geometry to work with .
RETURN Resultat;
END IF;
V_gtype := Geo.Sdo_gtype;
IF MOD( V_gtype, 1000 ) = 0 THEN -- Spatial ignores this geometry .
Resultat := Geo;
RETURN Resultat;
END IF;
IF V_gtype > 1999
AND V_gtype < 3000 THEN-- This is a 2D geometry - just exit FROM here ..
Resultat := Geo;
RETURN Resultat;
END IF;
IF V_gtype > 2999
AND V_gtype < 4000
AND Numd = 3 THEN
-- This is a 3D geometry - AND that's want we want - just exit FROM here ..
Resultat := Geo;
RETURN Resultat;
END IF;
IF NOT Geo.Sdo_point IS NULL THEN -- single point ...
Resultat := Geo;
Resultat.Sdo_gtype := 2000 + MOD( V_gtype, 1000 );
Resultat.Sdo_point.Z := NULL;
RETURN Resultat;
END IF;
IF Geo.Sdo_elem_info IS NULL THEN
RETURN Resultat;
END IF;
IF Geo.Sdo_ordinates IS NULL THEN
RETURN Resultat;
END IF;
V_numdims := TRUNC( Geo.Sdo_gtype / 1000 );
-- NUMBER of dimensions 2D, 3D OR 4D .
V_numelem := Geo.Sdo_elem_info.COUNT / 3;
-- NUMBER of elements in this geometry .
IF ( MOD( V_gtype, 1000 ) = 1 )
-- Point type - check for single point in sdo_ordinates .....
THEN
V_ok := 1;
V_count := Geo.Sdo_ordinates.COUNT;
V_count_unknown := 0;
IF ( V_numelem = 2 ) THEN
IF ( Geo.Sdo_elem_info( 2 ) = 0 )
-- first element is : Unsupported element type. Ignored by the Spatial functions AND PROCEDUREs.
THEN
V_count_unknown := Geo.Sdo_elem_info( 4 ) - 1;
-- num of ordinates in the unknown part ...
ELSE
V_ok := 0;
END IF;
END IF;
IF (
V_ok = 1
AND V_numelem < 3
AND V_count - V_count_unknown > 1
AND (
( V_count - V_count_unknown < 5
AND V_gtype > 3999 )
-- 4d with one point in sdo_ordinates ..
OR ( V_count - V_count_unknown < 4
AND V_gtype > 2999 )))
-- 3d with one point in sdo_ordinates ..
THEN
IF Numd = 2 THEN
Resultat :=
Mdsys.Sdo_geometry( 2001, -- GType 2D .
Geo.Sdo_srid,
Mdsys.Sdo_point_type( Geo.Sdo_ordinates( V_count_unknown + 1 ),
-- X ..
Geo.Sdo_ordinates( V_count_unknown + 2 ), -- Y ..
NULL ), -- sdo_point_type(x,y,NULL) .
NULL,
NULL );
ELSE
Resultat :=
Mdsys.Sdo_geometry( 3001, -- GType 3D .
Geo.Sdo_srid,
Mdsys.Sdo_point_type( Geo.Sdo_ordinates( V_count_unknown + 1 ),
-- X ..
Geo.Sdo_ordinates( V_count_unknown + 2 ), -- Y ..
Geo.Sdo_ordinates( V_count_unknown + 3 )), -- Z ..
-- sdo_point_type(x,y,NULL) .
NULL,
NULL );
END IF;
RETURN Resultat;
END IF;
END IF; -- END of Point type ....
Resultat :=
Mdsys.Sdo_geometry( Numd * 1000 + MOD( V_gtype, 1000 ),
-- GType 2D eller 3D .
Geo.Sdo_srid,
NULL, -- sdo_point_type .
Mdsys.Sdo_elem_info_array( ),
Mdsys.Sdo_ordinate_array( ));
IF V_numelem = 0 THEN
RETURN Resultat;
END IF;
IF MOD( Geo.Sdo_gtype, 1000 ) < 7 THEN
V_is_multipolygon := FALSE;
ELSE
V_is_multipolygon := TRUE;
END IF;
I := 1;
V_curpos := 1;
LOOP -- for all the elements ...
V_startpos := Geo.Sdo_elem_info( ( I - 1 ) * 3 + 1 );
-- StartPosition for the ordinates of this element
V_typeelem := Geo.Sdo_elem_info( ( I - 1 ) * 3 + 2 );
-- the pos after StartPosition, ie. eType ...
IF I = V_numelem THEN -- is this the last element ?
V_startposnext := Geo.Sdo_ordinates.COUNT( ) + 1;
ELSE
V_startposnext := Geo.Sdo_elem_info( ( I * 3 ) + 1 );
END IF;
Resultat.Sdo_elem_info.EXTEND( 3 );
Resultat.Sdo_elem_info( ( I - 1 ) * 3 + 1 ) := V_curpos;
-- StartPosition for the ordinates of this element
Resultat.Sdo_elem_info( ( I - 1 ) * 3 + 2 ) :=
Geo.Sdo_elem_info( ( I - 1 ) * 3 + 2 );
-- eType ...;
Resultat.Sdo_elem_info( ( I - 1 ) * 3 + 3 ) :=
Geo.Sdo_elem_info( ( I - 1 ) * 3 + 3 );
-- Interpretation ...;
IF V_typeelem > 0 THEN -- ignore element
IF (NOT V_is_multipolygon )
OR ( V_is_multipolygon
AND I > 1 ) THEN
IF ( V_startposnext > V_startpos + 1 ) THEN
P := V_startpos;
-- p is now the position of the first ordinate for this element
LOOP -- For all ordinates ...
IF Numd = 3 THEN
Resultat.Sdo_ordinates.EXTEND( 3 );
ELSE
Resultat.Sdo_ordinates.EXTEND( 2 );
END IF;
Resultat.Sdo_ordinates( V_curpos ) := Geo.Sdo_ordinates( P );
-- X ...
Resultat.Sdo_ordinates( V_curpos + 1 ) :=
Geo.Sdo_ordinates( P + 1 );
-- Y ...
IF Numd = 3 THEN
Resultat.Sdo_ordinates( V_curpos + 2 ) :=
Geo.Sdo_ordinates( P + 1 );
-- Z ...
END IF;
P := P + V_numdims; -- jump to the next x ordinate
V_curpos := V_curpos + Numd; -- var +2 tidligere
EXIT WHEN P = V_startposnext;
END LOOP;
END IF;
-- ELSE : MULTIPOLYGON does not have its own ordinates
END IF;
ELSE
-- Element has unknown geometry , must copy all ordinates
Resultat.Sdo_ordinates.EXTEND( V_startposnext - V_startpos );
P := V_startpos;
-- p is now the position of the first ordinate for this element
LOOP -- For all ordinates ...
Resultat.Sdo_ordinates( V_curpos ) := Geo.Sdo_ordinates( P );
P := P + 1; -- next ordinate
V_curpos := V_curpos + 1;
EXIT WHEN P = V_startposnext;
END LOOP;
END IF;
I := I + 1;
EXIT WHEN I > V_numelem;
END LOOP;
RETURN Resultat;
EXCEPTION
WHEN OTHERS THEN
Resultat := NULL;
RETURN Resultat;
END Convert_t0;

Similar Messages

  • In the new iOS-7 Safari, has the "reader" function been changed to eliminate the option to modify font size (and hence to modify the number of words per line), or is it just that I can't find how to do that?

    In the new iOS-7 Safari, has the "reader" function been changed to eliminate the option to modify font size (and hence to modify the number of words per line), or is it just that I can't find how to do that?

    iOS 7
    Seperate text size modification is no longer available in Safari Reafer.
    Use Settings.
    Settings >General > Text Size

  • Dynamically modifying the number of Form detail rows

    Hi,
    A challenge for you all!
    I am building a product details system in Portal forms.
    One of the screens is a Product Ingredients form with Product as the master block and ingredients as the Detail block. There can be between 1 and 20 ingredients in any 1 product and as these all have to sum to a volume percentage of 100% the client would like to see all ingredients for a product on 1 screen and not have to do Next/Previous to see them all.
    As you increase detail rows on a master detail form the performance of the form decreases dramatically so I would like to minimise the number of detail rows displayed for each product to maximise performance.
    To this end I wish to dynamically modify the number of detail rows displayed to match the number of ingredients on a product as that product is queried.
    I can handle figuring out how many rows I want to set the page to but have not been able to figure out how to change the number of detail rows displayed at run time.
    Anyone know how (or if!) this is possible ?
    All help gratefully recieved
    Andy

    The rownum pseudo-column hold the number of the row but it doesn't work like you expect. It is assigned before sorting for example and it is not absolute. SQL conceptually deals with sets and sets have no inherent order. See http://www.oracle.com/technology/oramag/oracle/06-sep/o56asktom.html
    If you want to have an absolute number in a row you will need to maintain it yourself with PLSQL code.

  • How do I modify the "Number of Pages" setting for an existing Master Page via javascript?

    I'm learning javascripting for InDesign and I have been tinkering with the stock scripts in the tutorials. I'm developing the ability set properties and such, playing with how Javascript works, and I wanted to change the number of pages in a master page as part of an exercise. Does anyone know how to do this? I have been able to add new masters, controlling the number of pages in them with this:
    myDocument.masterSpreads.add( {pagesPerSpread:2,} )
    but what I really want is to modify the master that InDesign automatically generates with a new document, to have 2 pages. Granted, I can just start off with a document with facing pages, but I don't really see the fun in that...

    Jump_Over wrote:
    Hi,
    check this:
    var mSpread = app.activeDocument.masterSpreads[0],
    count = mSpread.pages.length,
    mSet = 2,
    run = mSet - count;
    // to avoid 0-page error
    mSet = Math.max(mSet,1);
    if (run > 0) {
              while (run --)
              mSpread.pages.add();
    else while (run) {
              mSpread.pages[-1].remove();
              run ++
    edit the variable mSet to modify pages length
    Jarek
    Message was edited by: Jump_Over I added Math.max filter to avoid errors
    Thanks, this is exactly what I wanted. Well, almost. I wish there were a way to simply set the number of pages in a master spread to a specific number the same way there is in the interface, but this will work just as well.

  • Not able to modify the number of horizontal divisional lines in chart

    Hi,
    I have inserted a chart using BI publisher. Currently there are 5 horizontal divisional lines and the y-axis values are divided accordingly. I want to change the number of horizontal divisional lines (maybe 7). I tried to use LocalRelationalData with RowKeyCount but it didn't work.
    Thanks,
    Vijay

    Hi,
    I am facing the same issue for SC with multiple line items
    Rejetced line items can not be edited by requetser on the other hand approved items are appearing for in editable mode
    Any one managed to get solution for the same ??
    Please let me know the solution then..
    thanks
    Regards
    jayesh

  • Modifying the number of records to skip after importing the flat file

    I imported a flat file and the first row was the column header. I also created an external table for that flat file. The sqlldr is skipping the first record during the load. Is there a way to change this in the flat file module or External table?

    If you marked this row as the header in the sample wizard then you will see the following in the External Table:
    ACCESS PARAMETERS (
    RECORDS DELIMITED BY NEWLINE
    CHARACTERSET WE8MSWIN1252
    STRING SIZES ARE IN BYTES
    NOBADFILE
    NODISCARDFILE
    NOLOGFILE
    SKIP 1
    So the external table is skipping this.
    Now the issue with changing it is interesting because you cannot change this after the sampling... I think this is a bug which I will file.
    Let me know if this answers the question,
    Jean-Pierre

  • Modify calling number in SIP invite on CUCM 10.5

    Hello,
    I am working at a customer with CUCM 10.5 who uses MGCP gateways to access the PSTN via T1 PRI ISDN.
    They use four digit DNs internally and need to prefix these with 713657 to make the outbound CLID work ok - i.e. a call to the PSTN from extension 1000 needs to send 7136571000 to the ISDN provider.
    I configured this using Calling Party Transformations and this works fine e.g.
    A Calling Party Transformation for 1XXX would prefix 713657.
    The problem I have is that the customer has a NICE active recording system which communicates with the CUCM cluster using a SIP trunk.
    The invites that CUCM sends via the SIP trunk show the full ten digits rather than the four digit extension which will not work according to company deploying the recording system.
    If I remove the Calling Party Transformation then the SIP invite shows four digits and the call recording works but the outbound CLID does not work.
    Can anyone suggest a way to fix this? The customer does not want to change the gateway protocol from MGCP to H323 which would be my favoured choice. Any change of calling party setting on CUCM (e.g. ticking the use external mask for calling party on route pattern) affects the SIP invite.
    Ideally I need a way to modify the number in the SIP invite but I cannot find any example of how to do this.
    Any suggestions are welcome.
    Thanks

    Hi, thanks for your response.
    The Calling Party Transformation CSS is not applied to the SIP trunk but is applied to the T1 port of the MGCP gateway.
    The Transformations are still applied to the SIP Invite messages via the trunk so I guess this is a quirk of the calling recording profile setup on CUCM.
    I did try creating another Calling Party Transformation setup which stripped the unwanted digits and applied it to the SIP trunk but it had no effect.

  • Modify the process of generating Requisition number in iProcurement

    We have a requirement to generate the Requisition number based on some of the information entered in iProc ( Using DFF) .Since iProc always use the sequence number to generate the number, we will be modifying the out of box functionality to generate the custom Req. Number.
    I have to identify all the objects that i need to modify in iProc ( VO, EO or controller classes ..etc), I was wondering if any one has this information?.
    I got the names of all the objects from 'About page' link and downloading these objects to my client and de compiling them to JAVA files to understand the flow, but this is very time confusing. I was wondering is there is a faster way to get this information.
    Thanks

    You can disable the image sizing portion of the UI and use the updateExportSettings() function on your export service provider to force the image size to your desired size. (This function is not well documented. It takes a single parameter, exportSettings, which you may modify in place before the export starts.) For example (this would go inside your export service provider declaration):
    updateExportSettings = function( exportSettings )
        exportSettings.LR_size_resizeType = 'wh'  -- specific width and height
        exportSettings.LR_maxHeight = 3600
        exportSettings.LR_maxWidth = 5400
    end,
    hideSections = { 'imageSettings' },  -- hide the sizing panel
    However, there is not a way to get Lightroom to render a file that is cropped to a specific aspect ratio. Whatever sizing parameters are specified, we will always honor the aspect ratio of the source file. In your processRenderedFiles function, you could use a third-party tool like Mogrify to regenerate the output file with the fill necessary to satisfy the desired aspect ratio.

  • How can i modify the Requsition number generation process in iProcurment

    We would like to modify the way Oracle generates the requisition number. Did some one do this kind of work and if so what are the files that have to be modified.
    When users enter Requisition in iprocurement , they enter some additional information (Type, Code, Location) using Requsition header level DFF. I need to use this information and construct the Req. Number i.e (For Example 1-3 Digits will location, 4-5 will be code and 6-8 Type).
    I was wondering what files i need to change to generate the Req. Number.
    Any help is appreciated.
    Thanks

    quote:
    Originally posted by:
    Newsgroup User
    probably depends on what you want to replace 'dangerous'
    parts with...
    if you want to remove the 'dangerous' parts leaving other
    parts of same
    field as is, you are looking into regular expressions then -
    but i doubt
    there is any regexp that can deal with ALL 'dangerous'
    entities...
    to make it easier, you could just replace the whole field
    value with
    some default value, i.e. '' (empty string) for text fields, 0
    or some
    other number for integer fields, etc... of course, this has
    to be in
    line with your db schema and your fields must somehow carry
    their type
    metadata in them (i.e. in the field name) so that this
    clean-up process
    can be totally automated.
    there may already be some udf/cfc/framework out there that
    does this to
    some degree, which you can extend as needed... check out
    cflib.org
    and/or adobe cf exchange.
    hth
    Azadi Saryev
    Sabai-dee.com
    http://www.sabai-dee.com/
    Thanks. But I already generate a function (assume Replace())
    to do that. What I don't know is how to use it in application.cfm
    because form.element seems read-only.
    For example, I want to write code like this(but it cannot run
    in coldfusion because left part cannot be function):
    <cfloop collection="#form#" item="formelement">
    <cfset #evaluate(formelement)# =
    Replace(#evaluate(formelement)# ) //so the safe post data can
    continue to post to the website
    </cfif>
    </cfloop>

  • How to modify the port number of j2ee reference?

    hello
    i install the j2ee1.3 on my windows2000 server,after i setup the environment,i iuput the "j2ee -verbose" within the dos window,the following exception is throwed:
    Logging for J2EE Server Version: 1.3.1-b17 started at: Wed Aug 07 19:23:22 CST 2002..
    Using the Java HotSpot(TM) Client VM and the version number 1.3.1 from Sun Microsystems Inc..
    VM is using the classpath: E:\j2sdkee1.3.1\lib\system\cloudscape.jar;E:\j2sdkee1.3.1\lib\system\tools.jar;E:\j2sdkee1.3.1\lib\cloudscape\RmiJdbc.jar;E:\j2sdkee1.3.1\lib\cloudscape\cloudclient.jar;E:\j2sdkee1.3.1\lib\classes;E:\j2sdkee1.3.1\classes;E:\j2sdkee1.3.1\lib\j2ee.jar;E:\j2sdkee1.3.1\lib\toolclasses;E:\j2sdkee1.3.1\lib\j2eetools.jar;E:\j2sdkee1.3.1\lib\locale;;E:\JBuilder6\jdk1.3.1\lib\tools.jar;E:\j2sdkee1.3.1\lib\jhall.jar .
    J2EE Home Directory has been set to: E:\j2sdkee1.3.1.
    java.lang.RuntimeException: Could not initialize j2ee server. Possible cause could be another instance of the server already running.
    at com.sun.enterprise.iiop.POAProtocolMgr.initializeNaming(POAProtocolMgr.java:119)
    at com.sun.enterprise.server.J2EEServer.run(J2EEServer.java:226)
    at com.sun.enterprise.server.J2EEServer.main(J2EEServer.java:972)
    java.lang.RuntimeException: Could not initialize j2ee server. Possible cause could be another instance of the server already running.
    at com.sun.enterprise.iiop.POAProtocolMgr.initializeNaming(POAProtocolMgr.java:119)
    at com.sun.enterprise.server.J2EEServer.run(J2EEServer.java:226)
    at com.sun.enterprise.server.J2EEServer.main(J2EEServer.java:972)
    java.lang.RuntimeException: Could not initialize j2ee server. Possible cause could be another instance of the server already running.
    at com.sun.enterprise.server.J2EEServer.run(J2EEServer.java:346)
    at com.sun.enterprise.server.J2EEServer.main(J2EEServer.java:972)
    J2EE server reported the following error: Could not initialize j2ee server. Possible cause could be another instance of the server already running.
    Error executing J2EE server ...
    it seem like that the "1050" port is in using by other program,but i don't know which one,i think i should modify the j2ee reference to use other port,how can i do that?
    thank you very much!

    This certainly fixed the problem I was having when all of a sudden my j2ee server would no longer open. However, this raised a new question for me which is somewhat of an off-shoot to this problem - how does one select a new port#? Is there some rule of thumb? Just wondering.
    Thanks! Janet

  • How to modify the port number and use subdomains

    Couple of things ...
    1 - default port for installation is on 7777 and 7778. Would it be possible to run everything on port 80? I would like to hide the port number and not have people type in http://domain.com:7778
    2 - how can we use subdomains for certain services? For example, webmail should be http://webmail.domain.com and the RTC should be http://conference.biztech.com
    thx

    we're using OCS both inside and outside our network.
    I had my dba modify the port so now everything runs on port 80. However, I dont know how to get virtualhost to work correctly.
    conference.domain.com -> RTC piece
    webmail.domain.com -> webmail piece
    i.e....

  • Service Desk Mail - Modify the subject -adding ticket number and descriptio

    Hello,
    I have activated the automatic sending of email when a new ticket arrives into the Service Desk. I am using the standard notifcation smartform  However all the mails arrive in the inbox with the same subject, so no possibility of making a quick identification of the ticket.
    I heard that is possible to add additional fields in the subject of the mail using some "&" parameters.  However I do not have a clue where to modify and what type of & parameters are available.  Is that I need to copy and modify the smart form somewhere??
    I appreciate your inputs.
    Regards
    Esteban Hartzstein

    Hi Esteban,
    The subject line corresponds to the name of the smart form that you can maintain in the "description" field in the sap form builder. you can add dinamyc parameters to the subject by using the placeholder "&". e.g.: & | Action Required.
    On se24, copy the class CL_DOC_PROCESSING_CRM_ORDER into the customer workspace (ZCL_DOC_PROCESSING_CRM_ORDER). then edit it and navigate to line 185 and change the following:
    REPLACE '&' WITH ls_orderadm_h-object_id INTO ls_output_options- tdtitle.
    Other example to use as subject:
    Object ID + Priority + Description
    Field description value: &1 | &2 | &3
    On the class:
    REPLACE '&1' WITH ls_orderadm_h-object_id INTO ls_output_options- tdtitle.
    REPLACE '&2' WITH ls_activity_h-priority INTO ls_output_options- tdtitle.
    REPLACE '&3' WITH ls_orderadm_h-description INTO ls_output_options- tdtitle.
    More information on this on the book: SAP Solution Manager Service Desk - Functionality and Implementation
    Hope I can help.
    Regards,
    Ricardo

  • Ibooks you see Total number of Books or the Total size of the Library, Nor Modify The Listed Information?

    When all of my ebooks, pdf's etc were located in itunes I could see down in the status bar that I had 453 books and the size of the library was 5 GBs. Now in the Ibook app I can no longer see or view this information. Also in Itunes you could modify the Author, Catagory, Title etc. in Ibooks you can't, You also can't use "show in finder" to see the actual file and library. If any of you know how to do these things please explain it to me?

    From the "View" menu:
    View > Show Status bar
    This will show the Status bar at the bottom of the window, assuming you are now using iTune 11.

  • Would it be faster to use a trigger or modify the insert query?

    We have a table that currently has latitude, longitude columns and are trying to decide what route to go as far as adding spatial data to future records. A spatial index will be placed on the new column.
    There appear to be 3 solutions:
    1 Create a materialized view which creates the spatial column based on the current latitude and longitude columns.
    2 Create a trigger on the table that will populate the new spatial column on insert/update.
    3 Modify the code to insert a spatial value into the new spatial column.
    Due to the nature of the data we are not willing to use method 1.
    What we are trying to figure out is which method, 2 or 3, will insert faster.
    Has anyone done tests to determine if an insert with a spatial object is slower than an insert on a table with a trigger that creates a spatial object?
    Thanks,
    Pat

    Pat,
    Note that you don't need to store latitude, longitude in sdo_geometry type in order to spatially index it. Instead you can create a function that returns an sdo_geometry based on two numeric columns, then create a function based index on that. Its described here:
    http://download.oracle.com/docs/cd/E11882_01/appdev.112/e11830/sdo_exten.htm#i1005799
    Also note that in the sdo_geometry type, you need to define the data as longitude/latitude and not the other way around.
    If you do want to create a column with sdo_geometry column, I'd recommend your third option. As a general principle I avoid triggers unless absolutely necessary. Triggers invariably lead to confusion when you (or someone else) revisits this code in the future. Also the change of context between and SQL and PL/SQL has a performance hit. Here's a simple test:
    SQL> CREATE TABLE long_lat_no_trigger (
      2     geometry                SDO_GEOMETRY);
    Table created.
    SQL>
    SQL> CREATE TABLE long_lat_with_trigger (
      2     longitude               NUMBER,
      3     latitude                NUMBER,
      4     geometry                SDO_GEOMETRY);
    Table created.
    SQL>
    SQL> CREATE OR REPLACE TRIGGER long_lat_to_geometry
      2  BEFORE INSERT ON long_lat_with_trigger FOR EACH ROW
      3  DECLARE
      4  BEGIN
      5     :new.geometry := SDO_GEOMETRY(2001, 8307, SDO_POINT_TYPE(
      6     :new.longitude, :new.latitude, NULL), NULL, NULL);
      7  END;
      8  /
    Trigger created.
    SQL>
    SQL> SET TIMING ON
    SQL> INSERT INTO long_lat_no_trigger (geometry) (
      2     SELECT
      3     SDO_GEOMETRY(2001, 8307, SDO_POINT_TYPE(
      4     dbms_random.value(0,180), dbms_random.value(0,90),
      5     NULL), NULL, NULL)
      6     FROM DUAL
      7     CONNECT BY LEVEL <= 1000000);
    1000000 rows created.
    Elapsed: 00:00:31.96
    SQL>
    SQL> INSERT INTO long_lat_with_trigger (longitude, latitude) (
      2     SELECT
      3     dbms_random.value(0,180),
      4     dbms_random.value(0,90)
      5     FROM DUAL
      6     CONNECT BY LEVEL <= 1000000);
    1000000 rows created.
    Elapsed: 00:01:21.15Cheers,
    John

  • Not able to modify the data for infotype 0008 using FM

    Hi All ,
    I have got a requirement for updating the infotype 0008 data  using FM : HR_MAINTAIN_MASTER_DATA.
    While trying to modify the wagetypes data which is of blank ..unable to upload the amount for that partcular field ..
    For this am herewith the link  of o/p :
    http://i55.tinypic.com/28jfw2c.jpg for this am also posting the code...
    Please suggest me furthur in what way i can upload..
          SELECT * FROM pa0008 INTO TABLE itab_pa0008
    FOR ALL ENTRIES IN itab
        WHERE pernr = wa_data-pernr
        AND begda = wa_data-begda_out
        AND endda = wa_data-endda_out.
        DESCRIBE TABLE itab_pa0008 LINES lin.
        IF lin EQ  0.
          c_action = 'INS'.
        ELSE.
          c_action = 'MOD'.
        ENDIF.
        LOOP AT itab INTO wa_itab WHERE pernr = wa_data-pernr.
          CLEAR: wa_bapireturn, wa_bapireturn1, wa_hr_return.
          REFRESH: it_pprop[],it_modified_keys[].
          it_pprop-infty = '0008'.
          it_pprop-fname  = 'P0008-TRFAR'.                 "1
          it_pprop-fval = wa_itab-trfar.
          APPEND it_pprop.
          CLEAR it_pprop.
          it_pprop-infty = '0008'.
          it_pprop-fname  = 'P0008-TRFGB'.                 "2
          it_pprop-fval = wa_itab-trfgb.
          APPEND it_pprop.
          CLEAR it_pprop.
          it_pprop-infty = '0008'.
          it_pprop-fname  = 'P0008-TRFGR'.                  "3
          it_pprop-fval = wa_itab-trfgr.
          APPEND it_pprop.
          CLEAR it_pprop.
          it_pprop-infty = '0008'.
          it_pprop-fname  = 'P0008-TRFST'.                  "4
          it_pprop-fval = wa_itab-trfst.
          APPEND it_pprop.
          CLEAR it_pprop.
          flag = flag + 1.
    *****************************************************************************************************5
          BREAK-POINT.
          IF NOT wa_itab-lga1 IS INITIAL.
            it_pprop-infty = '0008'.
            it_pprop-fname  = 'P0008-LGA01'.
            it_pprop-fval = wa_itab-lga1.
            APPEND it_pprop.
            CLEAR it_pprop.
            bet1 = wa_itab-bet1.
          ENDIF.
          IF NOT wa_itab-bet1 IS INITIAL.
            it_pprop-infty = '0008'.
            it_pprop-fname  = 'P0008-BET01'.
            it_pprop-fval = wa_itab-bet1.
            APPEND it_pprop.
            CLEAR it_pprop.
          ENDIF.
    *******************************************************************************************************6
         IF NOT wa_itab-lga2 IS INITIAL.
           it_pprop-infty = '0008'.
           it_pprop-fname  = 'P0008-LGA02'.
           it_pprop-fval = wa_itab-lga2.
           APPEND it_pprop.
           CLEAR it_pprop.
           bet1 = wa_itab-bet2.
         ENDIF.
          IF NOT wa_itab-bet2 IS INITIAL.
            it_pprop-infty = '0008'.
            it_pprop-fname  = 'P0008-BET02'.
            it_pprop-fval = wa_itab-bet2.
            APPEND it_pprop.
            CLEAR it_pprop.
          ENDIF.
    *******************************************************************************************************7
          IF NOT wa_itab-lga3 IS INITIAL.
            it_pprop-infty = '0008'.
            it_pprop-fname  = 'P0008-LGA03'.
            it_pprop-fval = wa_itab-lga3.
            APPEND it_pprop.
            CLEAR it_pprop.
            bet1 = wa_itab-bet2.
          ENDIF.
          IF NOT wa_itab-bet3 IS INITIAL.
            it_pprop-infty = '0008'.
            it_pprop-fname  = 'P0008-BET03'.
            it_pprop-fval = wa_itab-bet3.
            APPEND it_pprop.
            CLEAR it_pprop.
          ENDIF.
    *******************************************************************************************************8
          IF NOT wa_itab-lga4 IS INITIAL.
            it_pprop-infty = '0008'.
            it_pprop-fname  = 'P0008-LGA04'.
            it_pprop-fval = wa_itab-lga4.
            APPEND it_pprop.
            CLEAR it_pprop.
            bet1 = wa_itab-bet2.
          ENDIF.
          IF NOT wa_itab-bet4 IS INITIAL.
            it_pprop-infty = '0008'.
            it_pprop-fname  = 'P0008-BET04'.
            it_pprop-fval = wa_itab-bet4.
            APPEND it_pprop.
            CLEAR it_pprop.
          ENDIF.
    *******************************************************************************************************9
          IF NOT wa_itab-lga5 IS INITIAL.
            it_pprop-infty = '0008'.
            it_pprop-fname  = 'P0008-LGA05'.
            it_pprop-fval = wa_itab-lga5.
            APPEND it_pprop.
            CLEAR it_pprop.
            bet1 = wa_itab-bet2.
          ENDIF.
          IF NOT wa_itab-bet5 IS INITIAL.
            it_pprop-infty = '0008'.
            it_pprop-fname  = 'P0008-BET05'.
            it_pprop-fval = wa_itab-bet5.
            APPEND it_pprop.
            CLEAR it_pprop.
          ENDIF.
    *******************************************************************************************************10
          IF NOT wa_itab-lga6 IS INITIAL.
            it_pprop-infty = '0008'.
            it_pprop-fname  = 'P0008-LGA06'.
            it_pprop-fval = wa_itab-lga6.
            APPEND it_pprop.
            CLEAR it_pprop.
            bet1 = wa_itab-bet2.
          ENDIF.
          IF NOT wa_itab-bet6 IS INITIAL.
            it_pprop-infty = '0008'.
            it_pprop-fname  = 'P0008-BET06'.
            it_pprop-fval = wa_itab-bet6.
            APPEND it_pprop.
            CLEAR it_pprop.
          ENDIF.
    *******************************************************************************************************11
          IF NOT wa_itab-lga7 IS INITIAL.
            it_pprop-infty = '0008'.
            it_pprop-fname  = 'P0008-LGA07'.
            it_pprop-fval = wa_itab-lga7.
            APPEND it_pprop.
            CLEAR it_pprop.
            bet1 = wa_itab-bet2.
          ENDIF.
          IF NOT wa_itab-bet7 IS INITIAL.
            it_pprop-infty = '0008'.
            it_pprop-fname  = 'P0008-BET07'.
            it_pprop-fval = wa_itab-bet7.
            APPEND it_pprop.
            CLEAR it_pprop.
          ENDIF.
    *******************************************************************************************************12
          IF NOT wa_itab-lga8 IS INITIAL.
            it_pprop-infty = '0008'.
            it_pprop-fname  = 'P0008-LGA08'.
            it_pprop-fval = wa_itab-lga8.
            APPEND it_pprop.
            CLEAR it_pprop.
            bet1 = wa_itab-bet2.
          ENDIF.
          IF NOT wa_itab-bet8 IS INITIAL.
            it_pprop-infty = '0008'.
            it_pprop-fname  = 'P0008-BET08'.
            it_pprop-fval = wa_itab-bet8.
            APPEND it_pprop.
            CLEAR it_pprop.
          ENDIF.
    *******************************************************************************************************13
          IF NOT wa_itab-lga9 IS INITIAL.
            it_pprop-infty = '0008'.
            it_pprop-fname  = 'P0008-LGA09'.
            it_pprop-fval = wa_itab-lga9.
            APPEND it_pprop.
            CLEAR it_pprop.
            bet1 = wa_itab-bet2.
          ENDIF.
          IF NOT wa_itab-bet9 IS INITIAL.
            it_pprop-infty = '0008'.
            it_pprop-fname  = 'P0008-BET09'.
            it_pprop-fval = wa_itab-bet9.
            APPEND it_pprop.
            CLEAR it_pprop.
          ENDIF.
    *******************************************************************************************************14
          IF NOT wa_itab-lga10 IS INITIAL.
            it_pprop-infty = '0008'.
            it_pprop-fname  = 'P0008-LGA010'.
            it_pprop-fval = wa_itab-lga10.
            APPEND it_pprop.
            CLEAR it_pprop.
            bet1 = wa_itab-bet2.
          ENDIF.
          IF NOT wa_itab-bet10 IS INITIAL.
            it_pprop-infty = '0008'.
            it_pprop-fname  = 'P0008-BET010'.
            it_pprop-fval = wa_itab-bet10.
            APPEND it_pprop.
            CLEAR it_pprop.
          ENDIF.
    *******************************************************************************************************15
       it_pprop-infty = '0008'.
       it_pprop-fname  = 'P0008-LGA11'.
       it_pprop-fval = wa_itab-lga11.
       APPEND it_pprop.
       CLEAR it_pprop.
       bet1 = wa_itab-bet2.
       it_pprop-infty = '0008'.
       it_pprop-fname  = 'P0008-BET11'.
       it_pprop-fval = wa_itab-bet11.
       APPEND it_pprop.
       CLEAR it_pprop.
    ********************************************************************************************************16
       it_pprop-infty = '0008'.
       it_pprop-fname  = 'P0008-LGA12'.
       it_pprop-fval = wa_itab-lga12.
       APPEND it_pprop.
       CLEAR it_pprop.
       bet1 = wa_itab-bet2.
       it_pprop-infty = '0008'.
       it_pprop-fname  = 'P0008-BET12'.
       it_pprop-fval = wa_itab-bet12.
       APPEND it_pprop.
       CLEAR it_pprop.
    ********************************************************************************************************17
       it_pprop-infty = '0008'.
       it_pprop-fname  = 'P0008-LGA13'.
       it_pprop-fval = wa_itab-lga13.
       APPEND it_pprop.
       CLEAR it_pprop.
       bet1 = wa_itab-bet2.
       it_pprop-infty = '0008'.
       it_pprop-fname  = 'P0008-BET13'.
       it_pprop-fval = wa_itab-bet13.
       APPEND it_pprop.
       CLEAR it_pprop.
    ********************************************************************************************************18
       it_pprop-infty = '0008'.
       it_pprop-fname  = 'P0008-LGA14'.
       it_pprop-fval = wa_itab-lga14.
       APPEND it_pprop.
       CLEAR it_pprop.
       bet1 = wa_itab-bet2.
       it_pprop-infty = '0008'.
       it_pprop-fname  = 'P0008-BET14'.
       it_pprop-fval = wa_itab-bet14.
       APPEND it_pprop.
       CLEAR it_pprop.
    BREAK-POINT.
          CALL FUNCTION 'BAPI_EMPLOYEE_ENQUEUE'
            EXPORTING
              number = wa_itab-pernr
            IMPORTING
              return = wa_bapireturn1.
          BREAK-POINT.
         IF c_action = 'INS'.
           CALL FUNCTION 'HR_MAINTAIN_MASTERDATA'
             EXPORTING
               pernr           = wa_itab-pernr
               actio           = 'INS'
             tclas           = 'A'
               begda           = wa_data-begda_out             "'20110401'
               endda           = wa_data-endda_out             "'99991231'
               dialog_mode     = '2'
             luw_mode        = '1'
             IMPORTING
               return          = wa_bapireturn
               return1         = wa_bapireturn1
               hr_return       = wa_hr_return
             TABLES
               proposed_values = it_pprop
               modified_keys   = it_modified_keys.
           IF NOT wa_bapireturn IS INITIAL.
             WRITE : / wa_bapireturn.
             CLEAR : wa_itab , wa_bapireturn.
           ENDIF.
         ELSEIF c_action = 'MOD'.
            CALL FUNCTION 'HR_MAINTAIN_MASTERDATA'
              EXPORTING
             infty         = '0008'
                pernr           = wa_itab-pernr
                actio           = 'MOD'
                begda           = wa_data-begda_out             "'20110401'
                endda           = wa_data-endda_out             "'99991231'
          record        =  p_record
             recordnumber  = wa_itab-SEQNR
             operation     = change
             nocommit      = nocommit
                dialog_mode     = '0'
             IMPORTING
                return          = wa_bapireturn
                return1         = wa_bapireturn1
                hr_return       = wa_hr_return
              TABLES
                proposed_values = it_pprop
                modified_keys   = it_modified_keys.
            IF NOT wa_bapireturn IS INITIAL.
              WRITE : / wa_bapireturn.
              CLEAR : wa_itab , wa_bapireturn.
            ENDIF.
         ENDIF.
          CALL FUNCTION 'BAPI_EMPLOYEE_DEQUEUE'
            EXPORTING
              number = wa_itab-pernr
            IMPORTING
              return = wa_bapireturn1.
        ENDLOOP.
      ENDLOOP.

    Here is a sampe, and the logic you are using for wages goes in the internal table for wages (you already have the enqueue & dequeue so you don't have to worry about that, so you only have to add the BAPI_TRANSACTION_COMMIT):
    CALL FUNCTION 'BAPI_BASICPAY_CHANGE'
      EXPORTING
        employeenumber             = pa0008-pernr
        subtype                    = pa0008-subty
        objectid                   = pa0008-objps
        lockindicator              = pa0008-sprps
        validitybegin              = pa0008-begda
        validityend                = pa0008-endda
        recordnumber               = pa0008-seqnr
        payscaletype               = pa0008-trfar
        payscalearea               = pa0008-trfgb
        payscalegroup              = pa0008-trfgr
        payscalelevel              = pa0008-trfst
    *   NEXTINCREASE               =
    *   LOCALALLOWLEVEL            =
    *   PARTNERSHIP                =
    *   CURRENCY                   =
    *   COMPARISONPAYSCLTYPE       =
    *   COMPARISONPAYSCLAREA       =
    *   COMPARISONPAYSCLGRP        =
    *   COMPARISONPAYSCLLVL        =
    *   COMPNEXTINCREASE           =
    *   CAPACITYUTILLEVEL          =
    *   HOURSWORKEDPERPERIOD       =
    *   ANNUALSALARY               =
    *   CASEGROUPCATALOG           =
    *   CASEGROUP                  =
    *   CURRENCYANNUALSALARY       =
    *   REASON                     =
    *   NOCOMMIT                   =
    * importing
    *   return                     =
    TABLES
       wagetypes                  = wages.
    Regards,
    Ryan Crosby

Maybe you are looking for