Datatypes in a recursive common table expression

I'm trying to use a (recursive) common table expression to generate a list of dates. The following code is working fine with 11.2
WITH dates ( nr, dt ) AS (
    SELECT 1, DATE '2005-02-01'
    from dual
    UNION ALL
    SELECT d.nr + 1, DATE '2005-02-01' + 1
    FROM dates d
    WHERE d.nr < 30
SELECT dt
FROM dates;But I would like to avoid repeating the start date in the recursive part, and I tried the following:
WITH dates ( nr, dt ) AS (
    SELECT 1, DATE '2005-02-01'
    from dual
    UNION ALL
    SELECT d.nr + 1, d.dt + 1
    FROM dates d
    WHERE d.nr < 30
SELECT dt
FROM dates;But I get the following error: ORA-01790: expression must have same datatype as corresponding expression
Now from my understanding the datatype should be DATE for both parts of the UNION.
I also tried it with d.dt + interval '1' day but that produces the same error message. using to_date() instead of the ANSI date literal does not change it either.
What am I missing here?

castorp wrote:
I'm trying to use a (recursive) common table expression to generate a list of dates. The following code is working fine with 11.2
WITH dates ( nr, dt ) AS (
SELECT 1, DATE '2005-02-01'
from dual
UNION ALL
SELECT d.nr + 1, DATE '2005-02-01' + 1
FROM dates d
WHERE d.nr < 30
SELECT dt
FROM dates;But I would like to avoid repeating the start date in the recursive part, and I tried the following:
WITH dates ( nr, dt ) AS (
SELECT 1, DATE '2005-02-01'
from dual
UNION ALL
SELECT d.nr + 1, d.dt + 1
FROM dates d
WHERE d.nr < 30
SELECT dt
FROM dates;But I get the following error: ORA-01790: expression must have same datatype as corresponding expression
Now from my understanding the datatype should be DATE for both parts of the UNION.
I also tried it with d.dt + interval '1' day but that produces the same error message. using to_date() instead of the ANSI date literal does not change it either.
What am I missing here?http://www.orafaq.com/forum/mv/msg/95011/463394/102589/#msg_463394

Similar Messages

  • Create a view using common table expressions

    I'm having trouble finding out if this is even possible in Oracle.
    Here is what I'm trying to accomplish with my view. A subject takes a survey numerous times across numerous dates. Depending on the responses to different questions, that subject is marked as having a set disease or affliction. The view that I'm building collects the necessary answers for each survey into one place (the first common table expression), then in subsequent CTEs, I'm adding the disease classification when the responses to the needed questions match. Sometimes the requirements state that the survey can't already be positive for other diseases, meaning that I need to ultimately discount them when checking subsequent diseases (each disease is built using it's own CTE of which there are 13). I built the query which performs these tasks with no problems. It runs and gives the responses that I'm looking for.
    The problem comes into play when I attempt to wrap the existing working query into a create view process. When I add CREATE OR REPLACE VIEW TESTENV.TESTVIEW AS ( and the ending ); after the query, it is giving me the error: ORA-32034: unsupported use of WITH clause.
    Am I getting the error simply because I can't put CTE's into views, or is it because the syntax for putting CTEs into Views is different than a normal view build process? Also, in case it makes a difference, the version of Oracle I'm using is: Oracle 10g.
    Thank you.

    Here is the view that I'm trying to build:
    <pre class="jive-pre">
    CREATE OR REPLACE VIEW GI_DEV.PAIN_COMP AS (
    WITH gatheredQuestions AS (
    SELECT
    s.date_of_survey_id,
    a.question_1 as A_1,
    a.question_5 as A_5,
    a.question_6 as A_6,
    a.question_7 as A_7,
    a.question_8 as A_8,
    a.question_9 as A_9,
    a.question_10 as A_10,
    a.question_12 as A_12,
    a.question_13 as A_13,
    a.question_14 as A_14,
    a.question_15 as A_15,
    a.question_16 as A_16,
    b.question_1 as B_1,
    b.question_4 as B_4,
    b.question_5 as B_5,
    b.question_6 as B_6,
    b.question_7 as B_7,
    b.question_8 as B_8,
    b.question_9 as B_9,
    b.question_11 as B_11,
    b.question_12 as B_12,
    b.question_13 as B_13,
    b.question_14 as B_14,
    b.question_15 as B_15,
    b.question_16 as B_16,
    b.question_16a_a as B_16a_a,
    b.question_16a_b as B_16a_b,
    b.question_16a_c as B_16a_c,
    b.question_16a_d as B_16a_d,
    b.question_16a_e as B_16a_e,
    b.question_16a_f as B_16a_f,
    b.question_16b as B_16b,
    c.question_1 as C_1,
    c.question_2 as C_2,
    c.question_3 as C_3,
    c.question_8 as C_8,
    c.question_9 as C_9,
    c.question_10 as C_10,
    c.question_11 as C_11,
    c.question_11a as C_11a,
    c.question_11b as C_11b,
    d.question_1 as D_1,
    d.question_2 as D_2,
    d.question_3 as D_3,
    d.question_4 as D_4,
    d.question_5 as D_5,
    d.question_5a as D_5a,
    d.question_5b as D_5b,
    d.question_5c as D_5c,
    d.question_6 as D_6,
    d.question_6a as D_6a,
    d.question_6b as D_6b,
    d.question_6c as D_6c,
    d.question_6d as D_6d
    FROM
    new_date_of_survey s
    LEFT OUTER JOIN new_section_a a on a.solid_visit_a_id = s.date_of_survey_id
    LEFT OUTER JOIN new_section_b b on b.solid_visit_b_id = s.date_of_survey_id
    LEFT OUTER JOIN new_section_c c on c.solid_visit_c_id = s.date_of_survey_id
    LEFT OUTER JOIN new_section_d d on d.solid_visit_d_id = s.date_of_survey_id
    ), functDyspepsia as (
    SELECT
    date_of_survey_id,
    'Functional Dyspepsia' as pain_type
    FROM gatheredQuestions g
    WHERE
    g.A_1 in (4, 5)
    and g.A_5 in (3, 4, 5, 6)
    and g.A_6 in (0, 2, 3)
    and (g.A_7 in (0, 2) and g.A_8 in (0,2))
    and (g.A_9 in (0, 2) and g.A_10 in (0, 2))
    ), IBSLower as (
    SELECT
    date_of_survey_id,
    'IBS Lower' as pain_type
    FROM gatheredQuestions g
    WHERE
    g.B_1 in (3, 4, 5)
    and g.B_4 in (2, 3, 4, 5, 6)
    and 2 <= (CASE WHEN g.B_5 in (3, 4, 5) THEN 1 ELSE 0 END) + (CASE WHEN (g.B_6 in (3, 4, 5) and g.B_7 not in (3, 4, 5)) or (g.B_6 not in (3, 4, 5) and g.B_7 in (3, 4, 5)) THEN 1 ELSE 0 END) + (CASE WHEN (g.B_8 in (3, 4, 5) and g.B_9 not in (3, 4, 5)) or (g.B_8 not in (3, 4, 5) and g.B_9 in (3, 4, 5)) THEN 1 ELSE 0 END)
    ), IBSUpper as (
    SELECT
    date_of_survey_id,
    'IBS Upper' as pain_type
    FROM gatheredQuestions g
    WHERE
    g.A_1 in (3, 4, 5)
    and g.A_5 in (3, 4, 5, 6)
    and 2 <= (CASE WHEN g.A_6 in (3, 4, 5) THEN 1 ELSE 0 END) + (CASE WHEN (g.A_7 in (3, 4, 5) and g.A_8 not in (3, 4, 5)) or (g.A_7 not in (3, 4, 5) and g.A_8 in (3, 4, 5)) THEN 1 ELSE 0 END) + (CASE WHEN (g.A_9 in (3, 4, 5) and g.A_10 not in (3, 4, 5)) or (g.A_9 not in (3, 4, 5) and g.A_10 in (3, 4, 5)) THEN 1 ELSE 0 END)
    ), abMigraine as (
    SELECT
    date_of_survey_id,
    'Abdominal Migraine' as pain_type
    FROM gatheredQuestions g
    WHERE
    g.B_16 in (3, 4, 5)
    and 2 <= ((CASE WHEN g.B_16a_a = 2 THEN 1 ELSE 0 END) + (CASE WHEN g.B_16a_b = 2 THEN 1 ELSE 0 END) + (CASE WHEN g.B_16a_c = 2 THEN 1 ELSE 0 END) + (CASE WHEN g.B_16a_d = 2 THEN 1 ELSE 0 END) + (CASE WHEN g.B_16a_e = 2 THEN 1 ELSE 0 END) + (CASE WHEN g.B_16a_f = 2 THEN 1 ELSE 0 END))
    and g.B_16b = 2
    ), lowerFunctAbPainSyndrome as (
    SELECT
    date_of_survey_id,
    'Functional Abdominal Pain Syndrome - Lower' as pain_type
    FROM gatheredQuestions g
    WHERE
    g.B_1 in (4, 5)
    and g.B_4 in (3, 4, 5, 6)
    and date_of_survey_id not in (select date_of_survey_id from functDyspepsia union select date_of_survey_id from abMigraine union select date_of_survey_id from IBSLower union select date_of_survey_id from IBSUpper)
    and
    ((g.B_15 in (2,3,4,5) and 2 > ((CASE WHEN g.B_11 in (2,3,4,5) THEN 1 ELSE 0 END) + (CASE WHEN g.B_12 in (2,3,4,5) THEN 1 ELSE 0 END) + (CASE WHEN g.B_13 in (2,3,4,5) THEN 1 ELSE 0 END) + (CASE WHEN g.B_14 in (2,3,4,5) THEN 1 ELSE 0 END)))
    or (g.B_15 not in (2,3,4,5) and 2 <= ((CASE WHEN g.B_11 in (2,3,4,5) THEN 1 ELSE 0 END) + (CASE WHEN g.B_12 in (2,3,4,5) THEN 1 ELSE 0 END) + (CASE WHEN g.B_13 in (2,3,4,5) THEN 1 ELSE 0 END) + (CASE WHEN g.B_14 in (2,3,4,5) THEN 1 ELSE 0 END))))
    ), upperFunctAbPainSyndrome as (
    SELECT
    date_of_survey_id,
    'Functional Abdominal Pain Syndrome - Upper' as pain_type
    FROM gatheredQuestions g
    WHERE
    g.A_1 in (4, 5)
    and g.A_5 in (3, 4, 5, 6)
    and date_of_survey_id not in (select date_of_survey_id from functDyspepsia union select date_of_survey_id from abMigraine union select date_of_survey_id from IBSLower union select date_of_survey_id from IBSUpper)
    and
    ((g.A_16 in (2,3,4,5) and 2 > ((CASE WHEN g.A_12 in (2,3,4,5) THEN 1 ELSE 0 END) + (CASE WHEN g.A_13 in (2,3,4,5) THEN 1 ELSE 0 END) + (CASE WHEN g.A_14 in (2,3,4,5) THEN 1 ELSE 0 END) + (CASE WHEN g.A_15 in (2,3,4,5) THEN 1 ELSE 0 END)))
    or (g.A_16 not in (2,3,4,5) and 2 <= ((CASE WHEN g.A_12 in (2,3,4,5) THEN 1 ELSE 0 END) + (CASE WHEN g.A_13 in (2,3,4,5) THEN 1 ELSE 0 END) + (CASE WHEN g.A_14 in (2,3,4,5) THEN 1 ELSE 0 END) + (CASE WHEN g.A_15 in (2,3,4,5) THEN 1 ELSE 0 END))))
    ), lowerFunctAbPain as (
    SELECT
    date_of_survey_id,
    'Functional Abdominal Pain - Lower' as pain_type
    FROM gatheredQuestions g
    WHERE
    g.B_1 in (3, 4, 5)
    and g.B_4 in (3, 4, 5, 6)
    and date_of_survey_id not in (select date_of_survey_id from functDyspepsia union select date_of_survey_id from abMigraine union select date_of_survey_id from IBSLower union select date_of_survey_id from IBSUpper union select date_of_survey_id from upperFunctAbPainSyndrome union select date_of_survey_id from lowerFunctAbPainSyndrome)
    ), upperFunctAbPain as (
    SELECT
    date_of_survey_id,
    'Functional Abdominal Pain - Upper' as pain_type
    FROM gatheredQuestions g
    WHERE
    g.A_1 in (3, 4, 5)
    and g.A_5 in (3, 4, 5, 6)
    and date_of_survey_id not in (select date_of_survey_id from functDyspepsia union select date_of_survey_id from abMigraine union select date_of_survey_id from IBSLower union select date_of_survey_id from IBSUpper union select date_of_survey_id from upperFunctAbPainSyndrome union select date_of_survey_id from lowerFunctAbPainSyndrome)
    ), functConstipation as (
    SELECT
    date_of_survey_id,
    'Functional Constipation' as pain_type
    FROM gatheredQuestions g
    WHERE
    2 <= ((CASE WHEN g.C_1 in (0, 2) THEN 1 ELSE 0 END) + (CASE WHEN (g.C_2 in (2,3) and g.C_3 <> 2) or (g.C_2 not in (2, 3) and g.C_3 = 2) THEN 1 ELSE 0 END) + (CASE WHEN g.C_8 = 2 THEN 1 ELSE 0 END) + (CASE WHEN g.C_9 in (3, 4, 5) THEN 1 ELSE 0 END) + (CASE WHEN g.C_10 = 2 THEN 1 ELSE 0 END) + (CASE WHEN g.C_11 in (4, 5, 6) THEN 1 ELSE 0 END))
    and date_of_survey_id not in (select date_of_survey_id from IBSLower union select date_of_survey_id from IBSUpper)
    ), fecalIncontinence as (
    SELECT
    g.date_of_survey_id,
    'Nonretentive Fecal Incontinence' as pain_type
    FROM
    gatheredQuestions g
    left outer join new_date_of_survey s on s.date_of_survey_id = g.date_of_survey_id
    left outer join new_demographics d on d.solid_demographics_id = s.demo_id
    WHERE
    4 <= trunc((months_between(s.survey_date, d.date_of_birth))/12)
    and g.C_11 in (4, 5, 6)
    and g.C_11a in (2, 3)
    and g.C_11b in (3, 4, 5, 6)
    and g.date_of_survey_id not in (select date_of_survey_id from functConstipation)
    ), aerophagia as (
    SELECT
    date_of_survey_id,
    'Aerophagia' as pain_type
    FROM gatheredQuestions g
    WHERE
    2 <= ((CASE WHEN (g.D_1 in (3, 4, 5) and g.D_2 not in (3, 4, 5)) or (g.D_1 not in (3, 4, 5) and g.D_2 in (3, 4, 5)) THEN 1 ELSE 0 END) + (CASE WHEN g.D_3 in (3, 4, 5) THEN 1 ELSE 0 END) + (CASE WHEN g.D_4 in (3, 4, 5) THEN 1 ELSE 0 END))
    ), cycVomitSyndrome as (
    SELECT
    date_of_survey_id,
    'Cycllic Vomiting Syndrome' as pain_type
    FROM gatheredQuestions g
    WHERE
    g.D_5 in (4, 5)
    and g.D_5a in (3, 4, 5, 6)
    and g.D_5b = 2
    and g.D_5c = 2
    ), adolRumSyndrome as (
    SELECT
    date_of_survey_id,
    'Adolescent Rumination Syndrome' as pain_type
    FROM gatheredQuestions g
    WHERE
    g.D_6 in (4, 5)
    and g.D_6a = 2
    and g.D_6b = 0
    and g.D_6c = 0
    and g.D_6d = 0
    ), gatheredPains as (
    +
    select * from functDyspepsia
    union
    select * from IBSLower
    union
    select * from IBSUpper
    union
    select * from abMigraine
    union
    select * from lowerFunctAbPainSyndrome
    union
    select * from upperFunctAbPainSyndrome
    union
    select * from lowerFunctAbPain
    union
    select * from upperFunctAbPain
    union
    select * from functConstipation
    union
    select * from fecalIncontinence
    union
    select * from aerophagia
    union
    select * from cycVomitSyndrome
    union
    select * from adolRumSyndrome
    SELECT
    date_of_survey_id,
    string_agg(pain_type) as PainType
    FROM gatheredPains
    GROUP BY date_of_survey_id
    </pre>
    I tried remove the leading and ending parenthesis, and ended up getting the error that it is missing the select keyword. When I take the create view step out of this, the query builds with no problem, so I know that it's not missing a select or that it isn't in the correct place.
    Thank you for all your help so far.

  • Using Common Table Expressions in BO Universe

    Hi All,
    How to use Using Common Table Expressions(CTE) in BO Universe ?
    i created the stored procedure and tried to use it in universe but i'm not able to.
    Request you to help me out with this.
    Regards,
    Ravichandra K

    Did you get a chance to look at this guide chapter 7?
    [http://help.sap.com/businessobject/product_guides/boexir31/en/xi3-1_designer_en.pdf]
    Bashir Awan

  • Common table expression

    Hi,
    In DB2, there is a concept called 'common table expressions'.
    A common table expression is like a temporary view that is defined and used for the duration of an SQL statement. You can define a common table expression for the SELECT, INSERT, and CREATE VIEW statements. Each common table expression must have a unique name and be defined only once. However, you can reference a common table expression many times in the same SQL statement.
    Eg :--
    insert into test1 with test_view1(column2) as (select colum1 * 2 from test2) select column2 from test_view1;
    Here 'test_view1' is a temporary view created with a select statement. This view has the scope only within this SQL statement. The data inserted into the table 'test1' is selected from the temporary view.
    This can be achieved in Oracle by creating views and then using the INSERT .. SELECT statement. But I like to know whether any direct equivalent available for this in Oracle, something like 'INSERT .. WITH <view_name>' as in DB2.
    Please advise,
    Thanks,
    Smitha

    Er...you mean like this?
    Oracle9i Enterprise Edition Release 9.2.0.6.0 - 64bit Production
    JServer Release 9.2.0.6.0 - Production
    SQL> INSERT INTO emp
      2     WITH v_emp AS
      3          (SELECT empno + 1, ename, job, mgr,
      4                  hiredate, sal, comm, deptno
      5           FROM   emp)
      6     SELECT *
      7     FROM   v_emp;
    14 rows created.
    SQL> No, nothing like that whatsoever.

  • Memory usage Common table Expressions

    Hope view will use temporary memory while using it.. and
    If I use Common table Expressions (with <datsetname> select query )
    in stored procedure instead of view will it use the temp memory ?
    Many thanks
    Kalinga

    Why would it be any different? Its still a query. It will use any memory available for sorting
    (defined by sort_area_size)
    and if it exceeds this it will use the temporary tablespace.
    If their is more than one temporary tablespace , it will use the temporary tablespace which that user has been assigned.

  • What happens to unused common table expressions ,Does this affect in performance or ?

    If I write a query with one or more common table expressions to which I
    don't actually refer in the query, do they just get pruned off or do
    they get executed regardless? how does it affect in performance
    Prem Shah

    Try below
    seems when the CTE is not refer in the query then statement inside CTE is not executing at all even if it nested CTE, see for your self
    Create table UserInfo
    UserId int primary key,
    UserName varchar(30)
    GO
    Create table UserInfo1
    UserId int primary key,
    UserName varchar(30)
    GO
    insert into UserInfo
    select 1001,'X1' union all
    select 1002,'X2' union all
    select 1009 ,'X9'
    GO
    insert into UserInfo1
    select 1001,'X1' union all
    select 1002,'X2' union all
    select 1009 ,'X9'
    GO
    SET TRANSACTION ISOLATION LEVEL SERIALIZABLE
    GO
    Begin tran
    select * from UserInfo1 where UserId between 1001 and 1009
    and UserName = 'XXXX'
    --Commit
    PRINT 'WITH out CTE access in select'
    SET STATISTICS IO ON
    ;WITH CTE1 AS
    (Select * From UserInfo1)
    select * From UserInfo
    PRINT 'WITH CTE access in select'
    ;WITH CTE1 AS
    (Select * From UserInfo1)
    select * From UserInfo a inner join CTE1 b on a.UserId=b.UserId
    Stats IO
        WITH out CTE access in select
        (3 row(s) affected)
        Table 'UserInfo'. Scan count 1, logical reads 2, physical reads 0, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.
        (1 row(s) affected)
        WITH CTE access in select
        (3 row(s) affected)
        Table 'UserInfo1'. Scan count 0, logical reads 6, physical reads 0, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.
        Table 'UserInfo'. Scan count 1, logical reads 2, physical reads 0, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.
        (1 row(s) affected)
    Thanks
    Saravana Kumar C

  • Using Common Table Expressions (CTE) in a DSV Named Query

    Hi,
    I have a scenario where I need to "generate" fact data, so I'm using a CTE to generate the data. For maintainability reasons I have this CTE declared inside a view and in the DSV Named Query I just have a SELECT * FROM FactView.
    This works fine as long as the recursion level falls within the default limit of 100. If it does not, I have to specify the maximum recursion level such as:
    SELECT *
    FROM FactView
    OPTION (MAXRECURSION 0)
    The problem is I can't specify the Named Query like this. As explained elsewhere my query is embeded as a subquery and the OPTION keyword cannot be used in a subquery.
    Is there any other way I can specify the maximum recursion level on a Named Query?

    Load your fact table data into staging table and then process fact using direct load from staging table.

  • Extracting Metadata using Common Table Expressions MSSQL

    I have been using the below SQL query to extract subsets of the Metadata structure from several dimensions in HFM. The process works well and is simple/quick to develop and incorporate in existing processes. I am curious if anyone else has been using a similar query to extract subsets of HFM Structure directly from HFM or other approaches to extract a subset of HFM Structure.
    /*     The query starts with a "Top Parent" and will return all parent/child information below that member. For this example I want all the metadata for the c1 dimension so I am using the top most parent which by default has an ID of -1. You can look up and member's id in the "APP_DIM_Item" table and use that as the "Top Parent" for the query. It is possible to correctly extract only a subset of the overall metadata for each dimension.
    WITH dim (ItemID, ParentID, Level)
    AS
    SELECT
    el.ItemID
    ,el.[ParentID]
    ,0 AS Level
    FROM [<APP>CUSTOMLAYOUT] el     
    WHERE ParentID = -1 -- The "Top Parent" -1 will extract all metadata
              and lDimID = 1 -- Needed only for the custom dimensions.
    UNION ALL
    SELECT
         el.ItemID
    ,el.ParentID
    ,Level + 1 as Level
    FROM [ <APP>_CUSTOM_LAYOUT] el     
    INNER JOIN dim AS d
    ON el.ParentID = d.ItemID
    where el.lDimID = 1 -- needed for the custom dimensions
    /*     Once the structure is extracted to the temp dim table you can query back and
         join to the Item table to add addtional memeber details. If you leave the query as
         is you will only see the parent/child Unique ID and level informtaion.
    -- Parent/Child ID Structure
    SELECT * FROM dim
    -- Parent/Child Label Structure
    Select Dim.ItemID, Dim.ParentID, Dim.Level, Member.Label, Parent.Label
    From Dim
    inner JOIN <APP>CUSTOMITEM Member -- Member Detail
    on Member.ItemID = dim.ItemID AND Member.lDimID = 1
    inner JOIN <APP>CUSTOMITEM Parent -- Parent Detail
    on Parent.ItemID = dim.ParentID AND Parent.lDimID = 1

    Did you get a chance to look at this guide chapter 7?
    [http://help.sap.com/businessobject/product_guides/boexir31/en/xi3-1_designer_en.pdf]
    Bashir Awan

  • Modifying datatype of columns across multiple tables

    Hi,
    I have a requirement where-in I have to modify the datatypes of columns across multiple tables. Is there any direct way to do this? I mean does oracle has any function or in-built functionality to achieve this.
    Example;
    Table1 -> col1 datatype needs to be changed to varchar2(10)
    Table2 -> col2 datatype needs to be changed to varchar2(30)
    Table3 -> col3 datatype needs to be changed to number.
    and so on....
    Do we have such functionality?
    Thanks,
    Ishan

    Hi Aman,
    Seeing the replies, I think I was unclear in the requirements. But I guess you understood it fully, but still I would like to restate my question once again, just to be 100% sure.
    What I actually want is that in one shot, I would be able to modify columns of multible tables.
    eg, table1-> col1 changed to varchar2(20);
    table2->col2 changed to varchar2(10)
    table3-> col3 changed to number;
    I know how to do it individually, but just wanted to check, if only one command can modify the datatypes of multiple tables/.
    If not, I have already written half the script, but just for knowledge sake wanted to check if some feature is available in oracle for that.
    Regards,
    Ishan

  • Where is the build table express vi located in the function table?

    I must be blind but I can't locate the build table express vi in lv8 or 8.5.  Someone slap be upside the head and point it out.  Thanks

    It's on the Controls palette. Were you looking on the Functions palette?
    Message Edited by Dennis Knutson on 04-23-2008 08:22 PM
    Attachments:
    Express XY Graph.PNG ‏17 KB

  • Is the datatype SDO_GEOMETRY available within the Oracle Express XE edition

    I am trying to run the create table script as listed in the B28004-01 2 Day plus locator Developer Guide for Oracle Database Express Edition.
    It will not recognise this datatype of SDO_GEOMETRY.
    Is it included ???

    oracle@fuzzy:~> sqlplus test/test
    SQL*Plus: Release 10.2.0.1.0 - Production on Sun Apr 15 12:53:38 2007
    Copyright (c) 1982, 2005, Oracle.  All rights reserved.
    Connected to:
    Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
    SQL> drop table t1;
    Table dropped.
    SQL> create table t1 (
    2 id number,
    3 geom sdo_geometry
    4 );
    Table created.
    SQL>                                         

  • How to upload data to a "CLOB" datatype field in a database table

    Using sqlldr what is the correct way to upload character data (far greater than the 4000 Bytes allowed in varchar2)?
    setting the table field name datatype to clob and then using the field name against a large dataset in the control file I get the error that the input record (field) is to large.. adding "clob" after the table field name in the sqlldr control file just gives me a syntax error..
    Running Oracle 9.2.0.6 on Solaris 9

    user511518,
    I think you're in the wrong forum. Perhaps you should start with this Web page:
    http://www.oracle.com/technology/products/database/utilities/index.html
    Look for the SQL*Loader links.
    Good Luck,
    Avi.

  • SQL Loader: handling difference datatypes in data file and table column

    Hi,
    I am not sure if my question is valid but I am having this doubt.
    I am trying to load data from my data file into a table with just a single column of FLOAT datatype using SQL Loader. But very few insertions take place, leaving a large number of record rejected for the same reason-
    Record 7: Rejected - Error on table T1, column MSISDN.
    ORA-01722: invalid number
    The data in my datafile goes like this: (with a single space before every field)
       233207332711<EOFD><EORD>    233208660745<EOFD><EORD>    233200767380<EOFD><EORD>
    Here I want to know if there is any way to type cast the data read from the data file to suit my table column's datatype.
    How do I handle this? I want to load all the data from my datafile into my table.

    Pl continue the discussion in your original post - Pls help: SQL Loader loads only one record

  • Timestamp datatype not output correctly in table export

    When using the data export from table view timestamp datatype is not handled correctly. It shows as oracle.sql.TIMESTAMP@14c0761.
    Works fine from SQL Explorer view though.

    Im using the same build. 1.0.0.15.27.
    You can try any export option. I tried SQL Insert.
    If you right click from the data grid (SQL Worksheet or Table view it works fine)
    In the table view, if you go to Actions -> Export -> SQL Insert then it doesn't.

  • Recursing through table / complex return types in Java Stored Functions

    I have a table representing a tree with arbitrary depth, of the form:
    ID NUMBER(10) PRIMARY KEY,
    NAME VARCHAR2(20),
    PARENT NUMBER(10)
    with PARENT being a foreign key for ID, so that top-level nodes in the tree have a NULL PARENT, and other nodes have the ID of their parent node in the PARENT field.
    I want a good way to get a row representing a node as well as all its ancestor nodes recursively up to the top level. I do this a lot in my Java application, and right now it works by just getting each row, checking if PARENT is null, and recursing again until I get the top-level node. Since this recursion is in Java and I do multiple queries it's rather slow, and I'd rather perform this operation in the database (using a Java Stored Function/Procedure or PL/SQL).
    I'm no good at PL/SQL so don't have a clue how to go about doing this sort of thing, and although I can write a Java Stored Function that does the same recursion I do in the application, I don't know how to return the results. I can't return a REF CURSOR type since the results are from multiple queries, and I can't find any documentation about how to return structured types from a JSF.
    If anyone could give me a near-complete PL/SQL listing that does this or (better) help me to complete my Java Stored Function by returning the results in a structured type.

    You are my own personal God (for the day). Thanks, exactly what I needed, and all in one query with no procedural.

Maybe you are looking for