Help with simple PL/SQL package

Hi, I'm creating a package simple PL/SQL to loop over a list of names and do some special fuzzy criteria in an attempt to clean up the data. Unfortunately... I don't know anything about PL/SQL and hitting problems is to work. Could anyone give a hand?

p. s.
table TMP_UTL_MATCH_INPUT has a list of names to corresponding in the column called CLEAN_MERCHANT
TMP_UTL_MATCH_OUTPUT table should contain the original entry of line # and value, a corresponding output line # and value and calculated edit_distance jaro_winkler similaritise
table TMP_UTL_MATCH_STATUS is simply updated after each value so I can track where in the process it is obtained (I suspect that this algorithm will take a lot of time...)

Thanks in advance for any help!
Scott

create or replace
PROCEDURE ' PROCESS_UTL_MATCH_DATA "("START_ROW"EN ENTIER PAR DÉFAUT 1) IS" ".
-initialize variable here

whole Num_Rows;
number of edit_distance_similarity;
number of jaro_distance_similarity;

-main body
BEGIN
Select count (*) in tmp_utl_match_input num_rows;

declare name_array as varray (num_rows) of varchar2 (40);

Select clean_merchant in the TMP_UTL_MATCH_INPUT name_array;

truncate table tmp_utl_match_status;
insert into tmp_utl_match_status values (0);

I'm in 1.num_rows - 1 LOOP
FOR i j + 1.num_rows LOOP
edit_distance_similarity = utl_match.edit_distance_similarity (name_array (i), (j) name_array);
jaro_winkler_similarity = utl_match.jaro_winkler_similarity (name_array (i), (j) name_array;)

If (edit_distance_similarity > 50 or jaro_winkler_similarity > 50)
then
insert into values of tmp_utl_match_output (i, name_array (i), j, (j) name_array, edit_distance_similarity, jaro_winkler_similarity);
END IF;
END LOOP;

Update tmp_utl_match_status set current_row_num = i;
commit;
END LOOP;



EXCEPTION
WHILE OTHERS THEN
NULL; -Enter any code exception here
END;

I'm sorry. Just discovered that my syntax is incorrect. Cannot bulk collect a select statement. You must use a cursor, so here is the revised code

create or replace
PROCEDURE "PROCESS_UTL_MATCH_DATA"("START_ROW" IN INTEGER DEFAULT 1) IS
--initialize variables here

  num_rows integer;
  edit_distance_similarity number;
  jaro_distance_similarity number;
  type Vartab is table of varchar2(40);
  name_array  vartab;
  CURSOR tmp_utl_cur IS
    SELECT clean_merchant FROM tmp_utl_match_input
     ORDER BY row_num;

-- main body
BEGIN
  OPEN tmp_utl_cur;
  FETCH tmp_utl_cur
    bulk collect into name_array;
  num_rows := name_array.COUNT;

  execute_immediate 'truncate table tmp_utl_match_status';
  insert into tmp_utl_match_status values (0);

  FOR i in 1..num_rows-1 LOOP
    FOR j IN i+1..num_rows LOOP
      edit_distance_similarity = utl_match.edit_distance_similarity(name_array(i), name_array(j));
      jaro_winkler_similarity = utl_match.jaro_winkler_similarity(name_array(i), name_array(j);

      if (edit_distance_similarity > 50 or jaro_winkler_similarity > 50)
      then
        insert into tmp_utl_match_output values (i, name_array(i), j, name_array(j)
                                                ,edit_distance_similarity, jaro_winkler_similarity);
      END IF;
    END LOOP;

    update tmp_utl_match_status set current_row_num = i;
    commit;
  END LOOP;

EXCEPTION
  WHEN OTHERS THEN
    NULL; -- enter any exception code here
END;

Tags: Database

Similar Questions

  • Help with some PL/SQL triggers

    Hello, I'm totally new using PL/SQL, so I need your help with two triggers.
    For example
    1 compare two dates and check that there are different, you must send an error message

    2. when I insert a new record, a trigger must get data from other tables and Add (on a new record)

    Maybe not the answers, perhaps the way forward!
    Thks!

    Insert values into a new record of existing data tables

    This thing that you can do with simple sql statements as

    insert into table_name1 select column_name from table_name2;
    

    For example: -.

    create table test(id number(10));
    
    Table created.
    
    insert into test select empno from emp;
    
    14 row(s) inserted.
    
    select * from test;
    
    ID
    7839
    7698
    7782
    7566
    7788
    7902
    7369
    7499
    7521
    7654
    

    Thank you

    Mezaber

  • help with simple Hello World

    I just downloaded the latest version of Oracle SQL Developer, because I heard that it of free and comes with a debugger.

    So I have it all set up, I am connected to my database, but I wanted to run a simple example:

    I chose to create a new procedure and a new tab open, I have pasted this code and under DBMS output, I clicked on the + to: set serveroutput on
    CREATE OR REPLACE PROCEDURE TEST1 As
    DECLARE
       mytext varchar2(100) := 'Hello world!' ;  
    BEGIN
       dbms_output.put_line(mytext) ;
       dbms_output.put_line(mytext) ;
    END TEST1;
    Yes, I know I posted the put_line twice, it should display Hello World twice? same error with 1 line, when I remove the duplicate.

    Yet, I see this message in the log: "Source doesn't have a target executable."

    And when I try to compile, I see 2 errors:

    Procedure ORCL_SQL_DEVE_TEST1@CONNECTION

    Error (2.1): PLS-00103: encountered the symbol "DECLARE" when expecting one of the following: begin function package pragma procedure < an ID > subtype type use < a between double quote delimited identifiers of > form current cursor external language the symbol 'start' is substituted for 'SAID' continue.

    Error (6,10): PLS-00103: encountered the symbol "end-of-file" during awaits one of the following values: begin case declare exit end exception for goto rise back loop mod null pragma select update while < ID > < one between double quote delimited identifiers of > < a variable binding > < < close current delete fetch locking open insert commit rollback savepoint SQLExecute fusion forall hose set


    I'm using the Oracle SQL Developer version: Version 2.1.1.64

    Remove the DECLARE in the procedure. It is not necessary.

  • Desperately need help with simple program crashing using Qt and stdlibc ++

    I have a really trivial example that I was unable to get it running no matter what I try. I use ndk2.0.1. The configuration to recreate the problem is simple; the project should link to qt (4.8.2) and stdlibc ++ (not libcpp, libstdc ++).

    (main.cpp)

    #include 
    #include 
    int main(int argc, char *argv[])
    {
        std::cout << "This doesn't work\n";
        return 0;
    }
    

    That's all. You can use any toolchain you want (ntoxg ++ or CQS), seems not to matter. If you use the string of tools qcc, you must explicitly include the paths libstdc ++ and link to him, because it uses default libcpp. Build the project: it should compile correctly. The handle bar I used is here (http://pastie.org/4018541).

    Create the folder bar and deploy. Once I have started the program at this point, it show me the splashscreen for a few seconds and quit (crash)... You will notice:

    * No log output (we expect something of the call cost)

    * a nice base file pending crash

    Browsing the ntox-gdb core file gives you:

    #0  0xb8b5e329 in __gnu_cxx::__exchange_and_add (__mem=0x0, __val=-1)
        at atomicity.cc:36
    36  atomicity.cc: No such file or directory.
        in atomicity.cc
    
    (gdb) backtrace
    
    #0  0xb8b5e329 in __gnu_cxx::__exchange_and_add (__mem=0x0, __val=-1)
        at atomicity.cc:36
    
    #1  0xb8b03471 in __exchange_and_add_dispatch (__val=,
        __mem=)
        at /home/builder/hudson/650-gcc-4.4/svn/linux-x86-o-ntox86/i486-pc-nto-qnx6.5.0/pic/libstdc++-v3/include/ext/atomicity.h:79
    
    #2  _M_remove_reference (this=)
        at /home/builder/hudson/650-gcc-4.4/svn/linux-x86-o-ntox86/i486-pc-nto-qnx6.5.0/pic/libstdc++-v3/include/bits/locale_classes.h:505
    
    #3  std::locale::~locale (this=0xb837d5fc, __in_chrg=)
        at ../../../../../libstdc++-v3/src/locale.cc:89
    
    #4  0xb8b0faa9 in ~basic_streambuf (this=,
        __in_chrg=)
        at /home/builder/hudson/650-gcc-4.4/svn/linux-x86-o-ntox86/i486-pc-nto-qnx6.5.0/pic/libstdc++-v3/include/streambuf:193
    
    #5  std::basic_filebuf >::~basic_filebuf (
        this=0xb837d5e0, __in_chrg=)
        at /home/builder/hudson/650-gcc-4.4/svn/linux-x86-o-ntox86/i486-pc-nto-qnx6.5.0/pic/libstdc++-v3/include/fstream:215
    
    #6  0xb0bbd205 in __cxa_finalize ()
       from /home/preet/bbndk-2.0.1/target/qnx6/x86/lib/libc.so.3
    
    #7  0xb832de67 in _btext ()
       from /home/preet/bbndk-2.0.1/target/qnx6/x86/lib/libcpp.so.4
    
    #8  0xb836a265 in _fini ()
       from /home/preet/bbndk-2.0.1/target/qnx6/x86/lib/libcpp.so.4
    
    #9  0xb0bd46d3 in ?? ()
       from /home/preet/bbndk-2.0.1/target/qnx6/x86/lib/libc.so.3
    
    #10 0xb0bd5d38 in ?? ()
       from /home/preet/bbndk-2.0.1/target/qnx6/x86/lib/libc.so.3
    
    #11 0xb0bbd052 in _cleanup ()
       from /home/preet/bbndk-2.0.1/target/qnx6/x86/lib/libc.so.3
    
    #12 0xb0bbd337 in exit ()
       from /home/preet/bbndk-2.0.1/target/qnx6/x86/lib/libc.so.3
    
    #13 0x080487b0 in _start ()
    

    I have no idea what to do with this stack trace and I was not able to debug the problem more far.

    This question is particularly messed because I did not add any code to Qt on demand; just link to bookstores. Do not link to the Qt libraries will make this piece of code will work perfectly. A link to the Qt code with libcpp instead of libstdc ++ will also code to run as expected.

    This problem has been driving me crazy for the last days coueple and I would really really appreciate help or advice.

    KDAB guys told me it's a bug and they're looking into it.

  • Need help with ics. SQL return null

    Hi experts WCS.

    I have this ics. SQL statement that returns an IList as null and nothing in the errStr in debugging print.

    IList rsATypes is ics. SQL (, sqlATypes, listName, limit, bCache errStr);

    The code is in one of my jsp. He ran very well in my local JSK (HyperSQL Db), but returns NULL in the case of Test (Oracle DB, if this is another).

    I got the sql statement println during execution and run it directly in Oracle DB (same instance) it returns the expected result set.

    The code snippet:

      System.out.println("## ics.GetSSVar(\"pubid\")          : " + ics.GetSSVar("pubid"));
    
        // Get Attribute Types
        String sqlATypes = "SELECT DISTINCT assetpublication.assettype "
                         + "FROM assetpublication "
                         + "LEFT JOIN approvedassets "
                         + "    ON assetpublication.assetid = approvedassets.assetid "
                         + "WHERE pubid = '" + ics.GetSSVar("pubid") + "' "
                         + "AND (tstate is null OR tstate <> 'A') "
                         + "AND (voided is null OR voided <> 'T') "
                         + "ORDER BY assettype; ";
        System.out.println("##0126 sqlATypes : " + sqlATypes);
        String from = "AssetPublication, ApprovedAssets";
        // String listName = null;
        String listName = "ATypesList";
        int limit = -1;
        // boolean bCache = true;
        boolean bCache = false;
        StringBuffer errStr = new StringBuffer("");
        ics.ClearErrno();
        IList rsATypes = ics.SQL(from, sqlATypes, listName, limit, bCache, errStr);
    
        System.out.println("## rsATypes : " + rsATypes);
        if (rsATypes == null) {
            System.out.println("## NO DATA in rsATypes! errStr : " + errStr.toString());
    

    }

    The journal:

    ## ics.GetSSVar("pubid")          : 1374097570685
    ## sqlATypes : SELECT DISTINCT assetpublication.assettype FROM assetpublication LEFT JOIN approvedassets     ON assetpublication.assetid = approvedassets.assetid WHERE pubid = '1374097570685' AND (tstate is null OR tstate <> 'A') AND (voided is null OR voided <> 'T') ORDER BY assettype;
    ## rsATypes : null
    ## NO DATA in rsATypes! errStr :
    


    I got enclosing try catch block, who did not take any exception.


    The funny thing is, in the same piece of code, an ics. Casea used already worked (which I noticed outside because there was not enough for what I want to do):

            StringBuffer errSB = new StringBuffer("");
            ics.SetVar("assetid", id);
            IList approvedAsset = ics.SelectTo("ApprovedAssets", "state,voided,tstate,locked,reason,treason", "assetid", null, -1, null, true, errSB);
    

    Any help/ideas from anyone would be really appreciated.

    Thanks Guddu1223, I discovered why.

    The SQL statement cannot end with a semicolon (see line 11 of my original above codes). Delete who had back all the records provided for in my resultset in the IList.

    The reason why it works in my local, but not stable instance that I guess is my local JSK + HyperSQL, in WCS + Oracle DB instance trying...

  • image appears in 11 GR 2 with simple pl/sql procedure

    Hi all

    I am facing a strange situation and maybe you could help me.

    I install a simple procedure to load and show images BLOB of a table to the browser in two different databases (10g and 11g) and different servers.

    When I call in 10g:

    https://Server1:4443/chain/Images_API.Get_Gif?p_name=logorecord1.gif against 11R2g db1

    I get the picture

    In the second 11g

    https://Server2:4443/chain/Images_API.Get_Gif?p_name=logorecord1.gif against 10gr 2-db2

    I get:

    The image " " https://orapetakjdev.net1.cec.eu.int:4443/chain/Images_API.Get_Gif?p_name=logorecord1.gif ' cannot be displayed, because it contains errors. .

    my Oracle HTTP server logs and mod_plsql logs show no errors.

    No idea how to solve this problem?

    Otherwise how to debug?

    Thank you in advance.

    (Images) CREATE TABLE

    ID NUMBER (10) NOT NULL,

    name VARCHAR2 (50) NOT NULL,

    the image BLOB NOT NULL

    )


    CREATE or REPLACE PACKAGE images_api AS

    Charge of the PROCEEDINGS (p_name IN images.name%TYPE);

    Get (p_name IN images.name%TYPE PROCEDURE,

    p_type IN VARCHAR2 DEFAULT 'gif');

    PROCEDURE get_gif (p_name IN images.name%TYPE);

    PROCEDURE get_jpeg (p_name IN images.name%TYPE);

    END;

    /


    CREATE or REPLACE PACKAGE BODY images_api AS

    Charge of the PROCEDURE (p_name IN images.name%TYPE) IS

    v_bfile BFILE.

    v_blob BLOB;

    BEGIN

    INSERT INTO images (id, name, image)

    VALUES (images_seq. NEXTVAL, p_name, EMPTY_BLOB())

    TURN the image INTO v_blob.

    v_bfile: = BFILENAME ('IMAGE_DIR', p_name);

    DBMS_LOB. FileOpen (v_bfile, DBMS_LOB.file_readonly);

    DBMS_LOB. LoadFromFile (v_blob, v_bfile, DBMS_LOB.getlength (v_bfile));

    DBMS_LOB. FileClose (v_bfile);

    COMMIT;

    EXCEPTION

    WHILE OTHERS THEN

    ROLLBACK;

    LIFT;

    END;

    Get (p_name IN images.name%TYPE PROCEDURE,

    p_type IN VARCHAR2 DEFAULT 'gif') IS

    v_blob BLOB;

    BEGIN

    CHOOSE the image

    IN v_blob

    Images

    WHERE name = p_name;

    OWA_UTIL.mime_header ("image /" | p_type);

    -Start, 9i method.

    DECLARE

    v_amt NUMBER: = 30;

    v_off NUMBER: = 1;

    v_raw RAW (4096);

    BEGIN

    LOOP

    DBMS_LOB. Read (v_blob, v_amt, v_off, v_raw);

    HTP.prn (UTL_RAW.cast_to_varchar2 (v_raw));

    v_off: = v_off + v_amt;

    v_amt: = 4096;

    END LOOP;

    EXCEPTION

    WHEN NO_DATA_FOUND THEN

    NULL;

    END;

    -End 9i method.

    -10g method.

    -WPG_DOCLOAD.download_file (l_blob);

    END;

    PROCEDURE get_gif (p_name IN images.name%TYPE) IS

    BEGIN

    get (p_name, "gif");

    END;

    PROCEDURE get_jpeg (p_name IN images.name%TYPE) IS

    BEGIN

    get (p_name, "jpeg");

    END;

    END;


    Hi Topas.

    I could be wrong, but this looks a bit like:

    (1) your character set of the client (in this case, mod_plsql) is different from the database character set

    (2) that the Content-Length which is calculated 'automatically' by something somewhere is incorrect.

    Maybe you should do instead * is * include the content-length header.

    Joel

  • Help with anonymus pl/sql layout using javascript

    Hi people.

    I want to display records on a region (using apex 4.2), this anonymous pl/sql script below shows 3 records in database, but the layout only shows me the first album with its data, the other 2 files, only show me the labels.
    I checked this same query creating a report and it shows the 3 files correctly.
    I guess I'm doing something wrong with this javascript routine or certainly miss something,
    in this link you can see the layout I get. (http://sdrv.ms/Xrv0J8).

    Another is the little help I need to display in a line for each record. in fact, I'm getting a line for each label and a line for each data record. I have read and learned something is/div, but I don't know how to change it to get the desired results, any suggestion is welcome.

    Thanks in advance for any help.



    I am completely new in apex and java script, but I have several years of experience in pl/sql.

    -------


    The Script:

    Begin
    Declare
    Anyth cursor is
    Select the item,
    To_char (delivery, ' month DD, YYYY hh24:mi:ss ") delivery.
    Current_date
    Of pending_items;
    Begin
    For a loop Anyth
    Begin
    Sys.Htp.P ("< script type =" text/javascript"> '");
    Sys.Htp.P ('function cdtd() {'});
    Sys.Htp.P ("var Christmas = new Date (" ' | ') ") a.Delivery | '")');
    Sys.Htp.P ("var now = new Date();'");
    Sys.Htp.P ("var timeDiff = xmas.getTime () - now.getTime ();'");
    Sys.Htp.P (' if (timeDiff < = 0) {'});
    Sys.Htp.P ('clearTimeout() (timer)');
    -Sys.Htp.P ("document.write ("of the text here.")");
    Sys.Htp.P (' / / execute all necessary code to the completion of the countdown here ');
    Sys.Htp.P ('} ');
    Sys.Htp.P (' var seconds = Math.floor(timeDiff / 1000);) ") ;
    Sys.Htp.P ("var minutes = Math.floor(seconds / 60) ;");
    Sys.Htp.P (' varhour = Math.floor(minutes / 60);) ") ;
    Sys.Htp.P ("days var Math.floor(hours / 24) = ;"); ")
    Sys.Htp.P (' hours = 24 ;'); %)
    Sys.Htp.P (' minutes % = 60 ;');)
    Sys.Htp.P (' seconds % = 60 ;');)
    Sys.Htp.P (' document.getElementById("daysBox").innerHTML = days ;');)
    Sys.Htp.P (' document.getElementById("hoursBox").innerHTML = hours;) ") ;
    Sys.Htp.P (' document.getElementById("minsBox").innerHTML = minutes ;');)
    Sys.Htp.P (' ;'); seconds = document.getElementById("secsBox").innerHTML)
    Sys.Htp.P (' timer var = setTimeout ("cdtd ()", 1000);');
    Sys.Htp.P ('} ');
    Sys.Htp.P ("< /script >");
    Sys.Htp.P ("days");
    Sys.Htp.P ("< div id ="daysBox"> < / div > '");
    Sys.Htp.P ("hours");
    Sys.Htp.P ("< div id ="hoursBox"> < / div > '");
    Sys.Htp.P ('minute');
    Sys.Htp.P ("< div id ="minsBox"> < / div > '");
    Sys.Htp.P ("seconds");
    Sys.Htp.P ("< div id ="secsBox"> < / div > '");
    Sys.Htp.P ("< script type =" text/javascript"> '");
    Sys.Htp.P ('cdtd() < /script > ');
    End;
    End loop;
    End;
    End;

    For now, let's focus on delivery dates and the javascript.
    Why you would put your javascript in htp.p called in a plsql region is beyond me. When you edit the page there is a region of javascript where you can put global variables and functions, a great spot for it then and much easier to manage than that.
    Now, it is also clear that your query on pending items will return multiple records. Thus, using a report would serve you well in this case. However, using code like this:

    document.getElementById("daysBox").innerHTML = days;
    document.getElementById("hoursBox").innerHTML = hours;
    document.getElementById("minsBox").innerHTML = minutes;
    document.getElementById("secsBox").innerHTML = seconds;
    

    you won't have to. getElementById is supposed to return an element identified by a code. If you have a report that contains multiple lines and elements on each line with the same ID, you're doing something wrong. You should be the date of delivery by rank, and I suppose that you put your code with htp.p because you don't know how to deal with this and passing the procedure of javascript.
    But would it not more oppurtune for you simply create a report with a sql source when you calculate each part of the date and then refresh this region with a certain interval. If you would be refreshed every 5 minutes, not who is more fast enough to keep track of things? Remember, refreshing a region will execute the SQL again.
    It is not that you cannot make a report multi-record with a countdown by rank, but are you sufficiently comfortable with javascript and jquery to encode and maintain that against leverage plsql and dynamic actions (there is even an action timer plugin supplied by oracle dynamic)?

  • Need help with this pl/sql code

    Hello
    It is showing an error sql command not properly ended... where FLX_TEXTTRAN802003. SPTEXTINSERT
    is a package... help me please
    BEGIN
       DECLARE
          v_TextID   NUMBER :=0;
          I_LanguageID NUMBER := 1033;
          v_count number;
          e_error EXCEPTION;
    
    BEGIN 
     
    
    
    
            
    --INsert into text
                FLX_TEXTTRAN802003.SPTEXTINSERT
                                               (io_id                => v_TextID,
                                                i_type               => N'',
                                                i_lastupdateon       => cob_f_getutc,
                                                i_lastupdatedby      => 'NGMESSystem',
                                                i_createdon          => cob_f_getutc,
                                                i_createdby          => 'NGMESSystem'
                                               );
            
    
            
            
         
    --    Insert into TEXT_TRANSLATION
                FLX_TEXTTRAN802003.SPTEXTTRANINSERT
                                               (i_TextID             => v_TextID,
                                                I_LanguageID         => I_LanguageID,
                                                i_short              => 'CUSTOMER',
                                                i_medium             => 'CUSTOMER',
                                                i_extended           => 'CUSTOMER',
                                                i_lastupdateon       => cob_f_getutc,
                                                i_lastupdatedby      => 'NGMESSystem',
                                                i_createdon          => cob_f_getutc,
                                                i_createdby          => 'NGMESSystem'
                                               );
                        
                
        select count(*) into v_count from characteristic_class where name='CUSTOMER' 
    if v_count = 0 then
         
    
           
      
            Insert into FLXUSER.characteristic_class
       (ID, NAME, TEXTID, REFERENCEID, LASTUPDATEON, LASTUPDATEDBY, CREATEDON, CREATEDBY, ACTIVE, LASTDELETEON, LASTDELETEDBY, LASTREACTIVATEON, LASTREACTIVATEDBY, ARCHIVEID, LASTARCHIVEON, LASTARCHIVEDBY, LASTRESTOREON, LASTRESTOREDBY, ROWVERSIONSTAMP)
     Values
       (SEQ_CHARACTERISTIC_CLASS.nextval, 'CUSTOMER', v_TextID, NULL, 
        NULL, NULL, TO_DATE('11/05/2012 16:49:05', 'MM/DD/YYYY HH24:MI:SS'), 'SYSTEM', 1, 
        NULL, NULL, NULL, NULL, NULL, 
        NULL, NULL, NULL, NULL, 1);
    commit;
      
    
    ELSE
    Raise e_error;
    END IF;
    EXCEPTION
    when e_error then
    dbms_output.put_line('data already exist');
    end;

    Hello

    next to what Frank says, the following line:

       select count(*) into v_count from characteristic_class where name='CUSTOMER' 
    

    missing semicolon at the end:

       select count(*) into v_count from characteristic_class where name='CUSTOMER' ;
    

    Also the BEGIN initial until the DECLARE is unmatched (no corresponding END).
    You can remove it.

    Kind regards.
    Al

    Published by: Alberto Faenza on November 6, 2012 16:24

  • Need help with simple if/then script

    I'm trying to replicate a simple if/then statement excel in a PDF form. Have tried several things, but am just not a scripter Java.  The hope that I could get help from the community.

    I have three boxes that contain information on costs. They are labeled LaborCost, MaterialCost & EquipmentCost. Later, in the form, I have two boxes of different output for the sum out of my first three boxes.  If it's a positive number and the other is a negative number.  In Excel forumla language, that's what each of the boxes would read as:

    For the 1st result if it is a positive number: @if (+ LaborCost + MaterialCost + EquipmentCost > 0, + LaborCost + MaterialCost + EquipmentCost, 0)

    For the 2nd result if it is a negative number: @if (+ LaborCost + MaterialCost + EquipmentCost < 0, + LaborCost + MaterialCost + EquipmentCost, 0)

    I think that this should be a simple thing to write, but I'm not familiar with the games of the appropriate language.

    Your colletive help is VERY appreciated.

    Steven

    Try following the calculation script customized:

    // Sum the field values, as numbers
    var sum = +getField("LaborCost").value;
    sum += +getField("MaterialCost").value;
    sum += +getField("EquipmentCost").value;
    
    // Set this field value
    event.value = sum > 0 ? sum : 0;
    

    For others, change the last line:

    Event.Value = sum< 0="" sum="" :="">

  • Need help with a PL/SQL code

    Hello

    I am trying to execute the following PL/SQL code, which translates errors, obviously I'm not doing things, but it gives you an idea what I'm trying to do:

    DECLARE

    INT var_count;

    SELECT COUNT (*) IN var_count

    FROM sys.all_tables WHERE OWNER = 'SAKILA' AND table_name = "ACTOR";

    If var_count > 0 then

    BEGIN

    DROP TABLE "ACTOR";

    END;

    /

    Erros:

    SELECT COUNT (*) IN var_count

    *

    ERROR at line 3:

    ORA-06550: line 3, column 1:

    PLS-00103: encountered the symbol "SELECT" at the expected in the following way:

    Start function < an ID > pragma procedure subtype type

    < between double quote delimited identifiers > delete the current cursor

    There is before

    The symbol 'start' has been substituted for "SELECT" to continue.

    ORA-06550: line 7, column 1:

    PLS-00103: encountered the symbol "DROP" when expecting one of the following conditions:

    (begin case declare exit for goto if loop mod null pragma

    raise return select update while < ID >

    < between double quote delimited identifiers of > < a variable binding > < <

    continue the narrow current delete fetch locking insert open rollback

    savepoint sql set run commit forall fusion pipe purge

    Your help to create it in a right way will be appreciated.

    Thank you very much.

    Tonya.

    Try the following:

    My = $ora $csr-> prepare (q {}

    DECLARE

    INT var_count;

    BEGIN

    SELECT COUNT (*) IN var_count

    FROM sys.all_tables WHERE OWNER = 'SAKILA' AND table_name =: ts;

    If var_count > 0 then

    RUN IMMEDIATELY 'DROP TABLE' |: ts | "CASCADE CONSTRAINTS;

    end if;

    END;

    });

  • I need help with the following sql.

    I'm lost. I'm collecting information for the days of the month.  For days I have not, I would like to query to get these days also.
    The days of return I have with data and all other days where I'm not.

    How can I get the rest of the days of the month of June.  If I execute sql against the following.

    Select * from
    (Select '02' as the double Study_Date
    Union Select '03' as the double Study_Date
    Union Select '04' as the double Study_Date
    Union Select '04' as the double Study_Date
    Union Select '05' as the double Study_Date
    Union Select '06' as the double Study_Date
    Union Select '09' as the double Study_Date
    Union Select '10' as the double Study_Date
    Union Select '11' as the double Study_Date
    Union Select '12' as the double Study_Date
    Union Select '13' as the double Study_Date
    Union Select '16' as the double Study_Date
    Union Select '19' as double Study_Date)

    Thank you

    Howard

    Hello, Howard.

    Thanks for posting the sample data!  Don't forget to post the exact results you want from these data.

    Looks like you want something involving everyday of the month, they have a day corresponding to your table or not.  This looks like a job for an outer join.

    This should give you some ideas:

    WITH days_wanted AS

    (

    SELECT TO_CHAR (LEVEL, 'fm00') n

    OF the double

    CONNECT BY LEVEL<=>

    )

    SELECT d.n

    t.study_date

    NVL2 (t.study_date

    'Yes '.

    'No '.

    ) AS in_table_x

    OF days_wanted d

    LEFT OUTER JOIN table_x t ON t.study_date = d.n

    ORDER BY d.n

    ;

    Output:

    STUDY_DATE N IN_TABLE_X

    --- ---------- ----------

    01 NO.

    02 02 Yes

    03 03 Yes

    04 04 Yes

    05 05 Yes

    Yes 06 06

    07 NO.

    08 NO.

    09 09 Yes

    10 10 Yes

    11 11 Yes

    12 12 Yes

    13 13 Yes

    14 NO.

    15 NO.

    16 16 Yes

    17 NO.

    18 NO.

    19 19 Yes

    20 NO.

    21 NO.

    22 NO.

    23 NO.

    24 NO.

    25 NO.

    26 NO.

    27 NO.

    28 NO.

    29 NO.

    30 NO.

    You must use a DATE for study_date, not a VARCHAR2 column.  What will you do if you have days of different months in the table?

  • Help with simple properties plugin

    I am trying to implement a plugin that will give me a simple way to record the serial number of the machine on which an agent is installed.  From what I've read, it should be doable using the < property > tags in a plugin (http://support.hyperic.com/display/DOC/properties) but its does not quite how the docs say should be.

    I have a created plugin that looks like this:
    < plugin >
    < platform name = "Linux" >
    Properties of <>
    < property name = "serial" description = "Serial number" / >
    < / properties >
    < / platform >
    < / plugin >

    Initializes this plug-in without error both manually and when I deploy it and restart the agent, but when I look at the AC there is no field under properties for each series or serial number of the agent on which I deployed it.  Obviously, I'm missing something in my plugin, but I have no idea what.  Can someone point me in the right direction?

    Hello

    What you're trying to do, it won't work. Your plugin tries to create a named Linux platform which should already exist.

    The closest I can think to do would be to change your plugin to be a service platform with the configuration properties for the service being serial number.

  • Please help with simple code. Photo and text formatted.

    Hello
    I want to design a HBox. I want to put the image on the left and the text on the right and the bootom. I have 2 problems.

    1. I want to start the text when the image finishes leaving 10 pix in between.
    2. I want the text under the picture too.

    Here is my code.

    Help, please.

    <? XML version = "1.0" encoding = "utf-8"? >
    "" < mx:Application xmlns:mx = ' http://www.adobe.com/2006/mxml ' layout = "absolute" >
    < mx:HBox id = "LowerLeft" width = "30%" height = "80%" borderStyle = "solid" borderColor = "#fffffc" borderThickness = "2" >
    < mx:Image id = "image1" source = "1.jpg" height = "100" width = "150" / > "
    < mx:TextArea height = "172" width = "288" horizontalScrollPolicy = "off" verticalScrollPolicy = "off" letterSpacing = "1" backgroundAlpha = BorderThickness upper "0" = "0" fontSize = "12" fontFamily = "Times New Roman" wordWrap = "true" textAlign = "left" backgroundColor = "#869 ca 7" color = "#ffffff" >
    < mx:htmlText >
    <! [CDATA [it comes to cardiovascular medicine.translate the extraordinary progress to promote cardiovascular health.] At the level of the core of SCVI is a richl as he iscardiovascular medicine

    It comes to cardiovascular medicine.translate the extraordinary progress of science and the rich thing.

    Cardiovascular MedicineThis is cardiovascular medicine.translate the extraordinary progress. []] > < / mx:htmlText >
    < / mx:TextArea >
    < / mx:HBox >

    < / mx:Application >

    You could add the image inline with the html text and the text to wrap around the image.

    TS

  • Need help with simple database creation in number.

    I'm trying to create a simple database in number to capture the case IDs on my place of work. After you have entered a value in the worksheet 1 details must automatically added to sheet 2. Once the case details are entered and user click on the "submit" button (could not include in the screenshot), it should appear in the sheet 2. If number offers this feature, it would be very useful for me.

    Thanks to ddvance,

    Nanan

    Why don't you just enter values directly in the second table?  You could format C and D in the context Menu.

    SG

  • Help with MS Access SQL Developer Import (problem of DateTime field)

    So here's my dilemma...

    I am currently trying to import from MS Access to SQL Developer, by exporting MS Access to MS Excel and then import in my table of the exporting Excel sheet. What happens is that when I import the excel sheet, it is does not keep the format of date/time / I tried several different formats, but everyone seems to exclude the time and the date.

    My field of date/time is currently set up like this on SQL Developer:

    DD/RRRR/MM HH: MM: SS AM/PM

    And the Excel sheet, I'm importing the field corresponding, defined as follows:

    mm/dd/yyyy/hh/mm/ss AM/PM

    The answer (s) I'm importing is as follows:

    Date/time physical_cpu server_id

    01/11/2013-12:01:23 AM scc415 6.03999996

    When the record is imported, it eliminates the time, so the imported data are:

    Date/time physical_cpu server_id

    01/11/2013 6.03999996 scc415

    Any idea on how to get this timestamp to import properly? Many appreciate the ideas in advance!

    Looks like I have found the solution. For some reason, export to leave access to Excel first and then open and save the file as a .csv instead of a .xlsx, date/time information are maintained. This problem has been resolved.

    Found the solution on the following link for anyone interested.

    Import from excel using SQLDeveloper date/time field

Maybe you are looking for

  • Black screen and resetting the system

    My Macbook Pro goes to a black screen with the launch of the color wheel, which requires a reboot of strength with the power button. Restart the system fixed compensation to my home folder and preferences reset all icons by default and demanding conn

  • URGENT return on F55 at Sony

    Hello What are the best ways to get feedback to Sony directly. I took delivery of my F55 last week and met a few problems that need to be sorted in the updates of the Firmware. Preference earlier... I have shot for 3 days with the camera now and have

  • FLAS disk not recognized

    I have a problem of access to other external USB drives and flash memory. Once connected, I can see the drive and open the files on it in Windows Explorer (I am running Windows XP - SP3). For example, when I click on a Word document, the file starts

  • Mooring: w or w/o battery?

    Welcome all. Curious more than anything else... I use my W510 on a pier 99% of the time. Does he / she would make a difference if I leave the battery permanently or not? I wonder if I can extend the useful to not use it on the dock; just He burst in

  • Problem to join a domain with Windows Vista Bussiness

    I have my domian with Windows Server 2008 standard, on my network, I have Windows XP, 2000, Win7 and Vista computers and laptops. I have no problem to join all computers, but when I try to join a computer or laptop with Vista it keeps giving me this