How to query geography data type?

Hello
In my db i create table having geography type column and insert location detail (lat & lon) using point method. How can i do query for getting that location in my console application?
and also i try this got an error?

It looks like you chose one line (the one beginning with "set") and ran it, stand-alone, in an SSMS query window. You need to run all 3 lines of code (i.e don't select any particular line, and hit the Run button). Or select all 3 lines and hit
the Run button.
What the error message says is that you are trying to use the variable @g without defining it. This could only mean that you're running only line 2 (the highlighted line).
The lifetime of a SQL variable (@g) is one-batch long, a variable goes out of scope at the end of the batch. So running each line as a separate batch won't work with SSMS. You need to run them all at once.
Cheers, Bob

Similar Messages

  • How to use same Data Type and Length for two fields

    How to use same data type and length for two fields when using 'FOR ALL ENTRIES IN' in a select statement? For instance the select queries are :
    SELECT bukrs gjahr belnr lifnr budat bldat zlspr dmbtr waers shkzg
    FROM bsik
    INTO TABLE it_bsik
    WHERE bukrs = p_bukrs
    AND lifnr IN s_lifnr.
    IF it_bsik IS NOT INITIAL.
    SELECT belnr gjahr awkey awtyp
    FROM bkpf
    INTO TABLE it_bkpf
    FOR ALL ENTRIES IN it_bsik
    WHERE belnr = it_bsik-belnr
    AND gjahr = it_bsik-gjahr.
    IF it_bkpf IS NOT INITIAL.
    SELECT belnr gjahr lifnr xblnr
    FROM rbkp
    INTO TABLE it_rbkp
    FOR ALL ENTRIES IN it_bkpf
    WHERE belnr = it_bkpf-awkey+0(10)
    AND gjahr = it_bkpf-awkey+10(4).
    ENDIF.
    ENDIF.
    Here it gives an error in the 3rd select query that 'When you use the addition "FOR ALL ENTRIES IN itab", the fields "GJAHR" and "IT_BKPF2-AWKEY+10(4)" must have the same type and the same length.'
    Kindly clarify.

    Hi Saurabh,
    Please see the example code that I have developed for you. It will help you solve the problem.
    REPORT ZTEST_3 .
    tables : BKPF.
    data : begin of it_bkpf occurs 1,
             belnr type RE_BELNR,
             awkey type awkey,
             awtyp type awtyp,
             gjahr type GJAHR,
           end of it_bkpf.
    data : begin of it_bkpf1 occurs 1,
             belnr type RE_BELNR,
             awkey type gjahr,              " change the data type
             awtyp type awtyp,
             gjahr type GJAHR,
           end of it_bkpf1.
    data : begin of it_rbkp occurs 1,
             belnr type BELNR_D,
             gjahr type gjahr,
             lifnr type LIFRE,
             xblnr type XBLNR,
           end of it_rbkp.
    select belnr
           awkey
           awtyp
           gjahr
           from bkpf
           into table it_bkpf
           where BUKRS = 'TELH'.
    loop at it_bkpf.
    it_bkpf1-belnr = it_bkpf-belnr.
    it_bkpf1-awkey = it_bkpf-awkey+10(4).           "Here only append the required length.
    it_bkpf1-awtyp = it_bkpf-awtyp.
    it_bkpf1-gjahr = it_bkpf-gjahr.
    append it_bkpf1.
    clear it_bkpf1.
    endloop.
    select  belnr
            gjahr
            lifnr
            xblnr
            from RBKP
            into table it_rbkp
            for all entries in it_bkpf1
            where belnr = it_bkpf1-belnr
    This is just an example. Change the fields according to your requirement.
    Regards
    Abhii
    Edited by: Abhii on Mar 9, 2011 9:08 AM

  • How to find the Data Type of a column

    Dear All,
    How to find the Data Type of a Column dynamically in oracle Form.
    Thanks and Regards,
    Fazil
    Edited by: user11334489 on Aug 25, 2012 9:06 PM

    hi,
    you can use get_item_property built-in
    eg:
    declare
       l_item VARCHAR2(10);
    begin
       l_item := Get_Item_Property('item_name',DATATYPE);
    end;

  • How to add TIMESTAMP data type in  Enterprise Architect...?

    Hi all
    There is no data type of timestamp in Enterprise Architech. There is only
    DATE type. I have ERD prepared from Enterprise Architech. How to modify
    DATE type to TIMESTAMP type.
    How to add TIMESTAMP data type in Enterprise Architect or in ERD ?
    Thanks in advance,
    Pal

    Have you asked this question of the vendor of Enterprise Architect? They may have a later version that supports the various TIMESTAMP data types. If your ERD tool doesn't support a data type, other than talking to the vendor or working around the problem (i.e. generate DDL to a text file and edit it before applying it to the database), you're probably out of luck.
    Justin

  • How to query XML data stored in a CLOB column

    I don't know XMLDB, so I have a dumb question about querying XML data which is saved as CLOB in a table.
    I have a table (OLAP_AW_PRC), with a CLOB column - AW_XML_TMPL_VAL
    This column contains this xml data - [click here|http://www.nasar.net/aw.xml]
    Now I want to query the data using the xml tags - like returning the name of AW. This is where I am having trouble, how to query the data from AW_XML_TMPL_VAL clob column.
    The following query generates error:
    ORA-31011: XML parsing failed.
    ORA-19202: Error occurred in XML processing
    LPX-00229: input source is empty
    SELECT
    extractValue(value(x), '/AW/LongName') as "AWNAME"
    from
    OLAP_AW_PRC,
    table(xmlsequence(extract (xmltype(AW_XML_TMPL_VAL), '/AWXML/AWXML.content/Create/ActiveObject/AW'))) x
    where
    extractValue(value(x) , '/AW/Name') = 'OMCR4'
    - Nasar

    Mark,
    Thanks. This is exactly what I was looking for.
    After doing @Name in both places (SELECT and WHERE clause) it worked.
    Now I have one more question.
    There are multiple DIMENSION tags in my xml, and I want to see the NAME attribute values for all of those DIMENSIONs. The following query returns
    ORA-19025: EXTRACTVALUE returns value of only one node.
    Cause: Given XPath points to more than one node.
    Action: Rewrite the query so that exactly one node is returned.
    SELECT
    extractValue(value(x), '/AW/@Name') as "AW",
    extractValue(value(x), '/AW/Dimension/@Name') as "DIMENSIONS"
    from
    OLAP_AW_PRC,
    table(xmlsequence(extract (xmltype(AW_XML_TMPL_VAL), '/AWXML/AWXML.content/Create/ActiveObject/AW'))) x
    where
    extractValue(value(x) , '/AW/@Name') = 'OMCR4'

  • How to read XI Data type in Java code and populate as array list, using UDF

    Hi,
    How to read XI Data type in Java code and populate as array list, using UDF?
    Is there any API using which  the XI data types can be read?
    Kindly reply.
    Richa

    Input Structure:
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:CustomerCreateResp xmlns:ns0="urn:bp:xi:up:re:cust_mdm:cmdm:pr5:100">
       <CUSTOMER>
          <item>
             <CUSTOMERNO/>
             <MDMCUSTOMER/>
             <CREATE_DATE/>
             <RETURN>
                <TYPE/>
                <MESSAGE/>
             </RETURN>
             <PT_CONTPART_RETURN>
                <item>
                   <MDM_CONTACT/>
                   <CONTACT/>
                </item>
             </PT_CONTPART_RETURN>
             <PARTNERS>
                <item>
                   <CUSTOMERNO/>
                   <PARTNER_FUNCTION/>
                   <PARTNER_NUMBER/>
                   <DEFAULT_PARTNER/>
                </item>
             </PARTNERS>
          </item>
       </CUSTOMER>
    </ns0:CustomerCreateResp>
    Output structure
    (Sample output structure.This actually needs to be mapped and generated using UDF)
    <?xml version="1.0" encoding="UTF-8"?>
    <ns1:updateCustomer xmlns:ns1="urn:xiSericeVi"><ns1:customer><ns2:ArrayList xmlns:ns2="java:sap/standard">[]</ns2:ArrayList></ns1:customer><ns1:name>2344566</ns1:name></ns1:updateCustomer>

  • Geography data type: GeomFromGml

    I have troubles to load data into a geography data type:
    DECLARE @g geography;
    DECLARE @x xml;
    SET @x = '<gml:MultiSurface gml:id="HVO.20584" srsName="urn:ogc:def:crs:EPSG::5514" srsDimension="2" xmlns:gml="http://www.opengis.net/gml/3.2">
    <gml:surfaceMember>
    <gml:Polygon gml:id="HVO.20584.1">
    <gml:exterior>
    <gml:LinearRing>
    <gml:posList>-747267.00 -1056204.00 -747226.00 -1056232.00 -747239.00 -1056253.00 -747251.00 -1056278.00 -747267.00 -1056315.00 -747291.00 -1056365.00 -747337.00 -1056470.00 -747311.00 -1056474.00 -747244.00 -1056475.00 -747155.00 -1056467.00 -747077.00 -1056501.00 -747112.00 -1057366.00 -747263.00 -1057857.00 -747263.20 -1057857.05 -747263.30 -1057856.60 -747272.50 -1057858.50 -747276.10 -1057850.21 -747285.47 -1057849.89 -747295.34 -1057849.55 -747308.73 -1057848.34 -747320.38 -1057847.28 -747346.97 -1057857.70 -747358.66 -1057860.00 -747374.12 -1057860.55 -747386.06 -1057860.19 -747407.98 -1057859.54 -747444.60 -1057874.26 -747447.75 -1057879.52 -747454.57 -1057890.92 -747674.02 -1057865.46 -747851.54 -1057841.44 -747855.78 -1057838.67 -747871.68 -1057851.47 -747902.20 -1057870.55 -747916.06 -1057881.32 -747934.07 -1057891.87 -747960.03 -1057915.53 -747985.14 -1057954.40 -748001.13 -1057977.02 -748021.22 -1058003.59 -748088.58 -1058092.68 -748104.73 -1058095.49 -748166.00 -1058032.60 -748193.50 -1058002.40 -748214.40 -1057982.20 -748216.40 -1057988.60 -748293.20 -1058053.20 -748297.14 -1058050.03 -748302.55 -1058045.67 -748306.53 -1058042.47 -748311.89 -1058038.15 -748316.50 -1058034.44 -748320.83 -1058030.95 -748330.04 -1058023.54 -748332.15 -1058021.83 -748337.10 -1058017.85 -748341.39 -1058014.39 -748353.30 -1058004.80 -748347.67 -1057996.70 -748338.28 -1057981.31 -748335.70 -1057977.29 -748332.12 -1057971.71 -748330.30 -1057968.92 -748325.55 -1057961.32 -748317.05 -1057947.55 -748310.89 -1057935.02 -748307.10 -1057924.52 -748302.70 -1057912.35 -748298.54 -1057900.12 -748295.48 -1057891.13 -748286.20 -1057862.27 -748278.37 -1057838.25 -748276.55 -1057834.04 -748267.49 -1057808.20 -748264.92 -1057798.33 -748262.21 -1057787.93 -748254.57 -1057761.59 -748251.89 -1057752.13 -748247.59 -1057736.93 -748240.11 -1057716.13 -748237.47 -1057685.67 -748234.93 -1057657.42 -748234.51 -1057652.51 -748234.98 -1057625.54 -748234.51 -1057622.46 -748231.40 -1057602.21 -748233.13 -1057596.29 -748234.13 -1057592.87 -748237.61 -1057582.60 -748238.48 -1057580.02 -748249.72 -1057571.70 -748250.10 -1057571.42 -748252.39 -1057569.73 -748256.83 -1057563.57 -748258.55 -1057540.99 -748250.24 -1057535.67 -748250.94 -1057526.41 -748243.01 -1057522.35 -748236.51 -1057522.75 -748234.73 -1057522.86 -748230.54 -1057518.95 -748211.65 -1057501.36 -748199.48 -1057493.59 -748189.98 -1057489.26 -748179.90 -1057484.66 -748168.54 -1057470.65 -748168.29 -1057470.34 -748165.98 -1057467.49 -748157.92 -1057458.13 -748147.31 -1057450.99 -748146.04 -1057423.54 -748145.40 -1057410.42 -748144.91 -1057400.47 -748144.08 -1057372.43 -748142.62 -1057348.91 -748142.48 -1057347.16 -748141.05 -1057329.37 -748142.26 -1057321.94 -748146.21 -1057304.13 -748148.14 -1057295.42 -748146.30 -1057289.44 -748144.73 -1057284.34 -748141.64 -1057275.31 -748144.63 -1057272.64 -748154.01 -1057247.80 -748151.29 -1057246.55 -748127.50 -1057235.56 -748110.70 -1057228.23 -748082.39 -1057214.75 -748057.48 -1057203.76 -748041.82 -1057196.01 -748029.14 -1057189.74 -748010.10 -1057178.36 -747979.25 -1057161.25 -747957.25 -1057147.63 -747943.14 -1057138.66 -747937.35 -1057131.26 -747926.97 -1057121.60 -747909.48 -1057109.13 -747904.01 -1057106.36 -747895.25 -1057106.99 -747873.33 -1057094.64 -747869.74 -1057093.00 -747851.77 -1057082.31 -747869.79 -1057044.54 -747836.92 -1057032.09 -747795.65 -1057016.73 -747793.70 -1057009.93 -747787.82 -1056992.87 -747781.28 -1056974.44 -747776.81 -1056960.35 -747768.14 -1056933.57 -747762.16 -1056911.71 -747757.80 -1056895.21 -747753.30 -1056877.50 -747749.17 -1056859.18 -747744.25 -1056838.69 -747741.79 -1056821.91 -747739.99 -1056803.90 -747737.12 -1056781.92 -747735.82 -1056761.48 -747735.01 -1056740.42 -747736.57 -1056718.66 -747738.55 -1056694.68 -747741.17 -1056669.07 -747744.02 -1056634.01 -747745.17 -1056623.46 -747748.09 -1056596.69 -747755.37 -1056564.46 -747759.01 -1056547.20 -747761.29 -1056536.38 -747761.56 -1056535.10 -747772.54 -1056491.85 -747774.05 -1056485.90 -747786.35 -1056435.41 -747786.99 -1056433.22 -747796.41 -1056400.93 -747799.01 -1056392.00 -747799.01 -1056392.00 -747799.00 -1056392.00 -747723.00 -1056390.00 -747615.00 -1056374.00 -747596.00 -1056372.00 -747564.00 -1056375.00 -747539.00 -1056382.00 -747513.00 -1056389.00 -747487.00 -1056344.00 -747472.00 -1056316.00 -747458.00 -1056290.00 -747455.00 -1056283.00 -747445.00 -1056265.00 -747433.00 -1056243.00 -747424.00 -1056225.00 -747420.00 -1056218.00 -747412.00 -1056205.00 -747399.00 -1056188.00 -747388.00 -1056173.00 -747383.00 -1056167.00 -747371.00 -1056154.00 -747370.00 -1056153.00 -747362.00 -1056145.00 -747356.00 -1056141.00 -747356.00 -1056140.00 -747334.00 -1056160.00 -747267.00 -1056204.00</gml:posList>
    </gml:LinearRing>
    </gml:exterior>
    </gml:Polygon>
    </gml:surfaceMember>
    </gml:MultiSurface>';
    SET @g = geography::GeomFromGml(@x, 4326);
    I get this exception:
    A .NET Framework error occurred during execution of user-defined routine or aggregate "geography": System.FormatException: 24129: The given XML instance is not valid because the top-level tag is gml:MultiSurface. The top-level element of the input
    Geographic Markup Language (GML) must contain a Point, LineString, Polygon, MultiPoint, MultiGeometry, MultiCurve, MultiSurface, Arc, ArcString, CompositeCurve, PolygonPatch or FullGlobe (geography Data Type only) object.
    What do I need to change in the @x variable
    to get it working? 
    The example data above come from government provided source and should be some small part of Czech Republic. I need to store them in MSSQL table.
    Thanks for suggestons.

    Hi,
    1. First use http://www.opengis.net/gml namespace, not the http://www.opengis.net/gml/3.2
    2. remove extra parameters from top level tag
    gml:id="HVO.20584" srsName="urn:ogc:def:crs:EPSG::5514" srsDimension="2"
    3. Your data is not correct!
    Read the Error and fix the data in the the <gml:posList> tag
    Latitude values must be between -90 and 90 degrees.
    here is example:
    DECLARE @g geography;
    DECLARE @x xml;
    SET @x = '
    <gml:MultiSurface xmlns:gml="http://www.opengis.net/gml">
    <gml:surfaceMember>
    <gml:Polygon>
    <gml:exterior>
    <gml:LinearRing>
    <gml:posList>
    <!--
    -747267.00 -1056204.00 -747226.00 -1056232.00 -747239.00 -1056253.00 -747251.00 -1056278.00 -747267.00 -1056315.00 -747291.00 -1056365.00 -747337.00 -1056470.00 -747311.00 -1056474.00 -747244.00 -1056475.00 -747155.00 -1056467.00 -747077.00 -1056501.00 -747112.00 -1057366.00 -747263.00 -1057857.00 -747263.20 -1057857.05 -747263.30 -1057856.60 -747272.50 -1057858.50 -747276.10 -1057850.21 -747285.47 -1057849.89 -747295.34 -1057849.55 -747308.73 -1057848.34 -747320.38 -1057847.28 -747346.97 -1057857.70 -747358.66 -1057860.00 -747374.12 -1057860.55 -747386.06 -1057860.19 -747407.98 -1057859.54 -747444.60 -1057874.26 -747447.75 -1057879.52 -747454.57 -1057890.92 -747674.02 -1057865.46 -747851.54 -1057841.44 -747855.78 -1057838.67 -747871.68 -1057851.47 -747902.20 -1057870.55 -747916.06 -1057881.32 -747934.07 -1057891.87 -747960.03 -1057915.53 -747985.14 -1057954.40 -748001.13 -1057977.02 -748021.22 -1058003.59 -748088.58 -1058092.68 -748104.73 -1058095.49 -748166.00 -1058032.60 -748193.50 -1058002.40 -748214.40 -1057982.20 -748216.40 -1057988.60 -748293.20 -1058053.20 -748297.14 -1058050.03 -748302.55 -1058045.67 -748306.53 -1058042.47 -748311.89 -1058038.15 -748316.50 -1058034.44 -748320.83 -1058030.95 -748330.04 -1058023.54 -748332.15 -1058021.83 -748337.10 -1058017.85 -748341.39 -1058014.39 -748353.30 -1058004.80 -748347.67 -1057996.70 -748338.28 -1057981.31 -748335.70 -1057977.29 -748332.12 -1057971.71 -748330.30 -1057968.92 -748325.55 -1057961.32 -748317.05 -1057947.55 -748310.89 -1057935.02 -748307.10 -1057924.52 -748302.70 -1057912.35 -748298.54 -1057900.12 -748295.48 -1057891.13 -748286.20 -1057862.27 -748278.37 -1057838.25 -748276.55 -1057834.04 -748267.49 -1057808.20 -748264.92 -1057798.33 -748262.21 -1057787.93 -748254.57 -1057761.59 -748251.89 -1057752.13 -748247.59 -1057736.93 -748240.11 -1057716.13 -748237.47 -1057685.67 -748234.93 -1057657.42 -748234.51 -1057652.51 -748234.98 -1057625.54 -748234.51 -1057622.46 -748231.40 -1057602.21 -748233.13 -1057596.29 -748234.13 -1057592.87 -748237.61 -1057582.60 -748238.48 -1057580.02 -748249.72 -1057571.70 -748250.10 -1057571.42 -748252.39 -1057569.73 -748256.83 -1057563.57 -748258.55 -1057540.99 -748250.24 -1057535.67 -748250.94 -1057526.41 -748243.01 -1057522.35 -748236.51 -1057522.75 -748234.73 -1057522.86 -748230.54 -1057518.95 -748211.65 -1057501.36 -748199.48 -1057493.59 -748189.98 -1057489.26 -748179.90 -1057484.66 -748168.54 -1057470.65 -748168.29 -1057470.34 -748165.98 -1057467.49 -748157.92 -1057458.13 -748147.31 -1057450.99 -748146.04 -1057423.54 -748145.40 -1057410.42 -748144.91 -1057400.47 -748144.08 -1057372.43 -748142.62 -1057348.91 -748142.48 -1057347.16 -748141.05 -1057329.37 -748142.26 -1057321.94 -748146.21 -1057304.13 -748148.14 -1057295.42 -748146.30 -1057289.44 -748144.73 -1057284.34 -748141.64 -1057275.31 -748144.63 -1057272.64 -748154.01 -1057247.80 -748151.29 -1057246.55 -748127.50 -1057235.56 -748110.70 -1057228.23 -748082.39 -1057214.75 -748057.48 -1057203.76 -748041.82 -1057196.01 -748029.14 -1057189.74 -748010.10 -1057178.36 -747979.25 -1057161.25 -747957.25 -1057147.63 -747943.14 -1057138.66 -747937.35 -1057131.26 -747926.97 -1057121.60 -747909.48 -1057109.13 -747904.01 -1057106.36 -747895.25 -1057106.99 -747873.33 -1057094.64 -747869.74 -1057093.00 -747851.77 -1057082.31 -747869.79 -1057044.54 -747836.92 -1057032.09 -747795.65 -1057016.73 -747793.70 -1057009.93 -747787.82 -1056992.87 -747781.28 -1056974.44 -747776.81 -1056960.35 -747768.14 -1056933.57 -747762.16 -1056911.71 -747757.80 -1056895.21 -747753.30 -1056877.50 -747749.17 -1056859.18 -747744.25 -1056838.69 -747741.79 -1056821.91 -747739.99 -1056803.90 -747737.12 -1056781.92 -747735.82 -1056761.48 -747735.01 -1056740.42 -747736.57 -1056718.66 -747738.55 -1056694.68 -747741.17 -1056669.07 -747744.02 -1056634.01 -747745.17 -1056623.46 -747748.09 -1056596.69 -747755.37 -1056564.46 -747759.01 -1056547.20 -747761.29 -1056536.38 -747761.56 -1056535.10 -747772.54 -1056491.85 -747774.05 -1056485.90 -747786.35 -1056435.41 -747786.99 -1056433.22 -747796.41 -1056400.93 -747799.01 -1056392.00 -747799.01 -1056392.00 -747799.00 -1056392.00 -747723.00 -1056390.00 -747615.00 -1056374.00 -747596.00 -1056372.00 -747564.00 -1056375.00 -747539.00 -1056382.00 -747513.00 -1056389.00 -747487.00 -1056344.00 -747472.00 -1056316.00 -747458.00 -1056290.00 -747455.00 -1056283.00 -747445.00 -1056265.00 -747433.00 -1056243.00 -747424.00 -1056225.00 -747420.00 -1056218.00 -747412.00 -1056205.00 -747399.00 -1056188.00 -747388.00 -1056173.00 -747383.00 -1056167.00 -747371.00 -1056154.00 -747370.00 -1056153.00 -747362.00 -1056145.00 -747356.00 -1056141.00 -747356.00 -1056140.00 -747334.00 -1056160.00 -747267.00 -1056204.00
    -->
    60.459099 16.926436 60.460080 16.933631 60.460272 16.935328 60.460563 16.936937 60.474139 16.929063 60.474348 16.930889 60.476611 16.929621 60.479701 16.929346 60.479487 16.922792 60.476801 16.923118 60.475752 16.921900 60.472010 16.923844 60.470093 16.920215 60.459099 16.926436
    </gml:posList>
    </gml:LinearRing>
    </gml:exterior>
    </gml:Polygon>
    </gml:surfaceMember>
    </gml:MultiSurface>
    select @x
    SET @g = geography::GeomFromGml(@x, 4326);
    [Personal Site] [Blog] [Facebook]

  • How to query on date data type.

    Hi,
    I have a column RCVDDT which is DATE data type. Using this I need to query the records where RCVDDT <=(SYSDATETIME - 2 Hours), Need all the records which are 2 hours old or more.
    I am using this query:
    select * from tablename where RCVDDT <= to_date((sysdate - INTERVAL '2' hour),'yyyy-mm-dd HH24:MI:SS') order by RCVDDT desc
    Thanks in Advance,
    -Sree

    A very common mistake is to apply TO_DATE() against sysdate. Sysdate is a date already and applying TO_DATE() to it can really muck up your results. Besides your syntax for TO_DATE(), even if appropriate, is not correct because it relied on default date format, which will also lead you to grief.
    select * from tablename where RCVDDT <= sysdate -2/24;

  • I need help in "HOW TO EXTEND THE DATA TYPE SYSTEM"......

    Hi All,
    I need to add new data type like SDO_GEOMETRY in spatial Oracle.
    I don't mean the User-Defined Datatype but new datatype embed in the database.
    I read the Data Cartridge Developer's Guide but it has info how to use more efficiently UDT through indexes.
    Anybody used the “Type System” under Databases and Extensibility Services?
    It might be written in C++ or Java but I do not know how.
    Any hints and help will be appreciated.
    Thanks,

    > In Figure 1-1 Oracle Services, there is a "Type System" as Oracle Services.
    The "Type System" is merely a compartmentalising the data type handling and implementation code/modules in Oracle.
    This covers all types. Oracle native types, user defined types (UDTs), etc.
    Saying that you want to create a new type in the "Type System" is basically saying you want to use the CREATE TYPE SQL command in Oracle.
    > So, I want new_type1 and new_type2 behave like other built-in types, just the way
    SDO_GEOMETRY works in Oracle Spatial Cartridge.
    Not familiar with the SDO_GEOMETRY. Why do you mention this type specifically? What do you want to do similar?
    > I have already done it with user-defined types. Now I need to do this way so that I can
    compare and contrast in terms of speed, space...etc for part of my research.
    Hmm.. I'm not sure what you are trying to compare ito of a UDT and Data Cartridge extensions. It is not one or the other. What research is this if I may ask?
    Simplistically you extend the Type System with a new UDT/ADT. And there you have a new type data can be used in the SQL Engine and the PL/SQL engine. The OCI (Oracle Call Interface) supports such types via the OCI object API calls - which means this new type can also be used from Oracle clients written in Delphi, C++, Java, etc.
    That new type can be a complex type. This type may need specific management code (memory management, context management, internationalisation, etc). To support this you can extend the UDT/ADT further by developing Cartridge Basic Service interfaces for the type - designing and writing management code to, for example, support specific internationalisation requirements when dealing with multibyte character sets.
    You can also extend the UDT/ADT to be custom managed ito indexing, determining query optimisation, computing costs of custom methods/functions/operators on this custom data type. These extensions are done by developing Data Cartridge interfaces for the type.
    Thus I cannot see what you are trying to compare. It is not one layer/interface versus another. These layers exist for all Oracle types (in the Type System). Oracle not only allows you to add to the top layer by adding/defining a new data type. It also allows you to customise (if needed) the layers below it.

  • How to query the Date/Time Dataype

    Hi,
    I am trying to query the database with Data/Time Datatype.
    String date=request.getParameter("date");
    String month=request.getParameter("month");
    String year=request.getParameter("year");
    String tosearch=month+"/"+date+"/"+year;
    String getTable="select * from tableRes where dmy='"+tosearch+"'";I would like to know why it is not working?
    I ran through tomcat and it appeared this error:
    Data type mismatch in criteria expression.
    Thanks!

    pramudya81 wrote:
    Rock,
    May I know more detail on your specs?
    What is your DB? Or how is exactly you execute the sql.
    to_date is anyway an Oracle syntax.
    So I guess your DB might be an SQL Server.
    to_date for oracle is equivalent as Convert in SQL Server
    example Select Convert(datetime ,'2002/01/01')
    Hope it works nowBad idea. See reply 1.

  • How to retrieve the data type of a column of a table?

    Hi,
    I want to retrieve the data type of a column of a table. At the moment I am querying "OCI_ATTR_DATA_TYPE" attribute but it is returning SQLT_CHR for both varchar2 and nvarchar2 data type columns. I need to distinguish between these two data types columns separately. Is there any API through which I could get the exact data type of a column i.e. "nvarchar2"?
    Thanks in advance.
    Hashim

    Hi,
    This is the Oracle C++ Call Interface (OCCI) forum - I'm not sure if you are using OCCI or OCI (Oracle Call Interface - the C interface) since you reference "OCI_ATTR_DATA_TYPE" which is more of an OCI focus than OCCI.
    In any case, you might take a look at "OCI_ATTR_CHARSET_FORM" which takes the following values:
    #define SQLCS_IMPLICIT 1     /* for CHAR, VARCHAR2, CLOB w/o a specified set */
    #define SQLCS_NCHAR    2                  /* for NCHAR, NCHAR VARYING, NCLOB */So, if you have a datatype of SQLT_CHR and OCI_ATTR_CHARSET_FORM is SQLCS_IMPLICIT then you have a varchar2 if it is SQLCS_NCHAR then you have an nvarchar2.
    If you are using OCCI and not OCI then take a look at MetaData::ATTR_DATA_TYPE and MetaData::ATTR_CHARSET_FORM which expose OCI_ATTR_DATA_TYPE and OCI_ATTR_CHARSET_FORM respectively.
    Perhaps that will get you what you want.
    Regards,
    Mark

  • How to change the data type of an item in administrator

    Hi,
    A summary folder was created. One of the item in the summary folder is a sum. That sum item was created in the business area (based on another item). I can't refresh that summary folder because it gives me an oracle error (Ora-12008 and Ora-01401 the value is too large for the column). The column that this item is based on is of data type Number(13). How can I fix this problem without changing the column's data type of the original table? I already tried altering the data type in the EUL table via TOAD.
    Thanks!

    You really don't need to sum the item before hand if you are going to create a summary!

  • How to change the data type in the table ESLL for the field USERF2_NUM ?

    Hello Friends,
    I have a requirement in which one of the change is to convert the data type of the field 'USERF2_NUM' in the table 'ESLL'  from 'QUAN' to 'CHAR'. 
    How do i do it if i have an access to change it..........i think i should also check the impact of the change if done.
    Kindly tell me as my requirement starts with this small change.
    Regards,
    Rajesh Kumar

    Thanks for the reply Sowmya.
    I would like to know 2 things.
    1. Is it ok to change the data type of the field 'USERF2_NUM '  which is in the table ESLL. from quan to char.
    2.  The table ESLL  already has entries. if we change the data type from QUAN to CHAR what is the  effect on the existing entries of the table .
    Kindly reply me back.
    Thanks & Regards,
    Rajesh Kumar

  • How to do create data type for coulmn name as QS$FGD .

    hi ,
    In my database i have a column as QS$FGD.
    How do i map it in XI , since $ is not accepted when u create a data type.
    One way is to give alias at the databse level for the column . is there any other way to slove it .
    Thanks
    amit

    Hi Amit,
            Were you able to solve your issue? I'm facing the similar issue now. My DB table contains field names with '.' i.e. say xyz.abc. How to solve this??
    I feel SP could be an alternative??
    Thanks,
    Hussain.

  • How to get the Data type of the Internal Table.

    How can i get the data types used to create an internal table
    TYPES : BEGIN OF t_makt,
              matnr    TYPE    matnr,
              maktx    TYPE    maktx,
            END OF t_makt.
    Like this some function will give me which data types i have used for the internal table at run time.

    Use the FM ..
    data : int_fcat type SLIS_T_FIELDCAT_ALV.
    REUSE_ALV_FIELDCATALOG_MERGE ..
      CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
           EXPORTING
                I_PROGRAM_NAME         = sy-repid
                I_INTERNAL_TABNAME     = 'IMAT'   <-- this is your internal table
                 I_INCLNAME             = sy-repid
           CHANGING
                CT_FIELDCAT            = int_fcat <--- this contains all the fields along with their characteristics ...
           EXCEPTIONS
                INCONSISTENT_INTERFACE = 1
                PROGRAM_ERROR          = 2
                OTHERS                 = 3.

Maybe you are looking for

  • DBSequence type no longer available for entity attributes?

    I'm puzzled by this, if not scared. Every version of JDev till 11.1.1.2.0 has had out-of-the-box support for DBSequence as an entity attribute type. When you set it for your PK, JDev disables a few options, automatically sets "refresh after insert" (

  • What are the corresponding Data Types of some MDM Data Types

    Hi Guys, The MDM ABAP API involves creation of a DDIC structure in SRM. This structure should have the same fields with the MDM table fields. We would like to ask the corresponding ABAP Data Types for the following MDM Data Types.      MDM           

  • Trouble Printing Start Times in Weekly View

    I'm unable to print the start times for some appointment. I noticed that they all have a duration of 1 hour or less so I suppose that it could be because of the lack of space. Does anyone know if there's any way change the font size or another work a

  • Read source system in start routine for BW 7.0

    Dear all, how can I tread a source system in the start routine in BW 7.x? The input parameter "SOURCE_SYSTEM LIKE RSUPDSIMULH-LOGSYS" has been available in 3.x but no more available in 7.x Any ideas ? Thanks IFR

  • Missing text in my PDF watermark. How do I fix?

    I've created a PDF to be used as a watermark The PDF that I will use as a watermark looks fine. All the text is there.  When I apply this PDF as a watermark, some of the text dissappears. I'm not sure what is going on.