Query working fine in toad but not in forms 6i

i have following coding on when button press triger
declare
CURSOR C1(year number,month number) IS
SELECT ITM_NO,ITM_NAME,XAQ QTY,XAQ*TP VAL,gp
FROM
select ci.itm_no ITM_NO,ci.itm_name ITM_NAME ,cpg.group_id gp ,xaq ,ALLIED.CORP_PRIC_TP( ci.itm_no)TP from
select prod_no,sum(xaq)*1 xaq
from
select prod_no, sum(nvl(xrd_sqty,0)) Xaq
from allied.mrk_01_02
where year=year and f_prd=month
and area_id in (10200,10400,10100,10300,10500,20500,20300,20100,20200,20400,30100,30400,30300,30200)
group by prod_no
union all
select prod_no, sum(nvl(xrd_sqty,0)) Xaq
from allied.mrk_02_02
where year=year and f_prd=month
and area_id in (10200,10400,10100,10300,10500,20500,20300,20100,20200,20400,30100,30400,30300,30200)
group by prod_no
union all
select prod_no, sum(nvl(xrd_sqty,0)) Xaq
from allied.mrk_03_02
where year=year and f_prd=month
and area_id in (10200,10400,10100,10300,10500,20500,20300,20100,20200,20400,30100,30400,30300,30200)
group by prod_no
union all
select prod_no, sum(nvl(xrd_sqty,0)) Xaq
from allied.mrk_04_02
where year=year and f_prd=month
and area_id in (10200,10400,10100,10300,10500,20500,20300,20100,20200,20400,30100,30400,30300,30200)
group by prod_no
group by prod_no
) A,allied.corp_inv ci,allied.corp_01_01 c01, allied.corp_01_02 c02,allied.corp_prod_group cpg,allied.v_prod_grp vpg
where ci.itm_no=a.prod_no
and ci.itm_no=c02.itm_no
and c01.grp_id=c02.grp_id
and c01.grp_id in(55,56,57,58,59)
and vpg.prod_no =ci.itm_no
and vpg.group_id=cpg.group_id
where XAQ <>0;
Begin
     delete from fiaz.tmp_topten_prod;
     for i in c1(:year,:month)
loop
          insert into fiaz.tmp_topten_prod
          values(i.itm_no,i.itm_name,i.qty,i.val,i.gp,0);
     end loop;      
standard.commit;
message('inserted in temp');
     exception when others then
          message (dbms_error_text);
          message (dbms_error_text);
End;
Same Query (as used in cursor c1) works fine in toad but giving wrong result from forms... and the problem is xaq field i.e returns incorrect qty...
i guess union clause is not working in this situation...
plz suggest me the appropriate changes in the query to work well from form as well...
combination:Forms 6i,Oracle 8.0.6
Regards,
Usman Afzal

As per your suggestion i have created a stored procedure but the followin error prevents procedure creation
create or replace procedure fiaz.topten_prod(v_yr number,v_mn number) is
begin
delete from fiaz.tmp_topten_prod;
insert into fiaz.tmp_topten_prod(itm_no,itm_name,qty,val,grp_id,prority)
SELECT ITM_NO,ITM_NAME,XAQ QTY,XAQ*TP VAL,gp,0
FROM
select ci.itm_no ITM_NO,ci.itm_name ITM_NAME ,cpg.group_id gp ,xaq ,ALLIED.CORP_PRIC_TP( ci.itm_no)TP from
select prod_no,sum(xaq) xaq
from
select prod_no, sum(nvl(xrd_sqty,0)) Xaq from allied.mrk_01_02
where year=v_yr and f_prd=v_mn
and area_id in (10200,10400,10100,10300,10500,20500,20300,20100,20200,20400,30100,30400,30300,30200)
group by prod_no
union all
select prod_no, sum(nvl(xrd_sqty,0)) Xaq
from allied.mrk_02_02
where year=v_yr and f_prd=v_mn
and area_id in (10200,10400,10100,10300,10500,20500,20300,20100,20200,20400,30100,30400,30300,30200)
group by prod_no
union all
select prod_no, sum(nvl(xrd_sqty,0)) Xaq
from allied.mrk_03_02
where year=v_yr and f_prd=v_mn
and area_id in (10200,10400,10100,10300,10500,20500,20300,20100,20200,20400,30100,30400,30300,30200)
group by prod_no
union all
select prod_no, sum(nvl(xrd_sqty,0)) Xaq
from allied.mrk_04_02
where year=v_yr and f_prd=v_mn
and area_id in (10200,10400,10100,10300,10500,20500,20300,20100,20200,20400,30100,30400,30300,30200)
group by prod_no
group by prod_no
) A,allied.corp_inv ci,allied.corp_01_01 c01, allied.corp_01_02 c02,allied.corp_prod_group cpg,allied.v_prod_grp vpg
where ci.itm_no=a.prod_no
and ci.itm_no=c02.itm_no
and c01.grp_id=c02.grp_id
and c01.grp_id in(55,56,57,58,59)
and vpg.prod_no =ci.itm_no
and vpg.group_id=cpg.group_id
where XAQ <>0;
commit;
end;
Error:
"PLS-00201: identifier ALLIED.MRK_01_02 must be declared "
i have not changed any thing in query working fine in toad without create procedure text and if i describe this table it shows the structure (desc allied.mrk_01_02)
Now where is the problemmmmm
Plz Help

Similar Messages

  • Trigger works fine in Toad but not in the Application Form

    Hi All,
    I created a trigger that executes BEFORE UPDATE ON PO_REQUISITION_LINES_ALL. When I exceute in Toad a manual update on this table, the trigger appears correctly, but When I am on PIC form in PO, and execute save with blank value, the trigger doesn't work and doesn't appear.
    Do you know which is the reason?.
    Regards,
    Mariano.-

    Hi Srini,
    The problem is on Form POXRQERQ.fmx on PIC transactions. Trigger works fine If a create a new transaction. Because the message appears correctly in the screen, but when I update and change a value in the specific field on the screen, the message of the trigger doesn't appear and I don't know why...
    Please Help Me!
    Regards Mariano.-
    Version Of Application : 11.5.8
    Version Of Database : Oracle9i Enterprise Edition Release 9.2.0.8.0 - 64bit Production
    Version Of OS : AIX Version 5.3!
    PROMPT Creating TRIGGER XX_PO_Espec_Iweb_Requis ...
    CREATE OR REPLACE TRIGGER XX_PO_Espec_Iweb_Requis
    BEFORE UPDATE OR INSERT ON PO_REQUISITION_LINES_ALL
    FOR EACH ROW
    DECLARE
    BEGIN
    RAISE_APPLICATION_ERROR(-20000,'You couldn't update or insert the PIC');
    END;
    SHOW ERRORS
    SPOOL OFF

  • Query working fine in 9i but throwing an error in Oracle 10g

    Hi All,
    I am having a query which contains large number of When clauses inside a case statement.
    The Same SQL is working fine in 9i, but not working in 10G.
    If we try to remove one of the When clause in the query, its working fine else it is giving the error ORA-00939 Too many arguments for functions.
    Can any one tell me the solution for this and what is the maximum number of when clauses allowed inside case statemen in oracle 10g.
    Thanks in advance
    Regards
    Karthik

    it should not have worked in 9iR2... it is correct according to the doc to return an error message when using more than 255 expressions...
    SQL> select version from v$instance;
    VERSION
    9.2.0.7.0
    SQL> select case 1
      2  when 2 then 3
      3  when 4 then 5
      4  when 6 then 7
      5  when 8 then 9
      6  when 10 then 11
      7  when 12 then 13
      8  when 14 then 15
      9  when 16 then 17
    10  when 18 then 19
    11  when 20 then 21
    12  when 22 then 23
    13  when 24 then 25
    14  when 26 then 27
    15  when 28 then 29
    16  when 30 then 31
    17  when 32 then 33
    18  when 34 then 35
    19  when 36 then 37
    20  when 38 then 39
    21  when 40 then 41
    22  when 42 then 43
    23  when 44 then 45
    24  when 46 then 47
    25  when 48 then 49
    26  when 50 then 51
    27  when 52 then 53
    28  when 54 then 55
    29  when 56 then 57
    30  when 58 then 59
    31  when 60 then 61
    32  when 62 then 63
    33  when 64 then 65
    34  when 66 then 67
    35  when 68 then 69
    36  when 70 then 71
    37  when 72 then 73
    38  when 74 then 75
    39  when 76 then 77
    40  when 78 then 79
    41  when 80 then 81
    42  when 82 then 83
    43  when 84 then 85
    44  when 86 then 87
    45  when 88 then 89
    46  when 90 then 91
    47  when 92 then 93
    48  when 94 then 95
    49  when 96 then 97
    50  when 98 then 99
    51  when 100 then 101
    52  when 102 then 103
    53  when 104 then 105
    54  when 106 then 107
    55  when 108 then 109
    56  when 110 then 111
    57  when 112 then 113
    58  when 114 then 115
    59  when 116 then 117
    60  when 118 then 119
    61  when 120 then 121
    62  when 122 then 123
    63  when 124 then 125
    64  when 126 then 127
    65  when 128 then 129
    66  when 130 then 131
    67  when 132 then 133
    68  when 134 then 135
    69  when 136 then 137
    70  when 138 then 139
    71  when 140 then 141
    72  when 142 then 143
    73  when 144 then 145
    74  when 146 then 147
    75  when 148 then 149
    76  when 150 then 151
    77  when 152 then 153
    78  when 154 then 155
    79  when 156 then 157
    80  when 158 then 159
    81  when 160 then 161
    82  when 162 then 163
    83  when 164 then 165
    84  when 166 then 167
    85  when 168 then 169
    86  when 170 then 171
    87  when 172 then 173
    88  when 174 then 175
    89  when 176 then 177
    90  when 178 then 179
    91  when 180 then 181
    92  when 182 then 183
    93  when 184 then 185
    94  when 186 then 187
    95  when 188 then 189
    96  when 190 then 191
    97  when 192 then 193
    98  when 194 then 195
    99  when 196 then 197
    100  when 198 then 199
    101  when 200 then 201
    102  when 202 then 203
    103  when 204 then 205
    104  when 206 then 207
    105  when 208 then 209
    106  when 210 then 211
    107  when 212 then 213
    108  when 214 then 215
    109  when 216 then 217
    110  when 218 then 219
    111  when 220 then 221
    112  when 222 then 223
    113  when 224 then 225
    114  when 226 then 227
    115  when 228 then 229
    116  when 230 then 231
    117  when 232 then 233
    118  when 234 then 235
    119  when 236 then 237
    120  when 238 then 239
    121  when 240 then 241
    122  when 242 then 243
    123  when 244 then 245
    124  when 246 then 247
    125  when 248 then 249
    126  when 250 then 251
    127  when 252 then 253
    128  when 254 then 255
    129  when 256 then 257
    130  end x from dual;
             X
    SQL> select version from v$instance;
    VERSION
    10.2.0.2.0
    SQL> select case 1
      2  when 2 then 3
      3  when 4 then 5
      4  when 6 then 7
      5  when 8 then 9
      6  when 10 then 11
      7  when 12 then 13
      8  when 14 then 15
      9  when 16 then 17
    10  when 18 then 19
    11  when 20 then 21
    12  when 22 then 23
    13  when 24 then 25
    14  when 26 then 27
    15  when 28 then 29
    16  when 30 then 31
    17  when 32 then 33
    18  when 34 then 35
    19  when 36 then 37
    20  when 38 then 39
    21  when 40 then 41
    22  when 42 then 43
    23  when 44 then 45
    24  when 46 then 47
    25  when 48 then 49
    26  when 50 then 51
    27  when 52 then 53
    28  when 54 then 55
    29  when 56 then 57
    30  when 58 then 59
    31  when 60 then 61
    32  when 62 then 63
    33  when 64 then 65
    34  when 66 then 67
    35  when 68 then 69
    36  when 70 then 71
    37  when 72 then 73
    38  when 74 then 75
    39  when 76 then 77
    40  when 78 then 79
    41  when 80 then 81
    42  when 82 then 83
    43  when 84 then 85
    44  when 86 then 87
    45  when 88 then 89
    46  when 90 then 91
    47  when 92 then 93
    48  when 94 then 95
    49  when 96 then 97
    50  when 98 then 99
    51  when 100 then 101
    52  when 102 then 103
    53  when 104 then 105
    54  when 106 then 107
    55  when 108 then 109
    56  when 110 then 111
    57  when 112 then 113
    58  when 114 then 115
    59  when 116 then 117
    60  when 118 then 119
    61  when 120 then 121
    62  when 122 then 123
    63  when 124 then 125
    64  when 126 then 127
    65  when 128 then 129
    66  when 130 then 131
    67  when 132 then 133
    68  when 134 then 135
    69  when 136 then 137
    70  when 138 then 139
    71  when 140 then 141
    72  when 142 then 143
    73  when 144 then 145
    74  when 146 then 147
    75  when 148 then 149
    76  when 150 then 151
    77  when 152 then 153
    78  when 154 then 155
    79  when 156 then 157
    80  when 158 then 159
    81  when 160 then 161
    82  when 162 then 163
    83  when 164 then 165
    84  when 166 then 167
    85  when 168 then 169
    86  when 170 then 171
    87  when 172 then 173
    88  when 174 then 175
    89  when 176 then 177
    90  when 178 then 179
    91  when 180 then 181
    92  when 182 then 183
    93  when 184 then 185
    94  when 186 then 187
    95  when 188 then 189
    96  when 190 then 191
    97  when 192 then 193
    98  when 194 then 195
    99  when 196 then 197
    100  when 198 then 199
    101  when 200 then 201
    102  when 202 then 203
    103  when 204 then 205
    104  when 206 then 207
    105  when 208 then 209
    106  when 210 then 211
    107  when 212 then 213
    108  when 214 then 215
    109  when 216 then 217
    110  when 218 then 219
    111  when 220 then 221
    112  when 222 then 223
    113  when 224 then 225
    114  when 226 then 227
    115  when 228 then 229
    116  when 230 then 231
    117  when 232 then 233
    118  when 234 then 235
    119  when 236 then 237
    120  when 238 then 239
    121  when 240 then 241
    122  when 242 then 243
    123  when 244 then 245
    124  when 246 then 247
    125  when 248 then 249
    126  when 250 then 251
    127  when 252 then 253
    128  when 254 then 255
    129  when 256 then 257
    130  end x from dual;
    when 16 then 17
    ERROR at line 9:
    ORA-00939: too many arguments for function
    SQL> del 129
    SQL> /
             X
    ----------

  • Fixed headers while scrolling works fine in bids but not when deployed to reportserver

    Hi, I am using SQL Server 2008 R2 & deploying a report to reportserver with fixed headers while scrolling, this works fine in bids but not when deployed to reportserver. We are IE 9.
    Thanks in advance...............
    Ione

    Hi ione721,
    Since you have identified the 2 xml files are identical, according to my knowledge, there maybe a compatibility issue with IE 9 and SSRS 2008 R2, so I suggest that you could run the report in compatibility mode. Please make sure you have turned on Compatibility
    View in Internet Explorer 9 by following steps:
    When Internet Explorer recognizes that a webpage is not compatible, you will see the Compatibility View button on the Address bar. Try clicking it.
    When Compatibility View is turned on, the button changes from an outline to a solid color when you view the page.
    The following screenshots are for your reference:
    If you have any questions, please feel free to let me know.
    Best Regards,
    Wendy Fu

  • SQL query works in access 2000 but not through JDBC

    Hello to all as my first posted message, I have a bit of a pickle on my hands. I have a query which is critical to for my application to function.
    In Access 2000
    SELECT sb.SeatName
    FROM SeatBooking sb, Movie m, MovieSession ms, Booking b
    WHERE m.MovieId = ms.MovieId
    AND ms.MovieSessionId = b.MovieSessionId
    AND b.BookingId = sb.BookingId
    AND ms.DateOfSession = #2003/04/16 07:15:00 PM#;
    This query works fine. When I insert it into my code
    String query = "SELECT sb.SeatName \n" +
    "FROM SeatBooking sb, Movie m, MovieSession ms, Booking b \n" +
    "WHERE m.MovieId = ms.MovieId \n" +
    "AND ms.MovieSessionId = b.MovieSessionId \n" +
    "AND b.BookingId = sb.BookingId \n" +
    "AND ms.DateOfSession = #" +
    cp.getMovieSessionAt(i).getTrueTimeOfSession() + "#;";
    The last line of code returns #2003/04/16 07:15:00 PM#; Which is the exact same as in Access.
    To rule out some possibilities
    - there are other less complicated queries which access the same database but work fine. so my code seems to be ok
    - I have tried to use Format() on ms.DateOfSession to match the return value of the java statement (Which is a general date in Access in the format of 16/04/2003 7:15:00 PM)
    Any suggestions would be appreciated!

    Hi Simon,
    On my Windows XP system with J2SE SDK version 1.4.1_02 and Micro$oft Access 2002, I have the following table:
    column name    column type
    id             Number
    name           Text
    updated        Date/TimeUsing the JDBC-ODBC bridge driver (that is part of the J2SE distribution), the following code uses the JDBC "escape" syntax -- and it works.
    import java.sql.*;
    public class JdbcOdbc {
      public static void main(String[] args) {
        Connection dbConn = null;
        ResultSet rs = null;
        Statement stmt = null;
        String sql =
          "SELECT * FROM Table1 WHERE updated = {ts '2003-04-13 07:53:23'}";
        try {
          Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
          dbConn = DriverManager.getConnection("jdbc:odbc:db1");
          stmt = dbConn.createStatement();
          rs = stmt.executeQuery(sql);
          if (rs.next()) {
            System.out.println("id      = " + rs.getInt(1));
            System.out.println("name    = " + rs.getString(2));
            System.out.println("updated = " + rs.getTimestamp(3));
        catch (SQLException sqlEx) {
          System.err.println("Database operation failed.");
          sqlEx.printStackTrace();
        catch (ClassNotFoundException cnfEx) {
          System.err.println("JDBC driver class not found");
          cnfEx.printStackTrace();
        finally {
          if (rs != null) {
            try {
              rs.close();
            catch (SQLException sqlEx) {
              System.err.println("ERROR: Failed to close result set");
              sqlEx.printStackTrace();
          if (stmt != null) {
            try {
              stmt.close();
            catch (SQLException sqlEx) {
              System.err.println("ERROR: Failed to close statement");
              sqlEx.printStackTrace();
          if (dbConn != null) {
            try {
              dbConn.close();
            catch (SQLException sqlEx) {
              System.err.println("ERROR: Failed to close DB connection");
              sqlEx.printStackTrace();
    }More details about the JDBC escape syntax are available here:
    http://java.sun.com/j2se/1.4.1/docs/guide/jdbc/getstart/statement.html#999472
    Hope this helps you.
    Good Luck,
    Avi.

  • Cursor query works in anonymous block but not in procedure

    Hello,
    My cursor query works fine in anonymous blcok but fails in pl/sql block.
    Anonymous block:
    declare
    cursor c1 is
    select object_name
    from all_objects
    where owner='IRIS_DATA'
    and object_type='SEQUENCE';
    v_string varchar2(2000);
    begin
    for c2 in c1 loop
    v_string := 'DROP SEQUENCE IRIS_DATA.'||c2.object_name;
    execute immediate v_string;
    end loop;
    commit;
    exception
    when others then
    dbms_output.put_line('Exception :'||sqlerrm);
    end;
    works fine.
    but inside the procedure the it doesn't go inside the cursor loop
    procedure get_sequence is
    l_dp_handle NUMBER;
    v_job_state varchar2(4000);
    l_last_job_state VARCHAR2(30) := 'UNDEFINED';
    l_job_state VARCHAR2(30) := 'UNDEFINED';
    l_sts KU$_STATUS;
    v_logs ku$_LogEntry;
    v_row PLS_INTEGER;
    v_string1 varchar2(2000);
    cursor seq_obj is
    select object_name
    from all_objects
    where owner='IRIS_DATA'
    and object_type='SEQUENCE';
    begin
         log_status('get_sequence started.');
         --Cursor records to drop the sequences before importing.
         for seq_obj_rec in seq_obj loop
    log_status('get_sequence: Dropping sequence started.');
         v_string1 := 'DROP SEQUENCE IRIS_DATA.'||seq_obj_rec.object_name;
    execute immediate v_string1;
         end loop;
         log_status('get_sequence: Dropping sequence completed.');
    exception
    WHEN OTHERS THEN
    log_status('get_sequence: exception.');
    end get_sequence;
    it's not going into the seq_obj_rec cursor.
    I granted select on all_objects to the user.this user is also having the DBA role as well.
    Please advice.

    PROCEDURE Get_sequence
    IS
      l_dp_handle      NUMBER;
      v_job_state      VARCHAR2(4000);
      l_last_job_state VARCHAR2(30) := 'UNDEFINED';
      l_job_state      VARCHAR2(30) := 'UNDEFINED';
      l_sts            KU$_STATUS;
      v_logs           KU$_LOGENTRY;
      v_row            PLS_INTEGER;
      v_string1        VARCHAR2(2000);
      CURSOR seq_obj IS
        SELECT object_name
        FROM   all_objects
        WHERE  owner = 'IRIS_DATA'
               AND object_type = 'SEQUENCE';
    BEGIN
        Log_status('get_sequence started.');
        --Cursor records to drop the sequences before importing.
        FOR seq_obj_rec IN seq_obj LOOP
            Log_status('get_sequence: Dropping sequence started.');
            v_string1 := 'DROP SEQUENCE IRIS_DATA.'
                         ||seq_obj_rec.object_name;
            EXECUTE IMMEDIATE v_string1;
        END LOOP;
        Log_status('get_sequence: Dropping sequence completed.');
    EXCEPTION
      WHEN OTHERS THEN
                 Log_status('get_sequence: exception.');
    END get_sequence; How do I ask a question on the forums?
    SQL and PL/SQL FAQ
    scroll down to #9 & use tags in the future.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Why will a query work in SQL Developer but not in Apex?

    Here's a good one. I created a dynamic LOV with the following query.
    select
    e.DESCR d,
    ee.ENTRD_EVNT_SK r
    from
    PT_EVNT_IN_DIV eid,
    PT_ENTRD_EVNT ee,
    PT_EVNT e
    where ee.PGNT_SK = :PGNT_SK
    and ee.CNTSNT_SK = :CNTSNT_SK
    and ee.EVNT_IN_DIV_SK = eid.EVNT_IN_DIV_SK
    and eid.EVNT_SK = e.EVNT_SK
    and ee.ENTRD_EVNT_SK not in
    (select js.ENTRD_EVNT_SK
    from PT_JDG_SCR js
    where js.JDG_SK = :JDG_SK
    and js.PGNT_SK = :ai_pgnt_sk
    and js.CNTSNT_SK = :CNTSNT_SK)
    order by 1
    The query works fine in SQL Developer, but Apex gives the following error when compiling it in the LOV editor.
    "1 error has occurred
    - LOV query is invalid, a display and a return value are needed, the column names need to be different. If your query contains an in-line query, the first FROM clause in the SQL statement must not belong to the in-line query."
    I tried rearranging the entries in the From clause, but that didn't do any good.
    Do you see what I can do to make Apex accept it?
    Thanks,
    Kim

    Kim
    Kim2012 wrote:
    select
    e.DESCR d,
    ee.ENTRD_EVNT_SK r
    from
    PT_EVNT_IN_DIV eid,
    PT_ENTRD_EVNT ee,
    PT_EVNT e
    where ee.PGNT_SK = :PGNT_SK
    and ee.CNTSNT_SK = :CNTSNT_SK
    and ee.EVNT_IN_DIV_SK = eid.EVNT_IN_DIV_SK
    and eid.EVNT_SK = e.EVNT_SK
    and ee.ENTRD_EVNT_SK not in
    (select js.ENTRD_EVNT_SK
    from PT_JDG_SCR js
    where js.JDG_SK = :JDG_SK
    and js.PGNT_SK = :ai_pgnt_sk
    and js.CNTSNT_SK = :CNTSNT_SK)
    order by 1
    The column named ENTRD_EVNT_SK is used twice in a select. Once in the main select and once in the inline query.
    The validation maybe choking on that.
    Try giving the column in the inline query an alias and see if that helps.
    Nicolette

  • Same Conect By query workds fine in 9i but not in 10g - Please help

    We recently moved our project from 9i to 10g. A connect by query works fine in 9i environment but same not working in 10g environment. Please help.
    While trying with a sample table, that also behaves samem way. Please find the query and help on how to solve.
    create table test_connect_by (
    parent number,
    child number,
    constraint uq_tcb unique (child)
    insert into test_connect_by values ( 5, 2);
    insert into test_connect_by values ( 5, 3);
    insert into test_connect_by values (18,11);
    insert into test_connect_by values (18, 7);
    insert into test_connect_by values (17, 9);
    insert into test_connect_by values (17, 8);
    insert into test_connect_by values (26,13);
    insert into test_connect_by values (26, 1);
    insert into test_connect_by values (26,12);
    insert into test_connect_by values (15,10);
    insert into test_connect_by values (15, 5);
    insert into test_connect_by values (38,15);
    insert into test_connect_by values (38,17);
    insert into test_connect_by values (38, 6);
    insert into test_connect_by values (null, 38);
    insert into test_connect_by values (null, 26);
    insert into test_connect_by values (null, 18);
    COMMIT;
    In Oracle 10g:
    SQL> select level, lpad(' ',2*(level-1)) || to_char(child) s
    2 from test_connect_by
    3 start with level = 1
    4 connect by prior child = parent;
    no rows selected
    In Oracle 9i:
    SQL> select level, lpad(' ',2*(level-1)) || to_char(child) s
    2 from test_connect_by
    3 start with level = 1
    4 connect by prior child = parent;
    LEVEL S
    1 2
    1 3
    1 10
    1 5
    2 2
    2 3
    1 9
    1 8
    1 11
    1 7
    1 13
    1 1
    1 12
    1 15
    2 10
    2 5
    3 2
    3 3
    1 17
    2 9
    2 8
    1 6
    1 38
    2 15
    3 10
    3 5
    4 2
    4 3
    2 17
    3 9
    3 8
    2 6
    1 26
    2 13
    2 1
    2 12
    1 18
    2 11
    2 7
    39 rows selected.

    Hi,
    user10739895 wrote:
    It works fine and gives result without the "START WITH LEVEL = 1".
    However, in 9i, we get the result with the clause "START WITH LEVEL = 1" and after migrating, now in 10g, we are not getting the result. Is it like in 10g, if it is Level 1, we should not specify?
    Also, please clarify, is it like, if we don't specify the default is Level 1? Conceptually, LEVEL is assigned when rows enter the result set. Rows that enter because of the START WITH clause, by definition, have LEVEL=1. Rows that enter because of CONNECT BY have the LEVEL of the row to which they are connected, plus 1.
    "START WITH LEVEL = 1" returns no rows when I try it in Oracle 11.1.0.
    I suggest not using it.
    If you don't have a START WITH clause, you'll START WITH every row in the table. That seems to be what you got in Oracle 9. Is that what you want? If so, then just don't use a START WITH clause.

  • ITunes/Apple Mobile Device works fine w/iPod but not iPad

    Hi. I'm getting stuck on this and would like some help to solving this problem. Basically I'm trying to sync my iPad; however, whenever I connect it, this meesage pops up: "this iPad cannot be used because the Apple Mobile Device is not started." The problem is that when I try to plug in an iPod using the same wire, it works fine, no problem, but the iPad just won't connect. I have since uninstall and reinstall all Apple components (iTunes, AMD, QuickTime, etc) and it's still the same thing...iTunes connects fine w/ the iPod, but not the iPad. What to do? Thnx in advance.
    EDIT:
    Btw, I've tried to connect the iPad while the iPod is connected, and the "Apple Mobile Device is not started" error message pops up too, which is weird, because the iPod is connected and syncing at that time...which means the Apple Mobile Device thing IS started. >.>

    The iOS devices use Apple Mobile Device Service, while older iPods use the iPod Service.
    Checkout this Apple document -> How to restart the Apple Mobile Device Service (AMDS) on Windows
    Are you able to restart the service after following the steps in that article?

  • Can't FLIP a quick RENDER! Works fine in SHAKE but not to flip or Disk!

    Learning with Lynda.com!
    Part 1 has you rendering two files, one is a still image, the other a quicktime movie, I don't have the money for premium so I got my own clouds movie (.mov) and added a still plane.
    I key framed 1 - 100 and playing it back its fine in shake, but not on FLIP or DISK, its nothing but a still image. Have done it 5 times making sure that all the right buttons are on, or not, and as I said, it works INSIDE of shake but won't RENDER to FLIPBOOK!
    I don't suppose anyone wants to send me the exercise files? (on knees begging LOL) I am a member, just can't afford $300 for one pop and this is really the only program I need to learn.
    Thanks!

    Sorry if I'm pointing out something obvious that you already know. Have you checked the time range in the render dialog? Shake does not fill in the values for you automatically, and defaults to "1" so only renders the 1st frame. It needs to be set to eg "1-100".

  • Apple TV working fine with Wireless, but not on Ethernet

    I just got an Apple tv for my B-day and I can't get the Ethernet port to work.
    It works fine on wireless but if i plug in the cable to my 5 port switch that then goes to my router it will not login to the store, or sync or fine youtube. It has and ip and everything. I tried opening that port 38 something. And no go? Does anyone have any ideas?
    I have a 2wire router, and one 5 port switch, the PS3, Wii and Xbox all work on the switch just fine.
    I even upgrade to firmware 2.01

    Thanks for your help guys
    I have tried another ethernet cable but no go. I'm going to get a new one at the store today. As for the IP. the first time I plugged it in the IP was way diffrent from the one on my router so i manually added the new ip and subnet mask etc etc. And still no go. It is seen in itunes but tells me it can't sync. And if i go to the Apple TV it will not open any of the web enabled features. No you tube, no store, no nadda.

  • Query works in DB GUI, but not in CF

    Hello,
    I keep getting a CF error of "invalid character" for the
    attached query.
    Detailed error message: [Macromedia][Oracle JDBC
    Driver][Oracle]ORA-00911: invalid character
    I realize that's an Oracle error code, but the query works in
    an Oracle db GUI (Toad).
    Has anyone experienced this kind of situation?
    Thank you.

    I've never tried using DDL in a CFQUERY myself with an Oracle
    db, but you might try putting the entire statement inline (as in a
    single line), rather than breaking it out like you did. It would be
    hard to read, but it might parse better....... just a thought. I've
    had similar problems with EXECUTE statements within a CFQUERY that
    worked just fine when I rewrote them with no line breaks, etc.
    Phil

  • IP - Issues with Input Query: Works on Bex analyzer but not on Web

    I am doing the following:
    Created a Aggregation level for a multi provider which has only real time infoproviders associated with it
    Created the query using Bex Query Designer availing all the options for planning
    When I execute this query it executes using a web template and does not open up the Key Figure cells for input, I had tried using the Web Application designer with Save button but still the same issue
    I tried the same on Bex analyzer and it works fine
    Please help to resolve the above issue.
    Thanks in advance.

    Hi Ram,
    Cells should be input enabled on the web just running the query. No need to create a Webtemplate, altough you need to have the webtemplate to be able to use the "save data" function.
    Maybe your query is not input ready at all, and you're misinterpreting analyzer layout.
    To test this, please enter some plan data in analyzer, right click and choose "save".
    Please check if data is written to the real time infoprovider.
    Hope this helps you.
    Regards,
    Miguel P.

  • MySQL query works fine for Debug mode not during regular run mode

    Hello fellow Java gurus,
    I'm very much confused at the moment. I have an Java application that populates and accesses a MySQL database. It's a little complicated to explain but basically I've got a few threads that manipulate it. The database itself can handle multiple client connections.
    Now, my first SQL query determines whether records exist within a particular timeframe, since one of my columns is a time of arrival (toa). This works fine in debug and normal run mode. My second SQL query is only executed once the first query returns true, which occurs 100% of the time. The second query is very similar, however, has the very weird behaviour of working the way I want it during debugging mode, but doesn't work at all during normal run mode. I really do not understand. I've tried running the 2nd query using the same connection and also a different connection as to the 1st query but it really doesn't make a difference to the non-working outcome.
    If anyone has any ideas as to as to why this is happening, please help me. Any feedback would be greatly appreciated. I am desperate at the moment.
    Kind regards,
    Mitch.

    Sorry everyone, I've been able to solve it. My boolean variables were being set to their opposite values! Silly me.... cheers anyway....

  • Can't delete file after renaming due to Word file handle still present. Error staes document is still in use but it's really not. Worked fine in 2007 but not in 2010.

    I have some code associated with a Word Template. The template is opened, filled out and saved via a routing in vba. This all works fine in older 2007 version (which is version it was originally created in). Once this file is saved, the user can change the
    date in a text box and re-save document. The code saves using the new date for part of new file name and then deletes that older file from the server. It fails at the delete function because the newer version of word is not dropping the file handle from the
    first named file when user saves it to the new filename. In older version (2007) this handle was released as soon as file was saved to a different name. I can't seem to figure out how to release the old document filename so the old document file can be deleted.
    I hope I explained this well enough.
    Here's the code that woeked in version 2007 but fails in version 2010.
    Option Explicit
    Dim CAPEX01 As MSForms.ComboBox
    Dim CAPEX02 As MSForms.ComboBox
    Dim LocalPath As String
    Dim NetPath As String
    Dim OldPath As String
    Dim OldPathNet As String
    Dim DocName01 As String
    Dim DocName02 As String
    Dim DocName03 As String
    Dim DocName04 As String
    Dim DocName As String
    Dim DocNameold As String
    Dim TestDocName As String
    Dim filesys
    Dim newfolder
    Sub AutoOpen()
    ActiveDocument.ActiveWindow.View.Type = wdPrintView
    TestDocName = ActiveDocument.TextBox2
    OldPathNet = "\\yourPath\" & TestDocName & "\"
    End Sub
    Sub AutoNew()
    TestDocName = ActiveDocument.TextBox2
    OldPathNet = "\\yourPath\" & TestDocName & "\"
     ComboBox1.Locked = False
     ComboBox1.Enabled = True
     FillList1
     FillList2
     End Sub
    Sub DeleteOldDoc()
    OldPathNet = "\\yourPath\" & TestDocName ' & "\"
    DocNameold = OldPathNet & TestDocName & "-" & DocName02 & "-" & DocName03 & "-" & DocName04 & ".doc"
        If Not TestDocName = DocName01 Then
            Set filesys = CreateObject("Scripting.FileSystemObject")
        If filesys.FileExists(DocNameold) Then
            filesys.DeleteFile (DocNameold), True      
     'I get file permission error here
        End If
        End If
    If DocName01 <> "" Then
    If Not TestDocName = DocName01 Then
    If Not TestDocName = "" Then
        MsgBox "Project Proposal Has Been Moved From Year " & TestDocName & " To " & DocName01 & ""
    End If
    End If
    End If
    TestDocName = DocName01
    End Sub
    '''''''Document path functions''''''
    Sub chkpath()
    Set filesys = CreateObject("Scripting.FileSystemObject")
    If Not filesys.FolderExists("\\yourPath\") Then
       newfolder = filesys.CreateFolder("\\yourPath\")
    End If
    If Not filesys.FolderExists("\\yourPath\" & DocName01 & "\") Then
        newfolder = filesys.CreateFolder("\\yourPath\" & DocName01 & "\")
    End If
    End Sub
    ''''''Save Function''''''
    Private Sub CommandButton1_Click()
    DocName01 = ActiveDocument.TextBox2
    DocName02 = ActiveDocument.TextBox4
    DocName03 = ActiveDocument.TextBox1
    DocName04 = ActiveDocument.ComboBox1.Value
    chkpath
    NetPath = "\\yourPath\" & DocName01 & "\"
    DocName = NetPath & DocName01 & "-" & DocName02 & "-" & DocName03 & "-" & DocName04
    ActiveDocument.SaveAs2 FileName:=DocName, FileFormat:=wdFormatDocument
     ComboBox1.Locked = True
     ComboBox1.Enabled = False
     ComboBox2.Locked = True
     ComboBox2.Enabled = False
     TextBox1.Locked = True
     TextBox1.Enabled = False
     TextBox3.Locked = True
     TextBox3.Enabled = False
     TextBox4.Locked = True
     TextBox4.Enabled = False
     DeleteOldDoc
    End Sub
    Sub FillList1()
    Set CAPEX02 = ActiveDocument.ComboBox2
      With CAPEX02
          .AddItem "CASTING", 0
          .AddItem "HOT ROLLING", 1
          .AddItem "COLD ROLLING", 2
          .AddItem "FINISHING", 3
          .AddItem "PLANT GENERAL", 4
          .AddItem "MOBILE EQUIPMENT", 5
      End With
    End Sub
     Sub FillList2()
     Set CAPEX01 = ActiveDocument.ComboBox1
      With CAPEX01
          .AddItem "A Name", 0
          .AddItem "Another Name", 1
      End With
    End Sub
    Private Sub CommandButton2_Click()
        UserForm1.Show
    End Sub

    mogulman52 and Don,
    I went back and looked at my code and had already updated it to SaveAs in the new docx format. It still holds the lock handle in place until Word closes, unlike earlier versions which released the lock handle when you did a SaveAs.
    As a note, all my Word and Excel macro-enabled (dotm & xltm) templates are read only and are never filled in, prompting the user for a file name on any close event or if they run the code gets auto-named. I do the SaveAs and concatenate the file name
    from data on the document (or sheet) that has been filled in. During the SaveAs the docx gets saved to a network folder and also on a local folder. The lock gets renamed to the filename and remains until Word is closed.
    So my code still fails at the point noted below while trying to delete an old filename version after the file has been saved as a new filename in a new folder. So....
    The code is looking in the last folder where the docx file was saved for the older filename so it can be deleted. The newest docx version has already been saved in a different folder and has a new lock handle of its own. That lock is not my problem, it's
    the older file lock which really exists in the same folder as the first filename that the docx was saved to. It does not release that lock until I exit Word. My work around has been to instruct all users to manually delete the older version file.
    The other odd thing is this only happens when I run it from code, if you manually go through these steps with the SaveAs menu drop-downs in Word it will release the lock handle???
    Hope this isn't to confusing and thanks for all your suggestions and help.
    Sub DeleteOldDoc()
    OldPathNet = "\\yourPath\" & TestDocName ' & "\"
    DocNameold = OldPathNet & TestDocName & "-" & DocName02 & "-" & DocName03 & "-" & DocName04 & ".doc"
    If Not TestDocName = DocName01 Then
    Set filesys = CreateObject("Scripting.FileSystemObject")
    If filesys.FileExists(DocNameold) Then
    filesys.DeleteFile (DocNameold), True 'I get file permission error here- lock handle is still present from last SaveAs command in last folder where previous version of file was saved.
    End If
    End If
    If DocName01 <> "" Then
    If Not TestDocName = DocName01 Then
    If Not TestDocName = "" Then
    MsgBox "Project Proposal Has Been Moved From Year " & TestDocName & " To " & DocName01 & ""
    End If
    End If
    End If
    TestDocName = DocName01
    End Sub
    Glenn

Maybe you are looking for

  • Need help! nano isn't recognized by windows!

    I hooked my brand new ipod nano up to my computer and it appears to be charging. I have done the 5 Rs one hundred times each. It shows up in the device manager with a yellow question mark and exclamation point. When I plug it in, it makes the little

  • TA27580 My computer is no longer recognizing my ipod mini. How can I sync it to my computer?

    I had a different computer, which I had to leave behind, when I moved,  that was in sync with my ipod. I have downloaded itunes onto a computer here in Houston. When I plug my ipod into the computer, it charges but does not appear on the computer. I

  • Problem in cloning a boolean data of an array

    Hi Guyz, Just tried my hand in cloning. I am trying to clone a class Sam which contains array of Test. Test just has a single boolean data type value1. In Sample, the object of Sam has the value1 (in Test[0]) as 'false'. I have cloned this object. I

  • Mac book air capacity

    is mac book air capable of supporting auto cad, hyperworks ,catia  proe ,etc

  • Transactional Data vs. Master Data

    I need to implement a BW but I have the following question; Imagine I have Master Data like: Material: Materialname Materialgroup Time: Month Year Costumer Name Town Region On the other hand I have transactional data: Sales Amount I wonder how do I g