Problem weird int

I'm working on the percentage of the loaded file and instead of getting a value between 0 and 100 im get values such as-33000 - can someone help me find the reason why please?

bytesRead = (int)infile.gcount();

        if(bytesRead > 0){

            completeBytesRead += bytesRead;
            per = (((double)completeBytesRead)/((double)fileSize))*100;
            percent = per;
            printf("file percent %d \n", percent);
            fflush( stdout );
            dialog_set_progress_toast_level(dialog, percent);

Thanks for any help you can provide.

int completeBytesRead, bytesRead, p = 0;

This is equivalent to:

int completeBytesRead; not initialized
int bytesRead; not initialized
int p = 0;

This should fix it:
int completeBytesRead = 0, bytesRead = 0, percentage = 0;

Tags: BlackBerry Developers

Similar Questions

  • Screen problem weird motorcycle G Sec Gen

    Hey all,.

    I recently got the bike G Sec Gen and love the camera much. I am facing a weird problem though.

    If I look at the screen of the phone when the phone is off, I see a pattern of lines under the glass. While browsing these models look as important that it appears as a 'net' and reflect a lot at the point of asking for a replacement who obviously has been dismissed as the service center guys can't as a problem and said that it is normal that screen to be like this.

    The IFP photo:

    Now, you could say it's normal but this ground is as important in certain angles while navigation and under direct light that it looks almost like a defect! Anyone facing this problem?

    What conditions did you take this picture under? Angle, lighting, etc.

    This is what we see in the yellow box at the bottom of the screen, or simply in the yellow box?

    Mark

    Forums Manager

  • Charset problem - weird icons that appear

    Hi guys, I have changed just a joomla site for a site in PHP using Dreamweaver CC, but now everything suddenly these strange icons question mark that appear anywhere in the pages (a problem I have never with Adobe before and had only once before, when I launched a joomla site).  My server support said it was a problem of charset, so I tried to change the < meta charset = "utf-8" > at < meta http-equiv = "Content-Type" content = text/html"; Charset = UTF - 8 "> hoping that would do the trick (I obviously don't know much about this problem) - but no luck.  Any thoughts would be much appreciated.  My site with the weird icons is to http://www.gymnasticshypnosis.com
    See you soon,.

    Craig T

    I get this crazy all the time. One way that I try to overcome what has worked in the past is by adding a line of code to the database file 'connection '. (see bold below)

    If you are using the old mysql extension:

    $con = mysql_connect("localhost","username","password");  
    mysql_set_charset('utf8',$con);

    If you are using the most recent mysqli extension:

    $con = mysqli_connect("localhost","my_user","my_password","my_db");

    mysqli_set_charset ($con, "UTF8");

    Try one of the above and see if that makes a difference. Like you, I found just to add that the correct meta to the page character set does not always.

  • Problem weird again with multiple entries of each album and artist

    For some reason, itunes suddenly began to create an element for each song I download, whether it's an album there or by an artist that I have. I was able to correct some of them harassing again and again with the sorting, but most of the time, it creates just an additional entry! I have about 20 different Manic Street Preachers who come upward (my group preferred so many downloads). How can I fix! Very annoying!

    If iTunes displays multiple instances of an artist or an album then generally what works is to select all the associated tracks and use read the information to add say an end X for each of the areas of the slopes have in common:

    • For an album. Album, Album artist, and artist (if the artist is the same for all tracks) *
    • For an artist; Album artist (and the artist unless there are comments/featured artists listed which should not be changed)

    Apply the change which merges things together, then remove the excess characters. Occasionally, it can help to close and reopen iTunes between two renaming operations.

    * If the titles must be synchronized to a non - iOS device, there should be a common artist or the album must be defined as a Compilation.

    Use the view of songs and display fields, Album, genre, Album, Album artist, genre artist Album, artist and genre artist side by side to see you whether or not it is necessary to change the artist and if sorting values could be the cause of additional problems. See grouping in albums, titles for help if necessary.

    Another tip duplicates stubborn reality. I had three batches of various artists in the view of artists in my iTunes game library the other day that would not respond to usual treatment X back. What I found worked was adding the final X, but with each group, iTunes wanted to separate start typing a value and let iTunes autocomplete of the Var... for various artists. Collection of AutoComplete lists seemed to work when the full value of collage/montage does not.

    TT2

  • Satellite A200 - upgrade to Windows 7 - DVD Player problems weird!

    Hello

    I decided to upgrade to Windows 7 rather than replace my A200, which is always good as new after 3 1/2 years...

    In typical MS fashion, the upgrade was not incident free, but the main problem is that my DVD drive will no longer read my 2007 Microsoft Office installation disc.

    I CAN read the disc I've burned before the upgrade (with files/photos matching on etc.)

    Someone at - it ideas? Tried to update the driver and by stopping the service Detection hardware kernel (such as recommended on a forum of MS), but no luck

    Thanks in advance!

    > main problem is that my DVD drive will no longer read my 2007 Microsoft Office installation disc.
    A friend of mine had the same problem with the disc of MS Office.
    It was not possible to read this disc, but other drives were compatible.
    He cleaned the drive laser lens with a hint of alcohol and cotton wool, and it helped.

    Check it!

  • Please help - problem driver WEIRD mouse (read below) - DV4 - 1125nr

    Hello.. so here is the problem - I turned off the tap for the mouse... I type always accidentally things when I don't want to, so it is important to me that it is turned off.  The problem is that once the computer starts, it takes literally about 10 minutes for that to happen... In other words, tapping is enabled for a solid 10 minutes EVEN IF I SEE THAT it IS TURNED OFF!  This is my 2nd model of this computer - my first had a pixel died, so I returned it, but he did not have this problem (weird!).  Any ideas? Thank you!

    -Eric

    You can right click on the pointing device icon in the taskbar (bottom right of the clock) and go to the Properties section of the owners SW to massively reduce the sensitivity of the action of tapping until point of him not to recognize taps.

  • Creating cloud fungerar ej, gar ej att komma pa at gar inte att uppdatera prioriterede, eller avinstallera heller.

    Hej,

    uppkommit med ett problem creative cloud mittens nyligen,

    JAG kommer ej in i det, och nar at startar star det att jag ska uppdatera den stanger bara av pa 99% men.

    JAG har aven forsokt avinstallera och om Borja, men det mig inte heller gora da den säger att den later "en aldre version av cloud creative fortsätt kors ', men jag kan inte heller stanga av det.

    AR det dags for en riktig omstart pa datorn och radering av allt & Borja om? Eller det som har advice pa vad jag kan gora Nagot ar?

    When you ask a question you will need to provide some basic information

    -Forum quick start https://forums.adobe.com/docs/DOC-5601

    Mac or Windows and EXACTLY what version of the operating system?

    Recent Mac AND Windows operating systems have been known to cause problems "weird."

    Using a full account of computer administrator with read/write permission?

    Exactly what version of the program do you have problems?

    Sign out of your account... Uninstall... to run vacuuming...

    -non-Cloud programs, to disable the service before uninstalling

    -http://helpx.adobe.com/creative-cloud/help/install-apps.html (and uninstall)

    -using the vacuuming after uninstalling and before reinstalling is often necessary

    -https://helpx.adobe.com/creative-suite/kb/cs5-cleaner-tool-installation-problems.html

    -Restart your computer... Sign in to your account... Reinstall

    - and 5 steps in response to #1 https://forums.adobe.com/thread/2144928

  • Edge of metering size buffer/table problem (VC ++)

    Hello

    Accidentally, I posted this in the multifunction DAQ forum so forgive me for posting this again here.

    I'm trying to make an edge stamped with PCI-6115 of counting for the application that I'm developing.

    Ideally, I initialize a buffer array, then use a sample clock time and acquire the values of a counter which will then be stored in a buffer.  After a number of samples, I would then use the DAQmxReadCounterU32 function to extract this data and perform calculations.

    However, windows gives me an error when I try to initialize the size of the stamp of table is larger than 255001, I need 264000 +.

    Essentially, it seems that only this part of the code to execute:

    error int = 0;

    TaskHandle taskHandle = 0;

    TaskHandle taskHandleCtr = 0;

    given uInt32 [260000];

    After trying initialize the array of uInt32 my program crashes saying there was an error with my exe with a popup asking me if I want to send an error report to Microsoft.

    That would be a problem of windows not afford to allocated more 255000 32bits samples for this table?  If so how can I put the table on the memory embedded amount?

    Sorry guys, it actually had nothing to do with the DAQ card.

    He was apparently C++ that limits the size of the array that I called him, which was the traditional "int a [size]".

    I used this rather to solve my problem:

    int * a = NULL;
    a = new int [10000000];

    Problem solved.

    Sorry for posting in the wrong forum and thanks to all who read this.

    Howard

  • Problem with shorts and arithmetic byte.

    I'm doing some tests involving long, int, short, and byte.

    lT, lS are long

    He, here is are of type int.

    sT, sA, sS are short

    bT, bA, bS are bytes

    Now I have some expressions of the form: xT = xT + xA

    This compiles for long and int, but for the short and byte, I get an error of precision.

    The problem is that arithmetic more small that int is made to int and then converted in byte or short as appropriate.

    int convert to int.

    int converts long and long long turns.

    Thus, there is no problem with int and long.

    However sT = sT + his causes a compilation related to the precision error.

    This seems like a bug to me, because you might same conditions of overflow with long and whole (ints).

    Is this a bug with our J2ME app or a "characteristic". If it's a feature, can someone point me to a link on the web where it says this...?

    Thank you

    -Donald

    The + operator return type is int, unless one of the operands is long, in which case the return type is long. It's like that with JAVA in general, not just the bb or the micro-publishing.

    byte b1 = 1, b2 = 2;
    B1 = (byte) (b1 + b2); needs expressed
    B1 = b2; didn't need casting

    Yes, it's a bit silly. You get used to it after awhile.

    Cheers, Barak.

  • Compatibility PC problem

    I made my subscription of one year and my cloud Barnard says I have a problem of compatibility. I have already uninstall and reinstall but does not work stil, before an i had a month of free and creative cloud would work perfectly, can someone help me?

    When you ask a question you will need to provide some basic information

    -Forum quick start https://forums.adobe.com/docs/DOC-5601

    Mac or Windows and EXACTLY what version of the operating system?

    Recent Mac AND Windows operating systems have been known to cause problems "weird."

    Using a full account of computer administrator with read/write permission?

  • have problem in uninstalling market

    After I run, it appears APPCRASH @.

    When you ask a question you will need to provide some basic information

    -Forum quick start https://forums.adobe.com/docs/DOC-5601

    Mac or Windows and EXACTLY what version of the operating system?

    Recent Mac AND Windows operating systems have been known to cause problems "weird."

    Using a full account of computer administrator with read/write permission?

    Exactly what version of the program do you have problems?

  • Photoshop CC on the creative cloud trial stops at 42% with an error not described. I've tried everything! I had a look at my logs to download but I don't understand what the problem is! Help, please!

    06/12/15 15:59:38:523 | [ERROR] |  |  |  |  |  |  | 20599137 | AAM URI: Error in deleting the folder/Applications/Adobe Application Manager. Error = error Domain = NSCocoaErrorDomain Code = 4 "'Adobe Application Manager' could not be deleted." UserInfo = 0x40a1a0 {NSUnderlyingError = 0x40cf90 "the operation could not be completed. No such file or directory', NSFilePath = / / Applications/Adobe Application Manager, NSUserStringVariant =)

    06/02/16 17:54:57:215 | [ERROR] |  |  |  |  |  |  | 156753 | AAM URI: Error in deleting the folder/Applications/Adobe Application Manager. Error = error Domain = NSCocoaErrorDomain Code = 4 "'Adobe Application Manager' could not be deleted." UserInfo = {NSUnderlyingError = 0 121150 x {error Domain NSPOSIXErrorDomain Code = 2 = "No such file or directory"}, NSFilePath = / Applications/Adobe Application Manager, NSUserStringVariant = ()}

    06/02/16 17:57:08:177 | [ERROR] |  |  |  |  |  |  | 161805 | ACCC URI: Error in deleting the folder/Applications/Adobe Creative Cloud / Adobe Creative Cloud. Error = error Domain = NSCocoaErrorDomain Code = 4 "'Adobe Creative Cloud' could not be deleted." UserInfo = {NSUnderlyingError = 0x7d011290 {error Domain NSPOSIXErrorDomain Code = 2 = "No such file or directory"}, NSFilePath = / Applications/Adobe Creative Cloud/Adobe Creative Cloud, NSUserStringVariant = ()}

    06/02/16 17:57:43:068 | [WARNING] | 6FDEED33-4E08-4D76-989B-CEEA57C4534C |  |  |  |  |  | 162902 | A mistake came during the download with the error type --4 operation and error Code - 404

    06/02/16 18:04:19:111 | [ERROR] |  |  |  |  | DLMNative |  | 177183 | UpdaterCoreHelper::StartUpdateOpCallback: Another case: 0

    06/02/16 18:05:05:592 | [ERROR] |  |  |  |  | DLMNative |  | 177183 | UpdaterCoreHelper::StartUpdateOpCallback: Another case: 0

    06/02/16 18:05:11:745 | [ERROR] |  |  |  |  | DLMNative |  | 177183 | Progress UpdaterCore returned error Code: U44M1P218

    06/02/16 18:05:11:745 | [ERROR] |  |  |  |  | DLMNative |  | 177183 | Install updates returned the error

    06/02/16 18:05:11:745 | [ERROR] | 842CE02E-88E0-437F-BDD9-600A44E3F874 |  |  |  | DLMNative |  | 177183 | Install updates returned 44 installation, errorCode:218

    06/02/16 18:05:11:745 | [ERROR] | 842CE02E-88E0-437F-BDD9-600A44E3F874 |  |  |  | DLMNative |  | 177183 | Updates: under updated systems may not run

    06/02/16 18:25:36:290 | [WARNING] | FCDCC309-BA74-447F-BB8F-9F937003D595 |  |  |  |  |  | 228373 | A mistake came during the download with the error type --4 operation and error Code - 404

    06/02/16 18:32:27:367 | [WARNING] | 3F02C0A3-180E-48C3-8E34-323D40C88E38 |  |  |  |  |  | 243129 | A mistake came during the download with the error type --4 operation and error Code - 404

    06/02/16 19:54:03:943 | [ERROR] |  |  |  |  |  |  | 44833 | ACCC URI: Error in deleting the folder/Applications/Adobe Creative Cloud / Adobe Creative Cloud. Error = error Domain = NSCocoaErrorDomain Code = 4 "'Adobe Creative Cloud' could not be deleted." UserInfo = {NSUnderlyingError = 0x7b815330 {error Domain NSPOSIXErrorDomain Code = 2 = "No such file or directory"}, NSFilePath = / Applications/Adobe Creative Cloud/Adobe Creative Cloud, NSUserStringVariant = ()}

    06/02/16 19:55:01:255 | [WARNING] | 381C4013-B118-485D-92E6-40D31FCDE927 |  |  |  |  |  | 47978 | A mistake came during the download with the error type --4 operation and error Code - 404

    06/02/16 20:22:51:325 | [WARNING] | 39C0376C-178B-4354-8030-B29BB9660D2E |  |  |  |  |  | 16457 | A mistake came during the download with the error type --4 operation and error Code - 404

    06/02/16 17:57:42:749 | [ERROR] |  |  |  |  |  |  | 163639 | The error came and the error http - code 404

    06/02/16 17:57:42:749 | [ERROR] |  |  |  |  |  |  | 163639 | the download work (0) could not run. The State of the work is STOPPED_STATE

    06/02/16 17:57:42:749 | [ERROR] |  |  |  |  |  |  | 163639 | the download work (0) could not run. The status of the job is ERROR_STATE

    06/02/16 17:57:42:750 | [INFO] |  |  |  |  |  |  | 163639 | WorkerThread::ThreadProc current job is in an error that is not recoverable state

    06/02/16 18:25:36:068 | [ERROR] |  |  |  |  |  |  | 229107 | The error came and the error http - code 404

    06/02/16 18:25:36:068 | [ERROR] |  |  |  |  |  |  | 229107 | the download work (0) could not run. The State of the work is STOPPED_STATE

    06/02/16 18:25:36:068 | [ERROR] |  |  |  |  |  |  | 229107 | the download work (0) could not run. The status of the job is ERROR_STATE

    06/02/16 18:25:36:068 | [INFO] |  |  |  |  |  |  | 229107 | WorkerThread::ThreadProc current job is in an error that is not recoverable state

    06/02/16 18:32:27:089 | [ERROR] |  |  |  |  |  |  | 243784 | The error came and the error http - code 404

    06/02/16 18:32:27:089 | [ERROR] |  |  |  |  |  |  | 243784 | the download work (0) could not run. The State of the work is STOPPED_STATE

    06/02/16 18:32:27:089 | [ERROR] |  |  |  |  |  |  | 243784 | the download work (0) could not run. The status of the job is ERROR_STATE

    06/02/16 18:32:27:089 | [INFO] |  |  |  |  |  |  | 243784 | WorkerThread::ThreadProc current job is in an error that is not recoverable state

    06/02/16 19:55:01:071 | [ERROR] |  |  |  |  |  |  | 48297 | The error came and the error http - code 404

    06/02/16 19:55:01:071 | [ERROR] |  |  |  |  |  |  | 48297 | the download work (0) could not run. The State of the work is STOPPED_STATE

    06/02/16 19:55:01:071 | [ERROR] |  |  |  |  |  |  | 48297 | the download work (0) could not run. The status of the job is ERROR_STATE

    06/02/16 19:55:01:072 | [INFO] |  |  |  |  |  |  | 48297 | WorkerThread::ThreadProc current job is in an error that is not recoverable state

    06/02/16 20:22:51:031 | [ERROR] |  |  |  |  |  |  | 17879. The error came and the error http - code 404

    06/02/16 20:22:51:031 | [ERROR] |  |  |  |  |  |  | 17879. the download work (0) could not run. The State of the work is STOPPED_STATE

    06/02/16 20:22:51:031 | [ERROR] |  |  |  |  |  |  | 17879. the download work (0) could not run. The status of the job is ERROR_STATE

    06/02/16 20:22:51:031 | [INFO] |  |  |  |  |  |  | 17879. WorkerThread::ThreadProc current job is in an error that is not recoverable state

    Help, please!

    Mac or Windows and EXACTLY what version of the operating system?

    Recent Mac AND Windows operating systems have been known to cause problems "weird."

    Are you using a computer administrator account will be full read/write permissions?

    Please read https://forums.adobe.com/thread/1499014

    -try some steps such as changing browsers and disable your firewall

    -also clear the cache of your browser if you start with a fresh browser

    -check the file hosts for blocked entries https://forums.adobe.com/thread/1912777

    http://myleniumerrors.com/installation-and-licensing-problems/creative-cloud-error-codes-w ip.

    https://helpx.Adobe.com/creative-cloud/KB/creative-cloud-desktop-application-failed.html

    http://helpx.Adobe.com/creative-cloud/KB/failed-install-creative-cloud-desktop.html

    or

    A chat session where an agent can remotely look inside your computer can help

    Chat/phone: Mon - Fri 05:00-19:00 (US Pacific Time)<=== note="" days="" and="">

    Cloud creative support chat (all creative cloud customer service problems)

    http://helpx.Adobe.com/x-productkb/global/service-CCM.html

  • I have a problem with the free version according to the effect

    I can not download after version (free) effect what I can do

    Mac or Windows and EXACTLY what version of the operating system?

    Recent Mac AND Windows operating systems have been known to cause problems "weird."

    You MUST have a 64-bit computer and operating system... What is your computer?

    -Programs are supposed TO not view or download if they are not installed on your computer

    MINIMUM for After Effects and Premiere Pro http://helpx.adobe.com/premiere-pro/system-requirements.html

  • Problems opening and installation of CS5

    Can not get CS5 download to open and install

    Mac or Windows and EXACTLY what version of the operating system?

    Recent Mac AND Windows operating systems have been known to cause problems "weird."

    An idea that MAY work to install or run some programs in Windows old 10

    -http://www.tenforums.com/tutorials/15523-compatibility-mode-settings-apps-change-windows-1 0 - a.html

    Install CS5 on Mac 10.11 https://forums.adobe.com/thread/2003455 can help (also for others than CS5)

    -also a TEMPORARY security change https://forums.adobe.com/thread/2039319

    FAQ on the Mac 10-11 https://forums.adobe.com/thread/1979303

    He has problems with Mac 10.11 El Capitan... which is perhaps one of them

    -Java https://helpx.adobe.com/dreamweaver/kb/dreamweaver-java-se-6-runtime.html

    -See answer #5 in https://forums.adobe.com/thread/1965850 for several solution links

    Download & install instructions https://forums.adobe.com/thread/2003339 can help

    Also go to https://forums.adobe.com/community/creative_cloud/creative_cloud_faq

  • Problem of predicate push with views

    Hi guys,.

    I had a fairly long discussion to this thread - Re: One - a database - different execution plan for various users. -on a problem I encounter in 11g.  After a lot of work, we were able to reduce the problem to what seems to be a problem of predicate push when using views but not tables.

    To summarize the question, I have a user who has a bunch of tables and a layer of views that are based on tables (select * from table_name) that we use to manage access and create a layer of insulation of the tables.  All users (other than the owner) will have to choose against the views.  Unfortunately what we see is that when they use the perspective to make the choice, they get terrible performance where if they use the tables, they get the performance.  Here's a simple query which documents the problem.

    GOOD QUERY

    SQL > set timing on
    SQL > set linesize 160
    SQL > set serveroutput off
    SQL >
    SQL > select / * + gather_plan_statistics * /.
    2 w.worker_id, w.worker_name
    tas.worker_tbl 3 w,
    TAS.worker_cost_centre_tbl 4 c
    5 where w.worker_id = c.worker_id
    6 and c.effective_date < = trunc (sysdate)
    7 and c.expiration_date > = trunc (sysdate)
    8 and c.cost_centre = '100033'
    9 and tas_user.pkg_taw_security.user_worker_access ('CA17062',
    10                                             'TIMEKEEPER',
    11                                             w.worker_id,
    12 trunc (sysdate)) = 1
    13. in order to w.worker_name;

    WORKER_ID WORKER_NAME
    --------- ------------------------------------------------------------------------------------------
    123703 FADDEN, CLAYTON
    11131 HAHN, BRAD
    33811 HALL, MAUREEN
    53934 JANES, CATHERINE

    Elapsed time: 00:00:00.02
    SQL >
    SQL > select * from table (dbms_xplan.display_cursor (null, null, 'ALLSTATS LAST'));

    PLAN_TABLE_OUTPUT
    ----------------------------------------------------------------------------------------------------
    SQL_ID, 3np2s1wpqxnpu, number of children 1
    -------------------------------------
    Select / * + gather_plan_statistics * / w.worker_id, w.worker_name
    of tas.worker_tbl w.
    c tas.worker_cost_centre_tbl where w.worker_id = c.worker_id
    and c.effective_date < = trunc (sysdate) and c.expiration_date > =
    trunc (sysdate) and c.cost_centre = '100033' and
    tas_user.pkg_taw_security.user_worker_access ('CA17062',
    "TIMEKEEPER"
    w.worker_id,
    trunc (sysdate)) = 1 order by w.worker_name

    PLAN_TABLE_OUTPUT
    ----------------------------------------------------------------------------------------------------

    Hash value of plan: 3435904055

    ----------------------------------------------------------------------------------------------------
    | ID | Operation | Name                   | Begins | E - lines. A - lines.   A - time | Pads |  OMem |  1Mem |
    ----------------------------------------------------------------------------------------------------
    |   0 | SELECT STATEMENT |                        |      1.        |      4. 00:00:00.01 |     185.       |       |          |
    |   1.  SORT ORDER BY |                        |      1.      4.      4. 00:00:00.01 |     185.  2048 |  2048 | 2048
    |   2.   NESTED LOOPS |                        |      1.        |      4. 00:00:00.01 |     185.       |       |          |
    |   3.    NESTED LOOPS |                        |      1.      4.      4. 00:00:00.01 |     181.       |       |          |
    |*  4 |     TABLE ACCESS BY INDEX ROWID | WORKER_COST_CENTRE_TBL |      1.      4.      4. 00:00:00.01 |

    |*  5 |      INDEX RANGE SCAN | WORKER_CC_CC_IDX |      1.     29.     21. 00:00:00.01 |       3.
    |*  6 |     INDEX UNIQUE SCAN | WORKER_PK |      4.      1.      4. 00:00:00.01 |     163.       |       |
    |   7.    TABLE ACCESS BY INDEX ROWID | WORKER_TBL |      4.      1.      4. 00:00:00.01 |       4.       |       |
    ----------------------------------------------------------------------------------------------------

    Information of predicates (identified by the operation identity card):
    ---------------------------------------------------

    4 - filter("C".") (Correspondents' > = TRUNC(SYSDATE@!))
    5 - access("C".") COST_CENTRE "="100033"AND 'C'." (EFFECTIVE_DATE"< = TRUNC(SYSDATE@!))
    6 - access("W".") WORKER_ID "=" C ". ("' WORKER_ID")

    PLAN_TABLE_OUTPUT
    ----------------------------------------------------------------------------------------------------
    filter ("PKG_TAW_SECURITY". "USER_WORKER_ACCESS"('CA17062', 'CHRONOMÉTREUR","W".») WORKER_ID «, TRUNC (S)»

    Note
    -----
    -Comments of cardinality used for this statement


    39 selected lines.

    Elapsed time: 00:00:00.05

    So, that's the good thing - it did exactly what I expected it hits the Worker_CC_CC_IDX to get the workers who belong to a cost center and then hit the worker_PK to get their names.  In the end, it applies the filter that validates that the user running the application has access to the worker in question through safety.

    BAD REQUEST

    SQL > set linesize 160
    SQL > set serveroutput off
    SQL >
    SQL > select / * + gather_plan_statistics * /.
    2 w.worker_id, w.worker_name
    tas.worker_v 3 w,
    TAS.worker_cost_centre_v 4 c
    5 where w.worker_id = c.worker_id
    6 and c.effective_date < = trunc (sysdate)
    7 and c.expiration_date > = trunc (sysdate)
    8 and c.cost_centre = '100033'
    9 and tas_user.pkg_taw_security.user_worker_access ('CA17062',
    10                                             'TIMEKEEPER',
    11                                             w.worker_id,
    12 trunc (sysdate)) = 1
    13. in order to w.worker_name;

    WORKER_ID WORKER_NAME
    --------- ------------------------------------------------------------------------------------------
    123703 FADDEN, CLAYTON
    11131 HAHN, BRAD
    33811 HALL, MAUREEN
    53934 JANES, CATHERINE

    Elapsed time: 00:00:18.05
    SQL >
    SQL > select * from table (dbms_xplan.display_cursor (null, null, 'ALLSTATS LAST'));

    PLAN_TABLE_OUTPUT
    ----------------------------------------------------------------------------------------------------
    SQL_ID, gs5vtgany8vbv, number of children 1
    -------------------------------------
    Select / * + gather_plan_statistics * / w.worker_id, w.worker_name
    of tas.worker_v w, tas.worker_cost_centre_v
    c where w.worker_id = c.worker_id and c.effective_date < =.
    trunc (sysdate) and c.expiration_date > = trunc (sysdate) and
    c.cost_centre = '100033' and tas_user.pkg_taw_security.user_worker_ac
    Cess ('CA17062',
    "TIMER", w.worker_id,
    trunc (sysdate)) = 1 order by
    w.worker_name

    PLAN_TABLE_OUTPUT
    ----------------------------------------------------------------------------------------------------

    Hash value of plan: 1726112176

    ----------------------------------------------------------------------------------------------------
    | ID | Operation | Name                   | Begins | E - lines. A - lines.   A - time | Pads |  OMem |  1Mem |
    ----------------------------------------------------------------------------------------------------
    |   0 | SELECT STATEMENT |                        |      1.        |      4. 00:00:18.26 |     947K |       |       |          |
    |   1.  SORT ORDER BY |                        |      1.      4.      4. 00:00:18.26 |     947K |  2048 |  2048 | 2048
    |*  2 |   HASH JOIN |                        |      1.      4.      4. 00:00:14.28 |     947K |  1348K |  1348K |  546K (0)
    |   3.    VIEW                        | WORKER_COST_CENTRE_V |      1.      4.      4. 00:00:00.01 |      18.       |       |
    |*  4 |     TABLE ACCESS BY INDEX ROWID | WORKER_COST_CENTRE_TBL |      1.      4.      4. 00:00:00.01 |

    |*  5 |      INDEX RANGE SCAN | WORKER_CC_CC_IDX |      1.     29.     21. 00:00:00.01 |       3.
    |*  6 |    VIEW                        | WORKER_V |      1.    161K |      4. 00:00:14.28 |     946K |       |       |          |
    |   7.     TABLE ACCESS FULL | WORKER_TBL |      1.    161K |    160K | 00:00:00.09 |    2135
    ----------------------------------------------------------------------------------------------------

    Information of predicates (identified by the operation identity card):
    ---------------------------------------------------

    2 - access("W".") WORKER_ID "=" C ". ("' WORKER_ID")
    4 - filter("X".") (Correspondents' > = TRUNC(SYSDATE@!))
    5 - access("X".") COST_CENTRE "="100033"AND 'X'." (EFFECTIVE_DATE"< = TRUNC(SYSDATE@!))

    PLAN_TABLE_OUTPUT
    ----------------------------------------------------------------------------------------------------
    6 - filter("PKG_TAW_SECURITY".") USER_WORKER_ACCESS "('CA17062', 'CHRONOMÉTREUR)", "W". "WORKER_ID", TRUNC (S).

    Note
    -----
    -Comments of cardinality used for this statement


    39 selected lines.

    Elapsed time: 00:00:00.05

    So the bad query takes 18 seconds to bring the same answer - but the only change is to the user views instead of tables _TBL _V.  In this case she made a hash out of a table scan join full of the worker_tbl to an analysis of the index of the worker_cost_centre_tbl of course it takes forever in comparison.  The real question is WHY?

    I know that you are going to ask a couple of things - see definitions and synonyms... so here.

    Display definitions

    SQL > select view_name, dba_views text where view_name in ('WORKER_COST_CENTRE_V', 'WORKER_V');

    VIEW_NAME TEXT
    ------------------------------ ---------------------------------------------------------------------
    WORKER_COST_CENTRE_V select x.worker_id,.
    x.effective_date,
    x.expiration_date,
    x.cost_centre
    of worker_cost_centre_tbl x

    WORKER_V select x.worker_id,.
    x.user_id,
    x.last_name,
    x.first_name,
    x.worker_name,
    x.Initials,
    x.Gender,
    x.BIRTH_DATE,
    x.hire_date,
    x.service_date,
    x.badge_created_date,
    x.address_one,
    x.address_two,
    x.city_name,
    x.state_province,
    x.zip_code,
    x.telephone_number,
    x.Email_Address,
    x.ftchip_per_diem_flag,
    x.aip_flag,
    x.hot_change_flag,
    x.pop_flag
    of worker_tbl x

    Thesaurus - public

    SQL > select * from dba_synonyms where synonym_name in ('WORKER_COST_CENTRE_V', 'WORKER_V');

    OWNER SYNONYM_NAME TABLE_OWNER, TABLE_NAME
    ------------------------------ ------------------------------ ------------------------------ -------
    DB_LINK
    ----------------------------------------------------------------------------------------------------
    PUBLIC WORKER_COST_CENTRE_V BUNCH WORKER_COST_CENTRE_V


    PUBLIC WORKER_V BUNCH WORKER_V


    Thesaurus - private

    SQL > select * from user_synonyms where synonym_name in ('WORKER_COST_CENTRE_V', 'WORKER_V');

    no selected line

    So as you can see, the views do nothing in this case - and should not change the query at all in my opinion.

    Deleting the call of all the query - same using views - led to the execution plan.  That's why I think that it is some kind of problem weird predicate push.  I can and that you have captured the query (and the 25 or so similar) to make it work less 11g using the view by using the NO_PUSH_PRED flag and by the query without the security call in a query internal.  Tuning queries is not the problem - the problem is "why should I?  Oracle should use the tables or views in the same way here shouldn't it?  To further complicate things, if I run this same query 'wrong' with points of view as the owner of the tables - it works perfectly.  If I grant it the DBA role to a user, and run the query so bad that this user - it works perfectly.

    Anyone got any ideas what the hell is happening here?

    Thank you
    Cory Aston

    To a large extent, view sure merge is activated to reduce the risk of certain transformations optimizer allows you to reverse scurity functions. It is possible that Oracle didn't closely resembles the view definition or function however to decide if the service could pose a threat if view merger took place.  Christian Antognini has an example on his blog if you want an idea of why the functions of views could be a problem: http://www.antognini.ch/2011/09/optimizer_secure_view_merging-and-vpd/

    A test, you can try:

    ALTER system set optimizer_secure_view_merging = false;

    Concerning

    Jonathan Lewis

    UPDATE: just to change true to FALSE

Maybe you are looking for

  • Question about partitions on Portege M700

    Hello I was wondering why my M700 Vista Ultimate came with 3 partitions.EISA, the part. C: System, a primary partition without name of 5 GB. The EISA should be the recovery partition, but what is the last for? I can delete to create a different parti

  • update security for Windows XP

    I use to install update security for Windows xp KB9811349, but their still another day KB956802, KB979683 KB970238, KB978338, what should I do for this new upcoming update KB numbers are lower than the 1st one i rescently installed

  • Podcast goes into the music folder

    I use Windows Media Player to synchronize with my Fuze +.  When I send an mp3 podcast it lands in the music folder.  How he do for the Podcast folder?  Media Player shows that music, videos and photos under the heading Sansa.  I have to create a Podc

  • BlackBerry smartphone how to install desktop redirector

    OK, I'm lost here, I tried it on several PC, same results - I'm never asked to install the Desktop Redirector for Outlook. I followed these instructions- http://www.BlackBerry.com/BTSC/microsites/search.do?cmd=displayKC&docType=kc&externalId=KB16236&

  • HTML as placeholders

    Even if the extracts are good reusable components, there are requirements when a full subject are necessary as a reusable component. Can we use HTML in the placeholder? If so, what is the syntax of it? Ask you to help me with this.