Query works great in 9i, but on 10g massive slow down.

Hi,
I am facing some trouble when running a query in 10g and i don't know why.It is currently working fine in 9i.
The query is like this:
delete from x
where (a,b,c,d,e,f) in (select a,b,c,d,e,f
from y
where site='AMERICA'
and appli='ORACLE')
and site='AMERICA'
and appli='ORACLE'
y table has 117573 entries for the site,appli combination
and x table has 117621 records for the site appli combination
It executes in 28 secs in 9i but on 10g it goes on for hours.
Stats have been calculated on the table and the tables are partitioned on site and appli combination
The explain plan shows an index range scan on the primary key index.
I tried changing the query to use exists instead of in, but it did not help.
Could someone help me with this please?

Hi,
Thanks a lot for the suggestions. Please find some additional information on the query.
DELETE FROM FL_WK_ECART
WHERE
(IDMODELE,IDVECTEUR,IDLIGNE,CDSITEFO,CDSITEBO,CDAPPLIFO,CDAPPLIBO,TPOPEFO,TPOPEBO,IDOPEFO,IDOPEBO,NOFLUXFO,NOFLUXBO,TPFLUXFO,TPFLUXBO )
     IN ( SELECT IDMODELE,IDVECTEUR,IDLIGNE,CDSITEFO,CDSITEBO,CDAPPLIFO,CDAPPLIBO,TPOPEFO,TPOPEBO,IDOPEFO,IDOPEBO,NOFLUXFO,NOFLUXBO,TPFLUXFO,TPFLUXBO
     FROM     FL_ECART
     WHERE     CDSITEFO      = '0769'
     AND     CDSITEBO      = '0769'
     AND     CDAPPLIFO      = 'KONDORFX'
     AND     CDAPPLIBO      = 'OMR'
AND     CDSITEFO      = '0769'
AND     CDSITEBO      = '0769'
AND     CDAPPLIFO      = 'KONDORFX'
AND     CDAPPLIBO      = 'OMR'Version of the database =SQL*Plus: Release 10.2.0.4.0
SQL> show parameter optimizer;
NAME TYPE VALUE
optimizer_dynamic_sampling integer 2
optimizer_features_enable string 10.2.0.4
optimizer_index_caching integer 0
optimizer_index_cost_adj integer 100
optimizer_mode string ALL_ROWS
optimizer_secure_view_merging boolean TRUE
SQL>
SQL> show parameter db_file_multi
NAME TYPE VALUE
db_file_multiblock_read_count integer 16
SQL> show parameter db_block_size
NAME TYPE VALUE
db_block_size integer 8192
SQL> show parameter cursor_sharing
NAME TYPE VALUE
cursor_sharing string EXACT
PLAN_TABLE_OUTPUT
| Id | Operation | Name | Rows | Byte
| 0 | DELETE STATEMENT | | 1 | 15
| 1 | DELETE | FL_WK_ECART | |
|* 2 | TABLE ACCESS BY INDEX ROWID | FL_WK_ECART | 1 | 8
| 3 | NESTED LOOPS | | 1 | 15
| 4 | SORT UNIQUE | | 1 | 7
| 5 | PARTITION RANGE SINGLE | | 1 | 7
| 6 | PARTITION LIST SINGLE | | 1 | 7
| 7 | TABLE ACCESS BY LOCAL INDEX ROWID| FL_ECART | 1 | 7
|* 8 | INDEX RANGE SCAN | FL_ECART_PK2 | 1 |
|* 9 | INDEX RANGE SCAN | FL_WK_ECART_PK2 | 1 |
Predicate Information (identified by operation id):
2 - filter("TPOPEFO"="TPOPEFO" AND "TPOPEBO"="TPOPEBO" AND "IDOPEFO"="IDOPEFO
PLAN_TABLE_OUTPUT
"IDOPEBO"="IDOPEBO" AND "NOFLUXFO"="NOFLUXFO" AND "NOFLUXBO"="NOFL
"TPFLUXBO"="TPFLUXBO")
8 - access("CDSITEFO"='0769' AND "CDAPPLIFO"='KONDORFX' AND "CDSITEBO"='0769'
9 - access("CDSITEFO"="CDSITEFO" AND "CDAPPLIFO"="CDAPPLIFO" AND "CDSITEBO"="
"CDAPPLIBO"="CDAPPLIBO" AND "IDMODELE"="IDMODELE" AND "IDLIGNE"="I
filter("CDSITEFO"='0769' AND "CDSITEBO"='0769' AND "CDAPPLIFO"='KONDORFX'
AND "IDVECTEUR"="IDVECTEUR" AND "IDLIGNE"="IDLIGNE")
Note
- 'PLAN_TABLE' is old version
31 rows selected

Similar Messages

  • HT4623 Iphone 4s works great most everywhere but at home.

    Hello All, I have two iphone 4s that work great most everywhere but home thru a cell phone amplifier. I get great numbers in the field test mode -80 to -65
    and it still only works around 5% of the time. I've tried to reset the network, toggle in &out of airplane mode and turning it off and on still no luck. I noticed that the rrc state keeps switching from connect to disconnect. I think when it works the rrc state will read CELL_something. Is there a cure? Thanks for any help.
    Bryan

    I don't think I can, my Internet is not very fast. I still don't understand why the phone won't connect with the strong signal I'm getting I've heard there is some kind of glitch in the 4s and 5 iphones that it won't switch automatically,
    The iphone 4 has a manual switch..I installed the new update last night, SOS it didn't help, if anything it made it worst.

  • Where to find the best application for cleaning out my MacBook Air with OS X 10.7.5? I've been using MacKeeper but believe it's slowing down my laptop considerable.

    where to find the best application for cleaning out my MacBook Air with OS X 10.7.5? I've been using MacKeeper but believe it's slowing down my laptop considerable. Thank you.

    How to maintain a Mac
    1. Make redundant backups, keeping at least one off site at all times. One backup is not enough. Don’t back up your backups; make them independent of each other. Don’t rely completely on any single backup method, such as Time Machine. If you get an indication that a backup has failed, don't ignore it.
    2. Keep your software up to date. In the Software Update preference pane, you can configure automatic notifications of updates to OS X and other Mac App Store products. Some third-party applications from other sources have a similar feature, if you don’t mind letting them phone home. Otherwise you have to check yourself on a regular basis. This is especially important for complex software that modifies the operating system, such as device drivers. Before installing any Apple update, you must check that all such modifications that you use are compatible.
    3. Don't install crapware, such as “themes,” "haxies," “add-ons,” “toolbars,” “enhancers," “optimizers,” “accelerators,” "boosters," “extenders,” “cleaners,” "doctors," "tune-ups," “defragmenters,” “firewalls,” "barriers," “guardians,” “defenders,” “protectors,” most “plugins,” commercial "virus scanners,” "disk tools," or "utilities." With very few exceptions, this stuff is useless, or worse than useless. Above all, avoid any software that purports to change the look and feel of the user interface.
    The more actively promoted the product, the more likely it is to be garbage. The most extreme example is the “MacKeeper” scam.
    As a rule, the only software you should install is that which directly enables you to do the things you use a computer for — such as creating, communicating, and playing — and does not modify the way other software works. Use your computer; don't fuss with it.
    Safari extensions, and perhaps the equivalent for other web browsers, are a partial exception to the above rule. Most are safe, and they're easy to get rid of if they don't work. Some may cause the browser to crash or otherwise malfunction.  Some are malicious. Use with caution, and install only well-known extensions from relatively trustworthy sources, such as the Safari Extensions Gallery.
    Never install any third-party software unless you know how to uninstall it. Otherwise you may create problems that are very hard to solve.
    4. Beware of trojans. A trojan is malicious software (“malware”) that the user is duped into installing voluntarily. Such attacks were rare on the Mac platform until sometime in 2011, but are now increasingly common, and increasingly dangerous.
    There is some built-in protection against downloading malware, but you can’t rely on it — the attackers are always at least one day ahead of the defense. You can’t rely on third-party protection either. What you can rely on is common-sense awareness — not paranoia, which only makes you more vulnerable.
    Never install software from an untrustworthy or unknown source. If in doubt, do some research. Any website that prompts you to install a “codec” or “plugin” that comes from the same site, or an unknown site, is untrustworthy. Software with a corporate brand, such as Adobe Flash Player, must be acquired directly from the developer. No intermediary is acceptable, and don’t trust links unless you know how to parse them. Any file that is automatically downloaded from a web page without your having requested it should go straight into the Trash. A website that claims you have a “virus,” or that anything else is wrong with your computer, is rogue.
    In OS X 10.7.5 or later, downloaded applications and Installer packages that have not been digitally signed by a developer registered with Apple are blocked from loading by default. The block can be overridden, but think carefully before you do so.
    Because of recurring security issues in Java, it’s best to disable it in your web browsers, if it’s installed. Few websites have Java content nowadays, so you won’t be missing much. This action is mandatory if you’re running any version of OS X older than 10.6.8 with the latest Java update. Note: Java has nothing to do with JavaScript, despite the similar names. Don't install Java unless you're sure you need it. Most people don't.
    5. Don't fill up your boot volume. A common mistake is adding more and more large files to your home folder until you start to get warnings that you're out of space, which may be followed in short order by a boot failure. This is more prone to happen on the newer Macs that come with an internal SSD instead of the traditional hard drive. The drive can be very nearly full before you become aware of the problem. While it's not true that you should or must keep any particular percentage of space free, you should monitor your storage consumption and make sure you're not in immediate danger of using it up. According to Apple documentation, you need at least 9 GB of free space on the startup volume for normal operation.
    If storage space is running low, use a tool such as the free application OmniDiskSweeper to explore your volume and find out what's taking up the most space. Move rarely-used large files to secondary storage.
    6. Relax, don’t do it. Besides the above, no routine maintenance is necessary or beneficial for the vast majority of users; specifically not “cleaning caches,” “zapping the PRAM,” "resetting the SMC," “rebuilding the directory,” "defragmenting the drive," “running periodic scripts,” “dumping logs,” "deleting temp files," “scanning for viruses,” "purging memory," "checking for bad blocks," "testing the hardware," or “repairing permissions.” Such measures are either completely pointless or are useful only for solving problems, not for prevention.
    The very height of futility is running an expensive third-party application called “Disk Warrior” when nothing is wrong, or even when something is wrong and you have backups, which you must have. Disk Warrior is a data-salvage tool, not a maintenance tool, and you will never need it if your backups are adequate. Don’t waste money on it or anything like it.

  • I have recently bought macbookpro but it is getting slow down. How to fix this issue

    I have recently bought macbookpro but it is getting slow down. How to fix this issue

    Too vague a question.
    What is slow... the bootup... or something else?
    Start with repairing disk permissions.

  • 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
    ----------

  • 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.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • 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

  • 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

  • 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

  • Popup windows work great in IE but not in FireFox

    I'm sorry if some of you helpful folks are tired of seeing my questions, but...
    I have a page with thumbnails (which float correctly thanks to Altruistic Grandpa) and clicking on each thumbnail opens a new window with a larger version of the photo and some text. It works great in IE - the window opens and closes like it should - but in FireFox it creates a second browser window that has to be manually closed in order to return to the index page.
    Any suggestions?
    http://acemon.com/features.html
    -Ace-

    Thank you, Nancy.
    Not only did that solve the FireFox problem, it also fixed a minor glitch when previewing in IE.
    Every day I learn something new. I just wish I had more days.
    -Ace-

  • Have Imac with boot camp windows 7. Sound works great in mac but no sound in windows?

    I have new IMAC 24 with snow leopard os and installed windows 7 ultimate 32 with boot camp. The sound works great when in MAC but there is no sound when boot up in windows.The mixers show a sound level as music is plaing but no sound out of speakers or earphones. I read on forum that many others have had same situation with Mac Book Pros and had success by downloading new realtec audio drivers, but my system has Cirius 2406 ab9 drivers and I can't find any replacements for them. Does anyone have a fix?

    Keep on trying, keep searching as there are quite a few work around's for different issues.
    One way is to reinstall the Boot Camp drivers and update them again via the Apple Software Updater in Windows. You did update them the first time, right?
    Or extract the sound drivers from the Boot Camp package (or the DVD if you have it) and just install those again. You should find a few how-to's in the search results.
    Sorry I can't help more...

  • G5 Power Supply Popped - Still works but fan speeds up/slows down nonstop!

    Hi,
    After applying a security update for Tiger 4.11 on my G5 1.6 a few hours later my machine made a bang/pop sound. It still powers up but once running it sounds like the machine is ramping up to speed and slowing down again. It does this continuously even when machine is running. Apple hardware test reports no problems but i'm concerned. Any ideas?
    Thanks.
    Dan

    I had a similar problem (fans speeding up then slowing down). I have iStat installed so I was able to look at the rpm's of the fan (free widget btw). My CPU fans ranged from 2500 to 3200, oscilated all day long....up, down, up, down ...every few seconds. I noticed my CPU utilization was up, which was odd since my machine was somewhat idel. Looked at Activity monitor and saw my CPU's sometimes reached 90%. The application that was using the CPU's was the printmgr. Stopped the process and everything is ok. I know it is unrelated to the popping sound but you might ck the activity monitor to see what is going on.

  • My Mac book pro has the end of a earphone stuck to it. After this I updated to maverick, and this massively slowed down my computer.Now my laptop is switching on and logging in just fine, but after logging in the screen goes white. What can the reason be?

    At first my laptop was fine after the earphone end got stuck in. Soon it started getting slower, and suddenly it stopped switching on. The people in the service station said that it wAs because the hard disk drive was corrupted. I came back home, and immediately it stopped working again. This time they said it was because of water spill. They changed the entire key board and then it started working for a while. Later I updated to maverick and that slowed down my computer. Once, I switched on my laptop, logged in, and then the screen went white. When we took it to the service center they said they will need to replace the hard disk. I am not sure what I should do. Any suggestions?

    Liquid damage from water spill is progressive, unfortunately.
    Best.

  • Completed all Troubleshooting steps but continue to get slow downs from unresponsive scripts on Firefox. Is there a way to use my browser w/out slow downs?

    Mac OSX.
    I've gone through the list of troubleshooting tips for slow downs and for unresponsive scripts. I continue to get slow downs to my computer and browser when I use my Firefox. It is becoming so bad that sometimes I cannot get work done.

    And now, I think I've identified part of the issue. When you pin tabs as an app tab, this slows down Firefox in all the ways I mentioned. Please, please Firefox, if you are going to offer such a useful and simple thing, make sure that it works...
    Having closed these App Tabs, I had a temporary break from the slow downs... Then after another few minutes, the slow downs in Firefox continued... At my wits end.

Maybe you are looking for

  • Passing Degree Symbols in a Parameter Field

    We have a parameter on a crystal report configured to look up data from the database to allow a user to select values. If someone selects a value that has a degree symbol in it then tries to run the report we get a parameter not valid error. We see t

  • Submit PDF via Button Click into Email

    event.target.submitForm({cURL:"mailto:[email protected]" + "?subject=" + subjectext + "&body=" + bodytext + "&cc=" + ccemail address ,cSubmitAs:"PDF",cCharset:"utf-8"}); cURL:"mailto:" can also write cURL:"mailto:" + variable   (i.e.= field containin

  • Why i cant connect my ipad to my pc it always show not charging?

    does anyone experienced the same that i'm having now? I cannot sync my ipad to my laptop, it always show "not charging". Please help me how can i fix it.thanks.

  • Tooltip widget?

    Anyone know of a widget for use in iBooks Author that allows the author to create tool tip links for specific words or phrases in your book? I have seen something similiar to this on many web sites over the years. You can mouse over a word and get a

  • View hidden files?

    how can you view hidden files on the iBook? my ipod is hidden, or doesnt show up...