Comment rajouter MAX à un kit de distribution ?

Nous utilisons LABVIEW 7.1 / MAX 3.1 et avons développé une application incluant des cartes DAQ avec driver DAQmx 7.2.
Avec Application Builder, nous ne voyons pas comment inclure dans l'exécutable à réaliser, Measurement Automation & Explorer avec notre application?
Nous avons un besoin d'accès à la configuration des cartes depuis notre application développée.

Bonjour Christ,
Une réponse détaillée se trouve dans le lien ci-dessous :
http://exchange.ni.com/servlet/ProcessRequest?RHIVEID=101&RPAGEID=137&HOID=50650000000500000032A60100&HIsQuestionPoster=No&HTHREAD=000108082&UCATEGORY_0=_49_%24_6_&UCATEGORY_S=0
Sanaa TAZI
National Instruments

Similar Messages

  • Problème avec ActiveX container dans un kit de distribution

    Un autre souci avec les kits de distrubtion...
    Puisque vous m'y encouragez, je vais vous soumettre un autre souci!
    Dans mon kit de distribution, j'ai besoin du composant ActiveX
    container. Ce composant me pose souci si je n'inclue pas tous les autres
    composants du RTE CVI. En ne prenant que les composants dont j'ai
    besoin (Standard run time, Analysis support et ActiveX), ca me donne un
    kit qui fait environ 15/20Mo, alors qu'avec le rte complet, environ
    200Mo.
    Mon kit étant diffusé sur un réseau, vous comprenez que 200M, c'est trop pour moi.
    Comment puis je faire pour ne plus avoir besoin d'intégrer le run time complet?
    Le message qui m'est retourné est le suivant:
    ActiveX container support module: cannot find 2 dependancies with the following module IDs:
    Microsoft_VC90_CRT_x86.AA2EBBCC_3442_865E_7BB3E9F45F0C
    Microsoft_VC90_MFC_x86.1B1242B0_08E9_3D59_826D_ADAA4BB763B5
    Je précise qu'avant l'installation de CVI 2010, tout fonctionnait correctement...
    Merci d'avance!
    Résolu !
    Accéder à la solution.

    Bonjour,
    Pourriez-vous préciser ce qui se passe si vous sélectionnez uniquement le "Standard Run-Time" et "ActiveX Container Support"?
    C'est surprenant que vous deviez ajouter les autres composants (.NET, Real-Time, Instrument driver...).
    Si le problème persiste, pourriez-vous poster un exemple de projet CVI, le plus minimaliste possible, permettant d'illustrer ce problème?
    Cordialement,
    Thomas B. | CLAD
    National Instruments France
    #adMrkt{text-align: center;font-size:11px; font-weight: bold;} #adMrkt a {text-decoration: none;} #adMrkt a:hover{font-size: 9px;} #adMrkt a span{display: none;} #adMrkt a:hover span{display: block;}
    >> Inscrivez-vous gratuitement aux Journées Techniques : de l'acquisition de données au contrôle/com...
    Pièces jointes :
    driver and CVI component.png ‏54 KB

  • Probleme de geenrtion de kit de distribution sous windows 7

    Bonjour,
    En passant a windows 7, je n arrive plus a generer un kit de distribution avec LAbWindows /CVI 2000.
    J excecute CVI en mode admoniatrateur.
    Pourtant j ai toujours le probleme suivant:
    Active X control not registered on this computer
    Quelle operation faire pour resoudre ce pb?
    MErci

    Bonjour,
    avez-vous déjà essayé ceci ?
    Error Code 145 - ActiveX Control Not Registered in LabWindows/CVI
    http://digital.ni.com/public.nsf/allkb/9894BE2B832B7FDE86256ECD00041172?OpenDocument
    Aurelie

  • Inclusion d'un fichier .inf dans un kit de distribution CVI

    Bonjour,
    J'ai un problème avec les kits de distributions générés pas CVI. Avec la version 2010, je ne peux pas y inclure de fichier .inf. Dès qu'un fichier .inf est inclus dans le kit de distribution, j'ai un message d'erreur à l'installation me mentionnant un échec de l'installation.
    Quelqu'un aurait-il eu un problème similaire et pourrait-il me dépanner?
    Merci.
    Résolu !
    Accéder à la solution.

    Nous allons essayer une manipulation.
    Vous aller construire
    un DEBUG du Kit de distribution CVI -
    Vous pouvez rencontrer des problèmes lors de l'exécution du programme d'installation de distribution Kit de manière directe. Une trousse complète contient un exécutable nommé SETUP.EXE. Cet
    exécutable est en fait la combinaison d'une norme, SETUP.EXE par
    défaut, et un fichier de script spécifique à votre application.
     Pour déboguer cette installation, vous devez isoler ce fichier de script à partir de l'exécutable Setup.exe. Les
    étapes suivantes décrivent la procédure à suivre et supposons que vous
    avez déjà créé la Kit de distribution vous le placerez dans un
    répertoire sur votre machine (dénommé le répertoire du kit).
       1. Spécifiez
    un lecteur de disquette en tant que chemin cible - Sélectionnez
    Créer Kit de distribution à partir du menu Build comme vous le faisiez
    pour créer le kit. Dans la boîte de texte Chemin cible, indiquez votre lecteur de disquette (A. Toutes les autres options doivent rester tels qu'elles étaient lorsque vous avez construit le kit de départ. Ne pas aller plus loin.
       2. Obtenez
    temporairement un fichier script - CVI utilise le répertoire référencé
    par la variable d'environnement TEMP (habituellement C: \ Temp) pour
    stocker le fichier de script temporaires qu'il crée. Vous devez obtenir ce fichier.
             a. Depuis la boîte de dialogue "Créer Kit de distribution", sélectionnez Générer. Plusieurs boîtes de dialogue sont lancées et CVI compresse les fichiers appropriés et génère le script.
             b. Un message de LabWindows / CVI apparaît alors, vous demandant d'insérer une disquette. Avant
    de faire quelque chose avec cette boîte de dialogue, consultez le
    répertoire TEMP pour un fichier qui a un nom similaire au nom de votre
    projet avec une extension. INF. C'est le fichier de script temporaire dont vous avez besoin pour déboguer l'application SETUP.EXE.
             c. Copiez ce fichier dans un autre répertoire, puis cliquez sur Annuler dans la boîte de dialogue. Un autre message de dialogue s'affiche, sélectionnez OK.
       3. Remplacez
    le fichier SETUP.EXE - Maintenant que vous avez obtenu le fichier de
    script temporaires, supprimer le SETUP.EXE vous avez créé précédemment à
    partir de votre répertoire kit (avec le Setup.exe et les fichiers de
    données XXX.). Copiez le SETUP.EXE à partir du répertoire CVI \ bin dans le répertoire kit, ainsi que le fichier temporaire de script INF.
       4. Ajouter un point d'arrêt de débogage - Ouvrez le fichier INF script avec un éditeur de texte.. Il est dans un format standard script, composé d'une procédure principal et d'autres sous-procédures. La ligne suivante: SetTraceMode servira de point d'arrêt dans le script. Insérez cette ligne là où vous voulez rompre l'exécution du script. Vous
    pouvez faire défiler la ligne de script en ligne une fois que
    l'exécution a été suspendue, et vous pouvez placer le
    plus grand nombre de points d'arrêt  que vous le souhaitez.
       5. Debug de
    l'installation du kit de distribution - Exécutez le fichier setup.exe que
    vous avez copié à partir de votre CVI \ bin dans votre répertoire kit. C'est l'application de configuration normale, et il passera par le script. INF à laquelle vous avez ajouté des points d'arrêt. Lorsque
    le script atteint le point d'arrêt, vous verrez une boîte de dialogue
    de débogage qui vous permet de parcourir votre exécution. Notez
    que le numéro de ligne indiqué dans une boîte de dialogue d'erreur
    d'installation correspond directement à une ligne dans le fichier de
    script. INF, ce qui n'est pas le cas normalement. Avec l'utilisation
    de la fonctionnalité de débogage, vous pouvez déterminer le
    fonctionnement exact qui échoue lors de l'installation et de subordonner
    leur autorisation nécessaire ou d'autres ajustements.
    Brice S.
    National Instruments France

  • Distribution kit LVT 8.0

    Hi,
    i would like to create a distribution kit ( executable and run times ) which i could deploy on a pxi target without using Labview an especially  the project manager. To be more accurate, my aim is, fistly, to generate this kit of distribution with my develloper host pc, and secondly,  to deploy it on a rt  target by using a virgin PC (with only run time)
    Help me
    The game

    Hi,
    On your RT target I assume that you installed the LabView RT module.
    So automatically you have on the disk of your taget this directory C>NI>StartUp.
    You can create your exe on your developpement machine, copy it and past it in the StartUp folder. But you will have to create the ini file to specyfy if your vi is lauch at start up or not.
    But I do not understand why you do not fellow the standard procedure to deploy a VI on your target.
    When you use this procedure the ini file, the alliases file are automatically create on your target.
    Johan G.
    NIF
    .NIDays2008 {font-family:Arial, Helvetica, sans-serif; font-size:12px; color: #065fa3; font-weight: bold; text-decoration: none; text-align: right;} .NIDays2008 a, a:hover {text-decoration: none;} .NIDays2008 a img {height: 0; width: 0; border-width: 0;} .NIDays2008 a:hover img {position: absolute; height: 90px; width: 728px; margin-left: -728px; margin-top:-12px;}
    >> Avez-vous entendu parler de NI Days ?

  • MAX error 7411 when downgrading cFP 2120

    Hello,
    I am running LV 8.2 for an old Industrial project that I am doing some changes to. The project is running on a cFP 2120. That cFP is running 24*7 in production.
    The actual cFP 2120 I am trying to test my software on, currently has LV RT 2009 installed.
    But I now need to downgrade it to LV RT 8.2.
    I first tried using the MAX version (4.0.x) installed in LV 8.2, but when trying to do"Add/Remove" software, I get Error7411 as shown in link below:
    http://objective.no/gostemp/max_error_7411.jpg
    I then tried to install MAX from my LV2009 distribution in the LV 8.2 environment. Installed fine, but when trying to run it, it complained that it was not properly installed.
    I restored my PC, and tried to install MAX 4.4.1 from a LV 8.5.1 distribution. This version of MAX works fine, but I get the same Error 7411 when I try to click the "Add/remove"  software button.
    So, the question is:
    a) How do I clean the rt software (RT 2009) from the cFP2120 so that I can do a clean install of LV RT 8.2 onto it?
    Please help, as all my searching has not given me any clue on how to do this !
    Geir Ove

    Hello Muks
    Yes, I have seen that. Upgraded to Max that came with LV 2009, that rendered MAX useless: It complained about a "faulty installation".
    Restored XP computer, and tried with MAX that came with LV 8.5.1. That version of MAX worked, but I get the same problem.
    Funny that National haven't thougt of this. There should be a way of "cleaning" software off a cFP so that one could start with blank sheets and install any LVRT version onto it !
    Any help from National Instrument staff?
    Geir Ove

  • Can I add a customer comment form to a standard product manual?

    We just recevied Acrobat X (and Frame 9 before that) and would like to use forms or form fields to get comments back on the docs (pdfs and HTML) from paying customers. So far, I have created a small form in a huge document (only 4-6 pages but with videos, fonts, etc.) and it's too big to email. Can I put it on a repository and get comments back? Is the adobe distribution server the only way to do this? Am I way off base with this concept? Thanks for any suggestions or clarification.

    Dear Ricardo,
    Step1) First create the java script file in that you have to write the following code.
    <script type = "text/javascript">
    function close_windows()
    window.close();
    function DisableBackButton()
    history.forward();
    </script>
    <html>
    <head><title> close </title>
    </head>
    <form>
    <script language="javascript">DisableBackButton();
    </script>
    <body>
    <input type = "button" value = "close" onClick="close_windows();"/>
    </body>
    </form>
    </html>
    step 2) go to se80 in that mime repository go to sap create folder and export the above file.
    step 3) go to your view where you want to add exit button.
               check the link and write the code to your exit button methods.
               http://scn.sap.com/thread/1911320
    Note : It will work only in Internet explorer
    Hope this helps u.,
    Regards,
    Jayesh

  • .\Distribution.cpp(363): InstallerError 10002 Schwerer Fehler. Objekt nicht gefunden

    Fehler beim Istallieren vom Distribution Kit
    .\Distribution.cpp(363): InstallerError 10002
    Schwerer Fehler. Objekt nicht gefunden.
    class CPart object lookup by ProductCode failed to find object {7ABA9E0D-B98F-4B66-896F-BB992B8821C9}
    und wieso kann ich die cvirte.dll nicht einfach nur in system32 kopieren.
    Ich würde gerne die Treiber (inclusiv cwirte.dll) in ein Distribution Kit stecken. Um nicht jedesmal die treiber CD zu Installieren.
    Habe CVI2013.
    Danke!

    Dieser Fehler wird angezeigt wenn die LabWindows/CVI Run-Time Engine fehlt oder die falsche Version installiert is. Es kann sein das die LabWindows/CVI Run-Time Engine
    nicht in deinem distribution kit mit eingebunden ist oder eine ältere Version der Run-Time Engine existiert die nicht meit deiner *.exe übereinsteimmt. Um den Fehler zu beheben kannst du dir die neueste Version der Run-Time Engine hier http://search.ni.com/nisearch/app/main/p/bot/no/ap/tech/lang/de/pg/1/sn/catnav:du,n8:1627,ssnav:sup/ herunterladen. Oder du fügst die Run-Time Engine in deinem LabWindows/CVI Distribution Kit ein.
    Um die Run-Time Engine miteinzubeziehen gehst du wie folgt vor.
    LabWindows/CVI 8.0 and later
    Select Build»Distributions»Manage Distributions
    In the Manage Distributions dialog box, select your distribution and then click Edit.
    In the Edit Installer dialog, choose the Drivers & Components tab.
    Check the LabWindows/CVI Run-Time Engine option.
     LabWindows/CVI 6.0, 7.0 or 7.1
    Select Build»Create Distribution Kit.
    In the Create Distribution Kit dialog box, choose "Full Run-Time Engine" for the Run-Time Engine Support option.
    Das sollte das Problem beheben.
    MFG Jerry

  • Invoice reveral distribution GL date issue

    Proble Description
    Reproduce steps:
    1.Customer created invoice with GL date 2012-Oct-30 and validate the invoice.
    2.And applied prepayment at 2012-Nov-02 and the GL date of prepayment application is 2012-Nov-02
    3.Unapply the prepayment with GL date of prepayment unapplication=2012-Nov-02.
    4.Cancel the invoice and the callelation GL date is 2012-Nov-02 not 2012-Oct-30(step 1)
    Customer's instance is on 11i.AP.M , APXINWKB.fmb-115.1066, apicancl.pls-115.115
    And according to 11i: Cancelling an Invoice with GL Dates on Header and Distributions Different Errors with APP-SQLAP-10706 (Doc ID 414576.1), on the
    forms/US/APXINWKB.fmb 115.1058 and the above version, it is the standard functionality that reversing distribution gl date of invoice will use the max gl_date of original distributions.
    Is there any workaround or methods to get the reversal invoice gl date=invoice gl date?
    p.s- I have tested in internal instance which has APXINWKB.fmb-115.819, apicancl.pls-115.90, and found that reversal invoice gl date=invoice gl date even the prepayment application/unapply in another preriod.
    Thanks
    Klina

    Dear Klina,
    User may cancel the invoice from payment form.
    When you cancel a payment, system will ask for dates and also there is an option to cancel the invoice.
    If the user chooses to cancel the invoice from payment, system creates reversed invoice distributions to payment cancellation date.
    Please check related payment dates for this invoice.
    It is only a guess, but this can be your scenario.
    Thanks and Regards

  • Comment publier des photos à partir adobe element vers google photo

    Bonjour,
    Comment rajouter un plugin pour pouvoir publier des photos directement vers google photo depuis adobe élément?
    merci
    Benoit
    windows 7, adobe photoshop element 11.

    Bonjour,
    Visiblement, Photoshop Elements Organizer permet d'exporter vers smugmug, flckr, Adobe Revel, Facebook, mais pas vers les offres Google.
    Donc, il faudrait exporter vos fichiers, et les envoyer vous-même vers picasa ou Google+, google drive... http://helpx.adobe.com/fr/elements-organizer/topics/sharing.html
    Via la procédure de Google: https://support.google.com/picasa/answer/189356?hl=fr  

  • IPad camera conenction kit (USB to Ethernet Dongle)

    Would be awesome if it is possible and I can download movies with Broadband speeds
    Any ideas or comments?

    The Camera kit doesn't support that feature.

  • Varchar(max) vs varchar(255)

    Hi guys,
    I'm new to MS-SQL 2005, I will ask you a bunch of questions and I hope I will not be too boring hehe !
    I learned that in MS-SQL 2005, you can now use varchar(max), my question is why not always use varchar(max) since it will automatically use only the space needed ? Is there an advantage in specifying a size other than max when you use a varchar for an entry that can vary in length alot ?
    Thank you very much,
    Konnan

    There are a few diferences between VARCHAR(1-8000) and VARCHAR(MAX).
    when you store data to a VARCHAR(N) column, the values are physically stored in the same way. But when you store it to a VARCHAR(MAX) column, behind the screen the data is handled as a TEXT value. So there is some additional processing needed when dealing with a VARCHAR(MAX) value. (only if the size exceeds 8000)
    VARCHAR(MAX) or NVARCHAR(MAX) is considered as a 'large value type'. Large value types are usually stored 'out of  row'. It means that the data row will have a pointer to another location where the 'large value' is stored. By default sql server will try to accomodate the value 'in row' but if it could not, it will store the large values 'out of row'. When values are stored 'out of row' there will be slight processing overhead in reading the information. Here is a good reference: http://msdn2.microsoft.com/en-us/library/ms189087.aspx
    I guess you cannot index a VARCHAR(MAX)/NVARCHAR(MAX) column.
    coming back to your question:
    I dont think it is bad to use VARCHAR(MAX) is bad. If you are storing smaller piecs of data in a VARCHAR(MAX) column, it will be treated as normal. If you dont want to index the column, then you can definitely go with VARCHAR(MAX) option.
    But most people do not advise that. First of all, by having a VARCHAR(MAX) will confuse some one who looks at the data later on. For example, if you want to store a comment of 100 characters or address of 80 characters, why should you go for VARCHAR(MAX)? If you use Address VARCHAR(MAX), comments VARCHAR(MAX), Name VARCHAR(MAX), some one trying to read or write data on a later date will be confused. They will not know what is the expected size of the data and they will be compelled to use LARGE VALUE types always.
    Again, these are not rules but conventions.

  • OCI-22303: type ""."DISCREPTABTYP"

    OCI-22303: type ""."DISCREPTABTYP" not found:BEGIN
    timeKeeper_package.discrepancy2(:unit, :startdate, :enddate, :unknown_tb, :belongWork_tb, :floatIn_tb, :floatOut_tb);
    END;
    I am getting the above error when I am running at OCI program through a web application. This did work on another server 2 years ago. Project got put on hold and now that DB on that server can be restarted, I need to install in on a new server and db. I created this type for a user and granted permissions to public. I think it is either some sort of permission problem or patch problem. When I orginally worked on project it was in oracle 9i and one of last things I did was upgrade db to 11g. I don't know if I had to make some sort of change when I did that upgrade. But I need to get it working again on a 9i database (9.2.0.3.0)
    Below I have include 3 parts that I think make up the the problem
    1) The oci code that is giving error message
    2) The sql that creates the type
    3) The package that the OCI program is trying to run ( i had to remove comments for max length in oracle forums)
    So I am looking for help on what I might be missing or re createing this application. I kind of think I may have had to do something different with creating the type. For all of the .sql I just ran them as same user that owns all of my other tables.
    1) Below is line from OCI program that is failing
    if (ociCheckError("timeDiscrepancy.c(8008)", OCITypeByName(hba.envhp, hba.errhp, hba.svchp,
    (text *) 0, (ub4) 0, (text *) "DISCREPTABTYP", (ub4) strlen((const char *) "DISCREPTABTYP"),
    (CONST text *) 0, (ub4) 0, OCI_DURATION_SESSION, OCI_TYPEGET_HEADER,
    &discreptab_tdo), TRUE, &hba) == -1) {
    callMessage(&hba);
    deconstructHba(&hba);
    return (0);
    2) Below is sql that crated type
    drop type discrepTabTyp;
    Create or Replace Type discrepancyType as object(
    empcd varchar2(12),
    skilltpe varchar2(9),
    hprdcode varchar2(6),
    wprdcode varchar2(6),
    strtdate date,
    enddate date,
    empupdate date,
    empfnme varchar2(12),
    empmint varchar2(2),
    emplnme varchar2(20),
    prodcode varchar2(6),
    startscan date,
    endscan date,
    origstart date,
    reason varchar2(23),
    timeupdate date)
    GRANT EXECUTE ON DISCREPANCYTYPE TO public;
    CREATE PUBLIC SYNONYM DISCREPANCYTYPE FOR DISCREPANCYTYPE;
    Create or Replace type discrepTabTyp is table of discrepancyType
    GRANT EXECUTE ON DISCREPTABTYP TO public;
    CREATE PUBLIC SYNONYM DISCREPTABTYP FOR DISCREPTABTYP;
    3) Below is the package that the OCI program is trying to run
    create or replace package timeKeeper_package as
    Type empschdRec IS RECORD (
    hprdcode empschd.hprdcode%type,
    empcd empschd.empcode%type,
    skilltpe empschd.skilltpe%type,
    wprdcode empschd.wprdcode%type,
    strtdate date,
    enddate date,
    lastupdate date,
    match pls_integer);
    Type timeRec IS RECORD (
    prodcode time_keeper.prodcode%type,
    empcd time_keeper.empcode%type,
    origstart date,
    startscan date,
    endscan date,
    lastupdate date,
    match pls_integer);
    Type discrepancyRec IS RECORD (
    empcd empschd.empcode%type DEFAULT '',
    skilltpe empschd.skilltpe%type DEFAULT'',
    hprdcode empschd.hprdcode%type DEFAULT '',
    wprdcode empschd.wprdcode%type DEFAULT '',
    strtdate date DEFAULT NULL,
    enddate date DEFAULT NULL,
    empupdate date DEFAULT NULL,
    empfnme empcode.empfnme%type DEFAULT ' ',
    empmint empcode.empmint%type DEFAULT ' ',
    emplnme empcode.emplnme%type DEFAULT ' ',
    prodcode time_keeper.prodcode%type DEFAULT '',
    startscan date DEFAULT NULL,
    endscan date DEFAULT NULL,
    origstart date DEFAULT NULL,
    timeupdate date DEFAULT NULL,
    reason varchar2(23) DEFAULT '');
    type empArray is table of empschdRec index by pls_integer;
    type timeArray is table of timeRec index by pls_integer;
    type discrepancyArray is table of discrepancyRec index by pls_integer;
    procedure discrepancy (unit in prodcode.prodcode%type, start_date date, end_date date,
    unknown_tb in out discrepancyArray, belongWork_tb in out discrepancyArray,
    floatIn_tb in out discrepancyArray, floatOut_tb in out discrepancyArray);
    procedure discrepancy2 (unit in prodcode.prodcode%type,
    start_date date, end_date date,
    unknown_tab out discrepTabTyp, belongWork_tab out discrepTabTyp,
    floatIn_tab out discrepTabTyp, floatOut_tab out discrepTabTyp);
    procedure match (unit in prodcode.prodcode%type, start_date date, end_date date,
    empschd_tb out empArray, time_keeper_tb out timeArray);
    end timeKeeper_package;
    create or replace package body timeKeeper_package as
    Type empcodeRec IS RECORD (
    prodcode empcode.prodcode%type,
    empcd empcode.empcode%type,
    bskiltpe empcode.bskiltpe%type,
    empfnme empcode.empfnme%type,
    empmint empcode.empmint%type,
    emplnme empcode.emplnme%type,
    swipe empcode.swipe%type,
    home_swipe empcode.home_swipe%type);
    type empcodeArray is table of empcodeRec index by pls_integer;
    function empcode_find (empcd empcode.empcode%type, emcdTable empcodeArray,
    maxIndex int) return int;
    procedure add_discrepancy (unit in prodcode.prodcode%type,
    unknown_tb in out discrepancyArray,
    belongWork_tb in out discrepancyArray,floatIn_tb in out discrepancyArray,
    floatOut_tb in out discrepancyArray,
    empcode_tb empcodeArray, empcdIndex pls_integer,
    empschd_tb empArray,schdIndex pls_integer,
    time_keeper_tb timeArray, timeIndex pls_integer, reason varchar2);
    procedure match (unit in prodcode.prodcode%type, start_date date, end_date date,
    empschd_tb out empArray, time_keeper_tb out timeArray) as
    CURSOR schd_cursor is
    select empschd.hprdcode,empschd.empcode,empschd.skilltpe,empschd.wprdcode,
    empschd.strtdate,empschd.enddate, empschd.lastupdate, 0
    from empschd,empcode
    where (empschd.hprdcode = unit or empschd.wprdcode = unit) and
    (empschd.strtdate between start_date and end_date or
    empschd.enddate between start_date and end_date)
    and empschd.openclsd = 'OPEN' and empcode.empcode = empschd.empcode and
    empcode.swipe = 'Y' and empcode.termcode is null
    order by empschd.empcode,empschd.strtdate,empschd.enddate;
    CURSOR time_cursor is
    select time_keeper.prodcode, time_keeper.empcode, time_keeper.origstart,
    time_keeper.startscan, time_keeper.endscan, time_keeper.lastupdate, 0
    from time_keeper, prodcode
    where (time_keeper.empcode in (select empcode from empcode where prodcode = unit)
    or time_keeper.prodcode = unit) and
    (time_keeper.startscan between (start_date - (prodcode.scan_reset/24))
    and (end_date + (prodcode.scan_reset/24)) or
    time_keeper.endscan between (start_date - (prodcode.scan_reset/24))
    and (end_date + (prodcode.scan_reset/24))) and
    time_keeper.active = 'Y' and prodcode.prodcode = unit
    order by time_keeper.empcode, time_keeper.startscan, time_keeper.endscan;
    timeIndex integer; -- current index in time_keeper_tb
    diffCurrent float; -- difference between current empschd and time keeper start dates
    diffNext float; -- difference between current empschd and next time keeper start dates
    diffEmp2 float; -- difference between next empschd 7 current time keeper start dates
    BEGIN
    open schd_cursor;
    fetch schd_cursor bulk collect into empschd_tb;
    close schd_cursor;
    open time_cursor;
    fetch time_cursor bulk collect into time_keeper_tb;
    close time_cursor;
    if (empschd_tb.FIRST is not NULL and time_keeper_tb.FIRST is not NULL) then
    timeIndex := 1;
    for i in empschd_tb.FIRST .. empschd_tb.LAST
    loop
    while (timeIndex <= time_keeper_tb.LAST and (time_keeper_tb(timeIndex).match != 0 or
    time_keeper_tb(timeIndex).empcd != empschd_tb(i).empcd))
    loop
    timeIndex := timeIndex + 1;
    end loop;
    if (timeIndex > time_keeper_tb.LAST) then
    timeIndex := 1;
    else
    diffCurrent := abs (empschd_tb(i).strtdate - time_keeper_tb(timeIndex).startscan);
    while (timeIndex < time_keeper_tb.LAST and
    time_keeper_tb(timeIndex).empcd = empschd_tb(i).empcd)
    loop
    if (timeIndex+1 <= time_keeper_tb.LAST and
    empschd_tb(i).empcd = time_keeper_tb(timeIndex+1).empcd) then
    diffNext := abs (empschd_tb(i).strtdate - time_keeper_tb(timeIndex+1).startscan);
    else
    diffNext := diffCurrent;
    end if;
    exit when diffCurrent <= diffNext;
    timeIndex := timeIndex + 1;
    diffCurrent := diffNext;
    end loop; -- end while finding closesest empschd
    if (i+1 <= empschd_tb.LAST and
    empschd_tb(i+1).empcd = time_keeper_tb(timeIndex).empcd) then
    diffEmp2 := abs (empschd_tb(i+1).strtdate - time_keeper_tb(timeIndex).startscan);
    else
    diffEmp2 := diffCurrent;
    end if;
    -- decide which time keeper record to match to current empschd record
    if (diffCurrent <= diffEmp2) then
    empschd_tb(i).match := timeIndex;
    time_keeper_tb(timeIndex).match := i;
    timeIndex := timeIndex+1;
    else
    -- if previous time_keeper record is unmatched,
    -- then match it to current empschd else it remains unmatched
    if (timeIndex > 1 and time_keeper_tb(timeIndex-1).match = 0 and
    empschd_tb(i).empcd = time_keeper_tb(timeIndex-1).empcd) then
    empschd_tb(i).match := timeIndex-1;
    time_keeper_tb(timeIndex-1).match := i;
    end if;
    end if; -- end else next empschd was closer
    end if;
    end loop; -- end for each empschd
    end if;
    -- utl_file.fclose (fip);
    END match;
    procedure discrepancy (unit in prodcode.prodcode%type,
    start_date date, end_date date,
    unknown_tb in out discrepancyArray, belongWork_tb in out discrepancyArray,
    floatIn_tb in out discrepancyArray, floatOut_tb in out discrepancyArray) as
    -- read in all non terminated employee records
    CURSOR emp_cursor is
    select prodcode, empcode, bskiltpe, empfnme, nvl(empmint,' '), emplnme,
    swipe, home_swipe
    from empcode
    where termcode is null
    order by empcode;
    empcode_tb empcodeArray; -- holds non terminated employee array
    employee_index pls_integer; -- current employee in empcode_tb
    timeKeeper_indx pls_integer; -- current time keeper record
    empschd_tb empArray; -- holds employee schedule data
    time_keeper_tb timeArray; -- holds time keeper data
    unitgrace number (38,34); -- unit's grace time
    found boolean; -- indicates if discrepancy found
    reason varchar2(23); -- the reason of discrepancy
    fip utl_file.file_type;
    begin
    -- this places record in all_directories table which seems to be used by fopen
    fip := utl_file.fopen ('TIME_KEEP_DIR','discrepancy.pr','w',500);
    -- read and convert grace time for unit from minutes to fraction
    -- of 1 day for date comparisons
    select (grace_time / 60)/24
    into unitgrace
    from prodcode where prodcode = unit;
    -- get the employee records to validate employee codes scanned
    open emp_cursor;
    fetch emp_cursor bulk collect into empcode_tb;
    close emp_cursor;
    utl_file.put_line(fip, 'match start '|| to_char (start_date, 'MM/DD/YYYY HH:MI:SS AM') ||
    ' End: ' || to_char (end_date, 'MM/DD/YYYY HH:MI:SS AM'), TRUE);
    -- given a unit, start time and end time, read in and match employee schedule
    -- and time keeper records to each other.
    timeKeeper_package.match (unit, start_date, end_date, empschd_tb, time_keeper_tb);
    -- print out employee schedule records
    utl_file.new_line(fip,1);
    utl_file.put_line (fip, 'EMPLOYEE SCHEDULE RECORDS');
    utl_file.new_line(fip,1);
    if (empschd_tb.FIRST is not NULL) then
    for j in empschd_tb.FIRST ..empschd_tb.LAST
    loop
    utl_file.put_line(fip, 'index: '||j||' match: '||empschd_tb(j).match||' empcode: '||
    empschd_tb(j).empcd ||' '|| ' skill: '|| empschd_tb(j).skilltpe ||
    ' Home: ' || empschd_tb(j).hprdcode || ' Work: ' || empschd_tb(j).wprdcode ||
    ' Start: '|| to_char (empschd_tb(j).strtdate, 'MM/DD/YYYY HH:MI:SS AM') ||
    ' End: ' || to_char (empschd_tb(j).enddate, 'MM/DD/YYYY HH:MI:SS AM'), TRUE);
    end loop;
    end if;
    -- print the time keeper scan data
    utl_file.new_line(fip,1);
    utl_file.put_line (fip, 'TIME KEEPER RECORDS');
    utl_file.new_line(fip,1);
    if (time_keeper_tb.FIRST is not NULL) then
    for i in time_keeper_tb.FIRST ..time_keeper_tb.LAST
    loop
    utl_file.put_line(fip,'Index: '||i||' match: '|| time_keeper_tb(i).match||
    ' empcode: ' || time_keeper_tb(i).empcd ||
    ' Start: '|| to_char (time_keeper_tb(i).startscan, 'MM/DD/YYYY HH:MI:SS AM') ||
    ' End: ' || to_char (time_keeper_tb(i).endscan, 'MM/DD/YYYY HH:MI:SS AM'),TRUE);
    end loop;
    end if;
    -- perform discrepancy logic between empschd and time keeper records
    timeKeeper_indx := 1;
    -- go through all empschd records
    if (empschd_tb.FIRST is not NULL) then
    for i in empschd_tb.FIRST ..empschd_tb.LAST loop
    -- find the next time keeper record that has same empcode as current empschd
    while (time_keeper_tb(timeKeeper_indx).empcd <= empschd_tb(i).empcd) loop
    if (time_keeper_tb(timeKeeper_indx).match = 0) then
    -- check if time keeper record is with in start and end date range if not
    -- skip record else have a descrepancy which need to figured out. It can
    -- only be 1 of 2 possiblities since there is no matching empshcd record.
    if NOT((time_keeper_tb(timeKeeper_indx).startscan < start_date and
    time_keeper_tb(timeKeeper_indx).endscan < start_date) or
    (time_keeper_tb(timeKeeper_indx).startscan > end_date and
    time_keeper_tb(timeKeeper_indx).endscan > end_date)) then
    employee_index := empcode_find (time_keeper_tb(timeKeeper_indx).empcd,
    empcode_tb, empcode_tb.LAST);
    found := false;
    -- figure out reason of descrepancy
    if (employee_index < 0) then
    found := true;
    reason := 'Unknown Employee-Swipe';
    else
    found := true;
    reason := 'Not Scheduled, Swipe-in';
    end if;
    if (found = true) then
    add_discrepancy (unit,unknown_tb, belongWork_tb, floatIn_tb, floatOut_tb,
    empcode_tb, employee_index,
    empschd_tb, -1, time_keeper_tb, timeKeeper_indx, reason);
    end if;
    end if;
    end if; -- end if time keeper match = 0
    timeKeeper_indx := timeKeeper_indx + 1;
    end loop; -- end while time keeper empcode <= empschd empcode
    employee_index := empcode_find (empschd_tb(i).empcd, empcode_tb, empcode_tb.LAST);
    found := false;
    -- if current empschd has no match then check for descrepancy
    if (empschd_tb(i).match = 0) then
    if (employee_index < 0) then
    found := true;
    reason := 'Unknown Employee-Sched';
    elsif ((empschd_tb(i).strtdate + unitgrace) < sysdate) then
    found := true;
    reason := 'Scheduled, no swipe-in';
    end if;
    if (found = true) then
    add_discrepancy (unit,unknown_tb, belongWork_tb, floatIn_tb, floatOut_tb,
    empcode_tb, employee_index,
    empschd_tb, i, time_keeper_tb, -1, reason);
    end if;
    else
    -- empschd has a match, check for descrepancies
    case
    when time_keeper_tb(empschd_tb(i).match).prodcode != empschd_tb(i).wprdcode and
    empcode_tb(employee_index).home_swipe = 'N' then
    found := true;
    reason := 'Swiped into wrong unit';
    when time_keeper_tb(empschd_tb(i).match).endscan is NULL and
    (empschd_tb(i).enddate + unitgrace) < sysdate then
    found := true;
    reason := 'Swipe-in, no Swipe-out';
    when (time_keeper_tb(empschd_tb(i).match).startscan + unitgrace) <
    empschd_tb(i).strtdate then
    found := true;
    reason := 'Swipe-in early';
    when (time_keeper_tb(empschd_tb(i).match).startscan - unitgrace) >
    empschd_tb(i).strtdate then
    found := true;
    reason := 'Swipe-in late';
    when (time_keeper_tb(empschd_tb(i).match).endscan + unitgrace) <
    empschd_tb(i).enddate then
    found := true;
    reason := 'Swipe-out early';
    when (time_keeper_tb(empschd_tb(i).match).endscan - unitgrace) >
    empschd_tb(i).enddate then
    found := true;
    reason := 'Swipe-out late';
    else
    found := false;
    end case;
    if (found = true) then
    add_discrepancy (unit,unknown_tb, belongWork_tb, floatIn_tb, floatOut_tb,
    empcode_tb, employee_index,
    empschd_tb, i, time_keeper_tb, empschd_tb(i).match, reason);
    end if;
    end if;
    end loop; -- end for each empschd
    -- process all unproccesed time_keeper records with match value of 0
    while (timeKeeper_indx <= time_keeper_tb.LAST) loop
    if (time_keeper_tb(timeKeeper_indx).match = 0) then
    -- check if time keeper record is with in start and end date range if not
    -- skip record else have a descrepancy which need to figured out. It can
    -- only be 1 of 2 possiblities since there is no matching empshcd record.
    if NOT((time_keeper_tb(timeKeeper_indx).startscan < start_date and
    time_keeper_tb(timeKeeper_indx).endscan < start_date) or
    (time_keeper_tb(timeKeeper_indx).startscan > end_date and
    time_keeper_tb(timeKeeper_indx).endscan > end_date)) then
    employee_index := empcode_find (time_keeper_tb(timeKeeper_indx).empcd,
    empcode_tb, empcode_tb.LAST);
    found := false;
    -- figure out reason of descrepancy
    if (employee_index < 0) then
    found := true;
    reason := 'Unknown Employee-Swipe';
    else
    found := true;
    reason := 'Not Scheduled, Swipe-in';
    end if;
    if (found = true) then
    add_discrepancy (unit,unknown_tb, belongWork_tb, floatIn_tb, floatOut_tb,
    empcode_tb, employee_index,
    empschd_tb, -1, time_keeper_tb, timeKeeper_indx, reason);
    end if;
    end if;
    end if; -- end if time keeper match = 0
    timeKeeper_indx := timeKeeper_indx + 1;
    end loop; -- end while time keeper records unproccesed
    else
    utl_file.put_line (fip, 'In check time_keeper because empschd is NULL');
    if (time_keeper_tb.FIRST is not NULL) then
    utl_file.put_line (fip, 'In time keeper not null');
    for i in time_keeper_tb.FIRST ..time_keeper_tb.LAST
    loop
    if NOT((time_keeper_tb(i).startscan < start_date and
    time_keeper_tb(i).endscan < start_date) or
    (time_keeper_tb(i).startscan > end_date and
    time_keeper_tb(i).endscan > end_date)) then
    employee_index := empcode_find (time_keeper_tb(i).empcd,
    empcode_tb, empcode_tb.LAST);
    found := false;
    -- figure out reason of descrepancy
    if (employee_index < 0) then
    found := true;
    reason := 'Unknown Employee-Swipe';
    else
    found := true;
    reason := 'Not Scheduled, Swipe-in';
    end if;
    utl_file.put_line (fip, 'before if found true');
    if (found = true) then
    add_discrepancy (unit,unknown_tb, belongWork_tb, floatIn_tb, floatOut_tb,
    empcode_tb, employee_index,
    empschd_tb, -1, time_keeper_tb, timeKeeper_indx, reason);
    utl_file.put_line (fip, 'after add discrepancy');
    end if;
    end if;
    end loop;
    end if;
    end if;
    -- print out discrepancy data
    utl_file.put_line (fip, 'Unknown Employees');
    if (unknown_tb.FIRST is not NULL) then
    for j in unknown_tb.FIRST ..unknown_tb.LAST
    loop
    utl_file.put_line(fip, 'index: '||j|| ' empcode: '||unknown_tb(j).empcd ||
    ' skill: '||unknown_tb(j).skilltpe ||
    ' Home: '|| unknown_tb(j).hprdcode || ' Work: '||
    unknown_tb(j).wprdcode||' Start: '||
    to_char (unknown_tb(j).strtdate, 'MM/DD/YYYY HH:MI:SS AM') ||
    ' End: ' || to_char (unknown_tb(j).enddate, 'MM/DD/YYYY HH:MI:SS AM') ||
    ' Name: '|| unknown_tb(j).empfnme ||
    ' '||unknown_tb(j).empmint||' '|| unknown_tb(j).emplnme, TRUE);
    utl_file.put_line(fip,'time prod: '||unknown_tb(j).prodcode||' scan start '||
    to_char (unknown_tb(j).startscan, 'MM/DD/YYYY HH:MI:SS AM')||' scan end '||
    to_char (unknown_tb(j).endscan, 'MM/DD/YYYY HH:MI:SS AM')||' Original start '||
    to_char (unknown_tb(j).origstart, 'MM/DD/YYYY HH:MI:SS AM'), TRUE);
    utl_file.put_line(fip, 'Reason: '|| unknown_tb(j).reason,TRUE);
    utl_file.new_line(fip,1);
    end loop;
    end if;
    utl_file.put_line (fip, 'Employees Belong and Work in Unit');
    if (belongWork_tb.FIRST is not NULL) then
    for j in belongWork_tb.FIRST ..belongWork_tb.LAST
    loop
    utl_file.put_line(fip, 'index: '||j|| ' empcode: '||belongWork_tb(j).empcd ||
    ' skill: '||belongWork_tb(j).skilltpe ||
    ' Home: '|| belongWork_tb(j).hprdcode ||
    ' Work: '|| belongWork_tb(j).wprdcode||' Start: '||
    to_char (belongWork_tb(j).strtdate, 'MM/DD/YYYY HH:MI:SS AM') ||
    ' End: ' || to_char (belongWork_tb(j).enddate, 'MM/DD/YYYY HH:MI:SS AM') || ' Name: '||
    belongWork_tb(j).empfnme ||
    ' '||belongWork_tb(j).empmint||' '|| belongWork_tb(j).emplnme, TRUE);
    utl_file.put_line(fip,'time prod: '||belongWork_tb(j).prodcode||' scan start '||
    to_char (belongWork_tb(j).startscan, 'MM/DD/YYYY HH:MI:SS AM')||' scan end '||
    to_char (belongWork_tb(j).endscan, 'MM/DD/YYYY HH:MI:SS AM')||' Original start '||
    to_char (belongWork_tb(j).origstart, 'MM/DD/YYYY HH:MI:SS AM'), TRUE);
    utl_file.put_line(fip, 'Reason: '|| belongWork_tb(j).reason,TRUE);
    utl_file.new_line(fip,1);
    end loop;
    end if;
    utl_file.put_line (fip, 'Employees Floated into Unit');
    if (floatIn_tb.FIRST is not NULL) then
    for j in floatIn_tb.FIRST ..floatIn_tb.LAST
    loop
    utl_file.put_line(fip, 'index: '||j|| ' empcode: '||floatIn_tb(j).empcd ||
    ' skill: '|| floatIn_tb(j).skilltpe ||
    ' Home: '|| floatIn_tb(j).hprdcode ||
    ' Work: '|| floatIn_tb(j).wprdcode||' Start: '||
    to_char (floatIn_tb(j).strtdate, 'MM/DD/YYYY HH:MI:SS AM') ||
    ' End: ' || to_char (floatIn_tb(j).enddate, 'MM/DD/YYYY HH:MI:SS AM') || ' Name: '||
    floatIn_tb(j).empfnme ||
    ' '||floatIn_tb(j).empmint||' '|| floatIn_tb(j).emplnme, TRUE);
    utl_file.put_line(fip,'time prod: '||floatIn_tb(j).prodcode||' scan start '||
    to_char (floatIn_tb(j).startscan, 'MM/DD/YYYY HH:MI:SS AM')||' scan end '||
    to_char (floatIn_tb(j).endscan, 'MM/DD/YYYY HH:MI:SS AM')||' Original start '||
    to_char (floatIn_tb(j).origstart, 'MM/DD/YYYY HH:MI:SS AM'), TRUE);
    utl_file.put_line(fip, 'Reason: '|| floatIn_tb(j).reason,TRUE);
    utl_file.new_line(fip,1);
    end loop;
    end if;
    utl_file.put_line (fip, 'Employees Floated out of unit');
    if (floatOut_tb.FIRST is not NULL) then
    for j in floatOut_tb.FIRST ..floatOut_tb.LAST
    loop
    utl_file.put_line(fip, 'index: '||j|| ' empcode: '||floatOut_tb(j).empcd ||
    ' skill: '||floatOut_tb(j).skilltpe ||
    ' Home: '|| floatOut_tb(j).hprdcode ||
    ' Work: '|| floatOut_tb(j).wprdcode||' Start: '||
    to_char (floatOut_tb(j).strtdate, 'MM/DD/YYYY HH:MI:SS AM') ||
    ' End: ' || to_char (floatOut_tb(j).enddate, 'MM/DD/YYYY HH:MI:SS AM') || ' Name: '||
    floatOut_tb(j).empfnme ||
    ' '||floatOut_tb(j).empmint||' '|| floatOut_tb(j).emplnme, TRUE);
    utl_file.put_line(fip,'time prod: '||floatOut_tb(j).prodcode||' scan start '||
    to_char (floatOut_tb(j).startscan, 'MM/DD/YYYY HH:MI:SS AM')||' scan end '||
    to_char (floatOut_tb(j).endscan, 'MM/DD/YYYY HH:MI:SS AM')||' Original start '||
    to_char (floatOut_tb(j).origstart, 'MM/DD/YYYY HH:MI:SS AM'), TRUE);
    utl_file.put_line(fip, 'Reason: '|| floatOut_tb(j).reason,TRUE);
    utl_file.new_line(fip,1);
    end loop;
    end if;
    utl_file.fclose (fip);
    end discrepancy;
    procedure add_discrepancy (unit in prodcode.prodcode%type,
    unknown_tb in out discrepancyArray,
    belongWork_tb in out discrepancyArray,floatIn_tb in out discrepancyArray,
    floatOut_tb in out discrepancyArray,
    empcode_tb empcodeArray, empcdIndex pls_integer,
    empschd_tb empArray,schdIndex pls_integer,
    time_keeper_tb timeArray, timeIndex pls_integer, reason varchar2) as
    array_tb discrepancyArray; -- current array to add discrepancy to
    indx pls_integer; -- index of new record in current array
    selector pls_integer; -- flag indicates which array record will
    -- be added to. These are HBA Hard coded values
    -- 1 - The unknown array
    -- 2 - The belong and work in unit array
    -- 3 - The floated into this unit array
    -- 4 - The floated out of this unit array
    begin
    -- check if you have a valid employee, if not data goes into unknown_tb array
    if (empcdIndex <= 0) then
    array_tb := unknown_tb;
    selector := 1;
    -- if have no empschd record but do have time keeper, determine
    -- which array data goes into
    elsif (schdIndex <= 0 and timeIndex > 0) then
    if (unit = time_keeper_tb(timeIndex).prodcode and
    empcode_tb(empcdIndex).prodcode = unit) then
    array_tb := belongWork_tb;
    selector := 2;
    elsif (unit = time_keeper_tb(timeIndex).prodcode and
    empcode_tb(empcdIndex).prodcode != unit) then
    array_tb := floatIn_tb;
    selector := 3;
    else
    array_tb := floatOut_tb;
    selector := 4;
    end if;
    -- if have employee schedule record, determine which array data
    -- goes into. You should never be able to get past this point
    elsif (schdIndex > 0) then
    if (unit = empschd_tb(schdIndex).wprdcode and
    empschd_tb(schdIndex).hprdcode = unit) then
    array_tb := belongWork_tb;
    selector := 2;
    elsif (unit = empschd_tb(schdIndex).wprdcode and
    empschd_tb(schdIndex).hprdcode != unit) then
    array_tb := floatIn_tb;
    selector := 3;
    else
    array_tb := floatOut_tb;
    selector := 4;
    end if;
    end if;
    -- create and add new record to the correct array
    if (schdIndex > 0 or timeIndex > 0) then
    -- determine index for the new record being created.
    if (array_tb.LAST is NULL) then
    indx := 1;
    else
    indx := array_tb.LAST + 1;
    end if;
    if (schdIndex > 0) then
    array_tb(indx).empcd := empschd_tb(schdIndex).empcd;
    array_tb(indx).skilltpe := empschd_tb(schdIndex).skilltpe;
    array_tb(indx).hprdcode := empschd_tb(schdIndex).hprdcode;
    array_tb(indx).wprdcode := empschd_tb(schdIndex).wprdcode;
    array_tb(indx).strtdate := empschd_tb(schdIndex).strtdate;
    array_tb(indx).enddate := empschd_tb(schdIndex).enddate;
    array_tb(indx).empupdate := empschd_tb(schdIndex).lastupdate;
    else
    array_tb(indx).empcd := time_keeper_tb(timeIndex).empcd;
    if (empcdIndex > 0) then
    array_tb(indx).skilltpe := empcode_tb(empcdIndex).bskiltpe;
    array_tb(indx).hprdcode := empcode_tb(empcdIndex).prodcode;
    end if;
    end if;
    if (empcdIndex > 0) then
    array_tb(indx).empfnme := empcode_tb(empcdIndex).empfnme;
    array_tb(indx).empmint := empcode_tb(empcdIndex).empmint;
    array_tb(indx).emplnme := empcode_tb(empcdIndex).emplnme;
    end if;
    if (timeIndex > 0) then
    array_tb(indx).prodcode := time_keeper_tb(timeIndex).prodcode;
    array_tb(indx).startscan := time_keeper_tb(timeIndex).startscan;
    array_tb(indx).endscan := time_keeper_tb(timeIndex).endscan;
    array_tb(indx).origstart := time_keeper_tb(timeIndex).origstart;
    array_tb(indx).timeupdate := time_keeper_tb(timeIndex).lastupdate;
    end if;
    array_tb(indx).Reason := reason;
    -- after new record created then reassign array to correct output variable
    if (selector = 1) then
    unknown_tb := array_tb;
    elsif (selector = 2) then
    belongWork_tb := array_tb;
    elsif (selector = 3) then
    floatIn_tb := array_tb;
    elsif (selector = 4) then
    floatOut_tb := array_tb;
    end if;
    end if;
    end;
    function empcode_find (empcd empcode.empcode%type, emcdTable empcodeArray,
    maxIndex int) return int as
    low int; -- Array index of low side of current search
    high int; -- Array index of high side of current search
    mid int; -- Array index of current record being checked
    begin
    low := 1; -- Initialize to first index in array
    high := maxIndex; -- Initialize to last index in array
    while ( low <= high) loop
    mid := (low + high) / 2;
    if (empcd < emcdTable(mid).empcd) then
    high := mid - 1;
    elsif (empcd > emcdTable(mid).empcd) then
    low := mid + 1;
    else
    return mid;
    end if;
    end loop;
    return -1;
    end empcode_find;
    procedure discrepancy2 (unit in prodcode.prodcode%type,
    start_date date, end_date date,
    unknown_tab out discrepTabTyp, belongWork_tab out discrepTabTyp,
    floatIn_tab out discrepTabTyp, floatOut_tab out discrepTabTyp) as
    unknown_tb discrepancyArray;
    belongWork_tb discrepancyArray;
    floatIn_tb discrepancyArray;
    floatOut_tb discrepancyArray;
    begin
    timeKeeper_package.discrepancy (unit, start_date, end_date, unknown_tb,
    belongWork_tb, floatIn_tb, floatOut_tb);
    if (unknown_tb.FIRST is not NULL) then
    unknown_tab := discrepTabTyp();
    for j in unknown_tb.FIRST ..unknown_tb.LAST
    loop
    unknown_tab.extend;
    unknown_tab(j) := discrepancyType (unknown_tb(j).empcd, unknown_tb(j).skilltpe,
    unknown_tb(j).hprdcode, unknown_tb(j).wprdcode,
    unknown_tb(j).strtdate, unknown_tb(j).enddate,
    unknown_tb(j).empupdate,unknown_tb(j).empfnme,
    unknown_tb(j).empmint, unknown_tb(j).emplnme, unknown_tb(j).prodcode,
    unknown_tb(j).startscan, unknown_tb(j).endscan, unknown_tb(j).origstart,
    unknown_tb(j).reason, unknown_tb(j).timeupdate);
    end loop;
    end if;
    if (belongWork_tb.FIRST is not NULL) then
    belongWork_tab := discrepTabTyp();
    for j in belongWork_tb.FIRST ..belongWork_tb.LAST
    loop
    belongWork_tab.extend;
    belongWork_tab(j) := discrepancyType (belongWork_tb(j).empcd,belongWork_tb(j).skilltpe,
    belongWork_tb(j).hprdcode, belongWork_tb(j).wprdcode,
    belongWork_tb(j).strtdate, belongWork_tb(j).enddate,
    belongWork_tb(j).empupdate, belongWork_tb(j).empfnme,
    belongWork_tb(j).empmint, belongWork_tb(j).emplnme, belongWork_tb(j).prodcode,
    belongWork_tb(j).startscan, belongWork_tb(j).endscan, belongWork_tb(j).origstart,
    belongWork_tb(j).reason, belongWork_tb(j).timeupdate);
    end loop;
    end if;
    if (floatIn_tb.FIRST is not NULL) then
    floatIn_tab := discrepTabTyp();
    for j in floatIn_tb.FIRST ..floatIn_tb.LAST
    loop
    floatIn_tab.extend;
    floatIn_tab(j) := discrepancyType (floatIn_tb(j).empcd,
    floatIn_tb(j).skilltpe, floatIn_tb(j).hprdcode,
    floatIn_tb(j).wprdcode, floatIn_tb(j).strtdate, floatIn_tb(j).enddate,
    floatIn_tb(j).empupdate, floatIn_tb(j).empfnme,
    floatIn_tb(j).empmint, floatIn_tb(j).emplnme, floatIn_tb(j).prodcode,
    floatIn_tb(j).startscan, floatIn_tb(j).endscan, floatIn_tb(j).origstart,
    floatIn_tb(j).reason, floatIn_tb(j).timeupdate);
    end loop;
    end if;
    -- Copy float out table data to output array
    if (floatOut_tb.FIRST is not NULL) then
    floatOut_tab := discrepTabTyp();
    for j in floatOut_tb.FIRST ..floatOut_tb.LAST
    loop
    floatOut_tab.extend;
    floatOut_tab(j) := discrepancyType (floatOut_tb(j).empcd, floatOut_tb(j).skilltpe,
    floatOut_tb(j).hprdcode, floatOut_tb(j).wprdcode,
    floatOut_tb(j).strtdate, floatOut_tb(j).enddate,
    floatOut_tb(j).empupdate, floatOut_tb(j).empfnme,
    floatOut_tb(j).empmint, floatOut_tb(j).emplnme, floatOut_tb(j).prodcode,
    floatOut_tb(j).startscan, floatOut_tb(j).endscan, floatOut_tb(j).origstart,
    floatOut_tb(j).reason, floatOut_tb(j).timeupdate);
    end loop;
    end if;
    end;
    end timeKeeper_package;
    GRANT EXECUTE ON TIMEKEEPER_PACKAGE TO public;
    CREATE PUBLIC SYNONYM TIMEKEEPER_PACKAGE FOR TIMEKEEPER_PACKAGE;

    I figured out that when I upgraded from 9.2.03 to 9.2.0.8 that the problem went away. I think when I had it working earlier I may have been on 9.2.0.5

  • Insert New Record in Master Data by Code

    Hi guys,
    I need to insert a new value in an infoobject by code creating:
    1 new record in table P (data not time dependent)
    1 new record in table S (SID table)
    This code could be executed by many tasks in parallel and so it could create problems of concurrency in writing and in quality of the value of new SID selected.
    The first question is:
    THERE IS A STANDARD CODE THAT INSERT A NEW RECORD ALSO CREATING SIDS, managing concurrency in writing and reading?
    The second (if not answer to first)
    This is a part of my code (draft)... any suggestions:
    insert into TABLE P
    INSERT INTO /bic/pzck9idfl VALUES st_p_zck9idfl.
    IF sy-subrc = 0.
    FLAG = 1.
    WHILE FLAG = 0.
        SELECT MAX( sid )
        INTO v_sididfl
        FROM /bic/szck9idfl.
        ADD 1 TO v_sid.
    *record for SID table
        st_zck9idfl-sid = v_sid.
        st_zck9idfl-/bic/zck9idfl = v_idfl.
        st_zck9idfl-chckfl = 'X'.
        st_zck9idfl-datafl = 'X'.
        st_zck9idfl-incfl  = 'X'.
    insert record in SID Table
        INSERT INTO /bic/szck9idfl VALUES st_zck9idfl.
        COMMIT WORK AND WAIT.
    IF Sy-subrc = 0.
    SELECT SINGLE FROM /bic/szck9idfl
    WHERE SID = v_SID
    AND /bic/zck9idfl NE v_idfl.
    IF Sy-SUBRC = 0.
    FLAG = 1.
    ELSE.
    FLAG = 0.
    ENDIF.
    ELSE FLAG = 1.
    ENDIF.
    ENDWHILE.
    Thanks and points to helpful answer!
    ciao
    C@f

    Hi Claudio,
    I would not recommend to do this. Please have a look for standard fm to that job of have a look into the class library to find some methods. On the first look at your code here my comments:
    SELECT MAX( sid )
    INTO v_sididfl
    FROM /bic/szck9idfl.
    ADD 1 TO v_sid.
    Not a pretty good idea, as there is a number range object for getting a sid for each infoobject. If you get your sid like this, all later standard postings will fail with 'duplicate records'.
    *record for SID table
    st_zck9idfl-sid = v_sid.
    st_zck9idfl-/bic/zck9idfl = v_idfl.
    st_zck9idfl-chckfl = 'X'.
    st_zck9idfl-datafl = 'X'.
    st_zck9idfl-incfl = 'X'.
    if you mark all these flags with 'X' you will tell the system that this record is used somewhere in masterdata or in a datatarget and you cannot delete it with standard methods.
    regards
    Siggi

  • Best way to update a PRA file with changes to P6 schedule?

    Hello,
    I've spent some time looking at user manuals and video tutorials to try and become familiar with how to use Primavera Risk Analysis. I come from an @RISK user background so there were some concepts that were a little different between the two applications.
    One thing of particular interest to my company is how to use PRA with a constantly evolving and updating P6 project schedule? I know there are ways to import/export user defined fields to store the min/most likely/max values for each task. I also know that the risk register can be imported/exported from Excel. My concern can perhaps be demonstrated by this example (based on my current understanding of PRA and P6)
    1. Start PRA and import a copy of a P6 schedule. This is not a "live" link but rather a copy made for use with PRA.
    2. Set-up the risk register, link to project tasks. Set-up activity min/most likely/max, assign to a distribution (triangle)
    3. Run Monte Carlo simulations, review results etc.
    4. At this point I could export the min/most likely/max durations back to P6 as user defined fields and I could update the duration in P6 with the most likely. I'm not sure what would happen with risk activities that created new project activities but I assume they would import as new tasks to P6?
    After going through steps 1-4, the P6 schedule might continue to evolve further with new tasks, new dependencies, new durations, etc. At some point, I may be asked again to perform another risk analysis on the project and here is where my question comes in: Do I have to start all over and import everything into a new PRA? I know that I could get the min/max most likely from P6 user defined fields, I know I could import the risk register from Excel but are there other things that I would lose by having to start over (for example, links between risks in the risk register and the tasks in the P6 schedule?) Or... is there a way to re-use an existing PRA file and update the P6 schedule while preserving the info (like risk register, etc.)?
    Thank you for your reply

    >
    This method works but is there an easier (faster) way to update another table with new data only?
    >
    Almost anything would be better than that slow-by-slow loop processing.
    You don't need a procedure you should just use MERGE for that. See the examples in the MERGE section of the SQL Language doc
    http://docs.oracle.com/cd/B28359_01/server.111/b28286/statements_9016.htm
    MERGE INTO bonuses D
       USING (SELECT employee_id, salary, department_id FROM employees
       WHERE department_id = 80) S
       ON (D.employee_id = S.employee_id)
       WHEN MATCHED THEN UPDATE SET D.bonus = D.bonus + S.salary*.01
         DELETE WHERE (S.salary > 8000)
       WHEN NOT MATCHED THEN INSERT (D.employee_id, D.bonus)
         VALUES (S.employee_id, S.salary*.01)
         WHERE (S.salary <= 8000);

Maybe you are looking for

  • BI-MM : extractor   2LIS_03_BF  activation with error

    Hi guru, I am working with BI 7.0  and Business Content 7.03 I have activated the cube 0IC_C03  and the associated datasources.   But the transformation for datasource   2LIS_03_BF (stocl mvt)  shows : start routine sytaxe error Error Details : In PE

  • How can I display results data including history

    Hello. I am writing a report in Oracle Reports Builder to produce a student's statement of results and have two parameters for course instance and academic year. If user enters course instance and academic year the report has to display all results o

  • How difficult to create a user login area, and where to start?

    I have a website which I created in Microsoft Expression Web 4. I would like to add a user login area and tie it to an existing SQL database which is updated frequently. I am not sure where to start or how likely I am to succeed. It is for a client's

  • Status Bar Incorrect

    In mail, the status bar does not show the last time/date of update. Instead it shows the previous update time.

  • Marker interfaces

    what is the use of marker interfaces when do not specify any methods?