Computation of factorial by creating a procedure for her

Hello everyone
I tried to create a procedure for the calculation of the factorail of a number
but something's not right
I hope that you guys can drive the correct path
Here is my code
create or replace procedure factorial(n in number)
is 
           v number;
begin

       for i in reverse n..1
 loop
              v :=v*i;
end loop;
dbms_output.put_line(v);
end;

Why reverse?


 1   create or replace procedure factorial(n in number)
  2   is
  3              v number :=1;
  4   begin
  5          for i in  1..n
  6    loop
  7                 v :=v * i;
  8   end loop;
  9   dbms_output.put_line(v);
 10*  end;
SQL> /

Procedure created.

SQL>
SQL>  begin
  2   factorial(5);
  3   end;
  4  /
120

PL/SQL procedure successfully completed.

Tags: Database

Similar Questions

  • HEEELP: Re-create the procedure for the Essbase.sec file in 11.1.2.0

    Hello
    What is the procedure for recreating the file Essbase.sec in 11.1.2.0 Essbase environment... In older versions, it has been used to remove Essbase.sec, start the Essbase server and it has been recreated a file void essbase.sec... But in 11.1.2.0 with Shared services... is the procedure? If it is deleted from the file essbase.sec... start Essbase Service recreates and will update SSP Outlook2003?


    Please someone help...

    Thank you...

    Hi Alex,

    Unfortunately, I have about 20 questions to ask in order to really be able to provide useful guidance, but at least I recommend checking out 'The Essbase security file management' section of the Essbase DBAG and eventually the Oracle Hyperion Enterprise Performance Management System Backup and Recovery Guide.

    11.1.2.1 SER60-online http://docs.oracle.com/cd/E17236_01/epm.1112/esb_dbag/frameset.htm?launch.html

    11.2.1.1-online http://docs.oracle.com/cd/E17236_01/epm.1112/epm_backup_recovery_11121/frameset.htm?launch.html BURG

    Thank you

    Todd Rebner

  • Change in the merger of insert and create a procedure for updating the records after

    Hello

    I have a table that contains about 50 M lines of partition, and every day I have an application that performs a merge to insert records statement about 100 k per day and it's 300 M updates a day.

    Because I both update and insert the application performs a merge.
    I need to make at least 500 M, updated day by day, and for this reason this solution doesn't have enough performance for what I'm asking.

    I think another solution that I will try to implement now, and I just posted this in an attempt to get help on the option that I may have to do.

    I want to start putting in place:
    -Locations is updated 'last_record_date' using 'KEY1' and 'Key2' "KEY3";
    -Change the application to only inserts into a temporary table.
    -Have two procedures, one that takes the new records from the temporary table and inserts it into the final table, and another that selects records which is updated and perform an update.
    -This two procedures will choose the records and delete them from the temporary table (or mark them as updated\inserted).

    The volume is very large, so performance is a challenge! That's why I'm writing this, because a solution with enough performance for the intermediate stage will be difficult.
    My final table is partitioned by date and the date is the area that I need to update (instead of create daily partitions in order to reduce the frequency of the movement of the line, I create monthly partitions)!
    It is currently my table definition:
    CREATE TABLE MY_TEST_TABLE
        (KEY1                           VARCHAR2(50 BYTE) ,
        KEY2                         VARCHAR2(50 BYTE) NOT NULL,
        KEY3                           VARCHAR2(50 BYTE) ,
        last_record_date                    VARCHAR2(50 BYTE) NOT NULL)
      PCTFREE     10
      INITRANS    1
      MAXTRANS    255
       STORAGE   (
        BUFFER_POOL DEFAULT
      )
      NOCACHE
      MONITORING
      ENABLE ROW MOVEMENT
      PARTITION BY RANGE (last_record_date)
      (
      PARTITION MY_TEST_TABLE_201112 VALUES LESS THAN ('20120101')
      PCTFREE     10
      INITRANS    1
      MAXTRANS    255
      NOLOGGING,
      PARTITION MY_TEST_TABLE_201201 VALUES LESS THAN ('20120201')
      PCTFREE     10
      INITRANS    1
      MAXTRANS    255
      NOLOGGING,
      PARTITION MY_TEST_TABLE_201202 VALUES LESS THAN ('20120301')
      PCTFREE     10
      INITRANS    1
      MAXTRANS    255
      NOLOGGING,
      PARTITION def VALUES LESS THAN (MAXVALUE)
      PCTFREE     10
      INITRANS    1
      MAXTRANS    255
      NOLOGGING
      )
      NOPARALLEL
    /
    
    
    
    -- Constraints for MY_TEST_TABLE
    
    ALTER TABLE MY_TEST_TABLE
    ADD CHECK ("KEY1" IS NOT NULL)
    /
    
    ALTER TABLE MY_TEST_TABLE
    ADD CHECK ("KEY2" IS NOT NULL)
    /
    
    ALTER TABLE MY_TEST_TABLE
    ADD CHECK ("KEY3" IS NOT NULL)
    /
    ALTER TABLE MY_TEST_TABLE
    ADD CONSTRAINT pk_MY_TEST_TABLE PRIMARY KEY (KEY1, KEY2, KEY3)
    USING INDEX
      PCTFREE     10
      INITRANS    2
      MAXTRANS    255
    /
    Thank you
    Ricardo Tomas

    naoseionome wrote:
    Hello

    My version is:
    Oracle Database 11 g Enterprise Edition Release 11.2.0.2.0 - 64 bit Production

    It's the DOF I used to create the database.

    The merger is common during every day for about 10 M records.

    There are several methods to do the update, but they do sequencially to avoid deadlocks (because I can't control the source and each process can update the same keys.

    The update uses "KEY1, KEY2, KEY3" to update the value 'LAST_RECORD_DATE' have impact by being date or varchar2?

    I'm still waiting to receive permissions in order to follow up the matter, but in the meantime, in that I am trying to implement this work around in order to accelerate a development in the case where it would be necessary! Comments only I have at the moment, it is that he is not able to process the total amount of records timely (order book is generated).

    Thank you
    Ricardo

    Well, the first thing we do is to change the type of data type varchar to a date. The main impact is that a date is not a string, it's a date. If you are adding data processes in different date formats (which is possible when you use a character to store information) you're going to be very sad (good luck converting back an effective date).

    An example of how this can happen easily.

    ME_TUBBZ?select to_char(sysdate) from dual;
    
    TO_CHAR(SYSDATE)
    -----------------------------
    12-jan-2012 10 55:33
    
    1 row selected.
    
    Elapsed: 00:00:00.01
    ME_TUBBZ?alter session set nls_date_format = 'yyyy-mon-dd';
    
    Session altered.
    
    Elapsed: 00:00:00.01
    ME_TUBBZ?select to_char(sysdate) from dual;
    
    TO_CHAR(SYSDATE)
    --------------------
    2012-jan-12
    
    1 row selected.
    
    Elapsed: 00:00:00.00
    

    Assuming that the client passes the column as an Oracle DATE will make an (implicit) conversion to store the data as a string, which will be based on the current settings of the NLS for the session. This allows also for someone to completely non-jour the information in the column (super bad). It's just really bad form to use strings to store dates, numbers, anything that is not naturally a string.

    Based on the description of your problem, I can't imagine how your partitioning scheme performs one action in another that require more work in order to process the updates (which are most of your needs). Partitioning does not equate to increase performance. It is a tool that, like every tool has its place, but I do not think that this is justified for what you do (certainly not how you currently use it anyway).

    I say no partitioning can not be useful for you, but I don't think that on the column that you are currently using is 'good '.

    Something I would like to personally study (must be able to compare this approach to your course, if you need parameters for comparison) if I were you would be using a Table Index organized for it. It will take more time to perform the operations insertion, but that is a small part of all the work that you do for this process. For updates, it should eliminate a lot of IO, assuming that you are doing an INDEX seek followed by a table access by ROWID to perform updates. This recommendation assumes that everything you said is true. You have 4 columns in your table, of which 3 are components of the primary key and the 4th is a date (note I did not string :)) and that you refresh mainly, not fit.) Also that you have no 'secondary' on this entity index (and none are needed).

    I would investigate this approach before the solution of temporary table that you are currently studying.

    See you soon,.

  • How to create a procedure for REF CURSOR output with any WHERE clause?

    I have a requirement like this: I have a huge question that need to reuse in my code over 10 times. This SQL has about 50 lines. Here for these 10 odd times sometimes changes in WHERE clause (columns are the same). So I can't create a view as SQL is not static.

    I thought to write a procedure with a para of WHERE_CLAUSE entry. I pulled out a refcursor sys by adding where clause. But I can't do it because you cannot add a clause like this where clause.

    i.e.
    PROCEDURE dynamyic_query (p_where_clause IN VARCHAR2, p_out_query OUT SYS_REFCURSOR ) IS
    BEGIN
    
      OPEN p_out_query FOR SELECT ......... FROM table WHERE || ' ' || p_where_clause;
    
    END;
    The foregoing gives an error.

    How to handle such a situation? Any help would be greatly appreciated.

    Hello

    Channa wrote:
    ... However, when I change the procedure like this:

    PROCEDURE FORMS_TEXT_DYN_SQL_TEST(p_where_cluase IN VARCHAR2, p_out_cursor OUT SYS_REFCURSOR) IS
    v_stmt VARCHAR2(1000);
    BEGIN
    v_stmt := 'SELECT tname FROM tab_test WHERE tname LIKE ''%ABS_V4%'' AND :y';
    
    OPEN p_out_cursor FOR v_stmt using p_where_cluase;
    
    END;
    

    And run this block of code:

    declare
    v_tname varchar2(200);
    out_cursor sys_refcursor;
    begin
    forms_text_dyn_sql_test(' 1 = 1 ', out_cursor );
    LOOP
    fetch out_cursor INTO v_tname;
    exit when out_cursor%NOTFOUND;
    DBMS_OUTPUT.PUT_LINE(v_tname);
    END LOOP;
    end;
    /
    

    I get the error:

    [1]: (Error): ORA-00920: invalid relational operator ORA-06512: at "ABS.FORMS_TEXT_DYN_SQL_TEST", line 6 ORA-06512: at line 5
    

    Looks like you can only set column_name =: z, column_name =: values of type y. You can not it seems to replace it with no WHERE CLAUSE?

    A bind variable, such as: it, represents a single value.
    If: is the VARCHAR2 '1 = 1', then

    SELECT tname FROM tab_test WHERE tname LIKE '%ABS_V4%' AND :y
    

    takes the value

    SELECT tname FROM tab_test WHERE tname LIKE '%ABS_V4%' AND '1 = 1'
    

    I think you want something like this:

    CREATE OR REPLACE PROCEDURE FORMS_TEXT_DYN_SQL_TEST
    (     p_where_clause      IN      VARCHAR2
    ,      p_out_cursor      OUT      SYS_REFCURSOR
    ) IS
      v_stmt VARCHAR2(1000);
    BEGIN
      v_stmt := 'SELECT ename FROM scott.emp WHERE ename LIKE ''%A%'' AND '
              || p_where_clause;
    
      OPEN p_out_cursor FOR v_stmt;
    
    END;
    /
    show errors
    
    SET  SERVEROUTPUT  ON
    
    declare
      v_tname varchar2(200);
      out_cursor sys_refcursor;
    begin
      forms_text_dyn_sql_test(' 1 = 1 ', out_cursor );
      LOOP
        fetch out_cursor INTO v_tname;
        exit when out_cursor%NOTFOUND;
        DBMS_OUTPUT.PUT_LINE(v_tname);
      END LOOP;
    end;
    / 
    

    Output:

    ALLEN
    WARD
    MARTIN
    BLAKE
    CLARK
    ADAMS
    JAMES
    
  • I bought a new computer, how do I transfer my program for her

    I bought a new computer, how do I transfer the program

    ASK - Forum-Guide to success: effectively using forums

    You do not transfer a program, you are doing a new installation

    You install exactly in the same way you did the 1st time... Put your disc in the drive, and enter your serial number when asked

    .

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

    -includes a way to go to a page to download the Adobe programs if you do not have a disk or drive

    -Cloud desktop http://helpx.adobe.com/creative-cloud/help/creative-cloud-desktop.html

    -Cloud Getting Started https://helpx.adobe.com/creative-cloud.html

    -you will need to enter your original serial number during the installation for non-Cloud programs

    - or kglad links in response to #1 here can help https://forums.adobe.com/thread/2081216

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

  • procedure for data types long Analyzer

    Plesae need help to create the procedure for paser then insert in a source table have columns with long data types
    example of source table

    Varchar2 item ID (250)
    2001008
    REC (LONG)
    D20060119000175538000.2? D20060119000175541300.2? D20060119000175569900.2? D20060119000183679900.2?

    by traget_table
    ItemId
    2001008
    value
    D20060119000175538000.2
    D20060119000175541300.2
    D20060119000175569900.2
    D20060119000183679900.2

    Hello

    Your question reminds me of this parser for clob procedure.
    However, the LONG are a tad more "Wicked".
    Another way, assuming you want to convert, and then divide your LONG data in a VARCHAR2 column, is to 'Park' your LONG temporarily in a CLOB column:

    SQL> create table source_tab (itemid number, long_value long);
    
    Table created.
    
    SQL> create table target_tab (itemid number, clob_value clob, varchar2_value varchar2(255));
    
    Table created.
    
    SQL> insert into source_tab
      2  select  1 , 'D20060119000175538000.2*?*D20060119000175541300.2*?*D20060119000175569900.2*?*D20060119000183679900
      3  select  2 , 'E20060119000175538000.2*?*E20060119000175541300.2*?*E20060119000175569900.2*?*E20060119000183679900
      4  select  3 , 'F20060119000175538000.2*?*F20060119000175541300.2*?*F20060119000175569900.2*?*F20060119000183679900
    
    3 rows created.
    
    SQL> select * from source_tab;
    
        ITEMID LONG_VALUE
    ---------- --------------------------------------------------------------------------------
             1 D20060119000175538000.2*?*D20060119000175541300.2*?*D20060119000175569900.2*?*D2
             2 E20060119000175538000.2*?*E20060119000175541300.2*?*E20060119000175569900.2*?*E2
             3 F20060119000175538000.2*?*F20060119000175541300.2*?*F20060119000175569900.2*?*F2
    
    3 rows selected.
    
    SQL> select * from target_tab;
    
    no rows selected
    
    SQL> insert into target_tab(itemid, clob_value)
      2  select itemid
      3  ,      to_lob(long_value)
      4  from   source_tab;
    
    3 rows created.
    
    SQL> select * from target_tab;
    
        ITEMID CLOB_VALUE                                                                       VARCHAR2_VALUE
    ---------- -------------------------------------------------------------------------------- -------------------------
             1 D20060119000175538000.2*?*D20060119000175541300.2*?*D20060119000175569900.2*?*D2
             2 E20060119000175538000.2*?*E20060119000175541300.2*?*E20060119000175569900.2*?*E2
             3 F20060119000175538000.2*?*F20060119000175541300.2*?*F20060119000175569900.2*?*F2
    
    3 rows selected.
    
    SQL> insert into target_tab(itemid, varchar2_value)
      2  select itemid
      3  ,      extractvalue (column_value, 'e')
      4  from   target_tab
      5  ,      table (xmlsequence (xmltype ('' || replace (clob_value, '*?*', '') || '').extract ('
    
    12 rows created.
    
    SQL> select * from target_tab;
    
        ITEMID CLOB_VALUE                                                                       VARCHAR2_VALUE
    ---------- -------------------------------------------------------------------------------- -------------------------
             1 D20060119000175538000.2*?*D20060119000175541300.2*?*D20060119000175569900.2*?*D2
             2 E20060119000175538000.2*?*E20060119000175541300.2*?*E20060119000175569900.2*?*E2
             3 F20060119000175538000.2*?*F20060119000175541300.2*?*F20060119000175569900.2*?*F2
             1                                                                                  D20060119000175538000.2
             1                                                                                  D20060119000175541300.2
             1                                                                                  D20060119000175569900.2
             1                                                                                  D20060119000183679900.2
             2                                                                                  E20060119000175538000.2
             2                                                                                  E20060119000175541300.2
             2                                                                                  E20060119000175569900.2
             2                                                                                  E20060119000183679900.2
             3                                                                                  F20060119000175538000.2
             3                                                                                  F20060119000175541300.2
             3                                                                                  F20060119000175569900.2
             3                                                                                  F20060119000183679900.2
    
    15 rows selected.
    
    SQL> delete from target_tab where varchar2_value is null;
    
    3 rows deleted.
    
    SQL> alter table target_tab drop column clob_value;
    
    Table altered.
    
    SQL> select * from target_tab;
    
        ITEMID VARCHAR2_VALUE
    ---------- ----------------------------------------------------------------------------------------------------------
             1 D20060119000175538000.2
             1 D20060119000175541300.2
             1 D20060119000175569900.2
             1 D20060119000183679900.2
             2 E20060119000175538000.2
             2 E20060119000175541300.2
             2 E20060119000175569900.2
             2 E20060119000183679900.2
             3 F20060119000175538000.2
             3 F20060119000175541300.2
             3 F20060119000175569900.2
             3 F20060119000183679900.2
    
    12 rows selected.
    
    SQL> 
    

    I also took your delimiter is ' *? *', so you may need to change this.

    See the documentation for the function TO_LOB: http://download.oracle.com/docs/cd/E11882_01/server.112/e10592/functions203.htm#SQLRF06134

  • What is the normal procedure for windows live support call and offer to fix errors on my computer?

    What is the normal procedure for "windows live support" to call and offer to fix errors on my computer?

    What is the normal procedure for "windows live support" to call and offer to fix errors on my computer?

    N° !!!
    Scam!
    Ignore and hang up. For the benefits of others looking for answers, please mark as answer suggestion if it solves your problem.

  • I took my computer to factory, when I redownloaded itunes all my music was not there, anyone know why?

    I took my computer to factory, when I re-downloaded iTunes all my music was not there, anyone know why?

    Have you created a backup of your library and other value prior to the factory data reset?  Your music is stored on your hard drive and accessible via the iTunes database - you must maintain, or be able to restore to recover your full library.  However:

    It is, unfortunately, no 'magic' here... except if you specifically configure to do this (which may involve purchasing services add-on) iTunes relies on you to maintain the integrity of your library - an effective backup strategyagainst data loss (as for anything else on your computer that you cannot afford to give up to) is essential.

  • Is it possible to restore your computer to factory without a backup requirements?

    I restored my computer using my sisters backup disks and I was just wondering.

    Hello

    In regards to what they actually do, there not much in it--a "Factory Reset" from the disk is normally faster than using recovery discs.

    The main advantage of having a set of recovery disks is that they will allow you to reinstall Windows 7, if the recovery Partition corrupted or the HARD drive had to be replaced.

    OEM recovery disks validate the installation by reading a "tattoo" on the bios chip, but as you know that your sisters drives work well on your machine, you can always create a duplicate for yourself the value as follows.

    Download and install the free software ImgBurn.

    1. create an Image file disc the 1st disc of recovery on your laptop - a guide for doing this is here.

    2 write this on a blank DVD Disk Image - a guide to it's here.

    3. Repeat for each subsequent until you have a complete set.

    Kind regards

    DP - K

  • Is it better to create a form for the 25 different forms?

    We have a Telco Application (in the form of 10g) which has about 200 forms that are called from the main menu. Off than 200 forms on * 25 * are forms of type 'upload file' (see below).

    http://www.freeimagehosting.NET/alg6q

    As you can see, it's small size. The feature is:
    *(a.) Select a text file (which includes tabular data) of the client computer.
    When the file is selected, it is also copied to a directory on the DB server machine. The file name displays the full path of the file in the client computer.
    * (b) * when the user press the load button, form calls a stored procedure that is packed. We create an EXTERNAL table mapped to the file in the directory db and read the contents of a temporary table in the comic book.
    * (c) * when the user press the Process button, the temporary table is read and our Telco tables are updated using these data.
    * (d) * you can view the records of error and the correct records discovered during treatment, with the option to view the file . This will display 2 Oracle reports.
    * (e) * you can delete the contents of the temporary table by using the option delete temporary .

    This story goes like this: our application is in the form of 10g. Now, we want to update this application Forms 11 g value. We met one of the problems was the FileUploader bean that we use in the forms above. This does not work in 11g. Solution has been found using WebUtil. Now, we must change all the 25 forms (obviously).


    Now here's the really important part: our managers feel that in the future also we may have to move to these 25 forms (due to problems/upgrades future with WebUtil and so on) and they want us to create a form for 25 forms. For example, in a form.

    (a.) we have a list box at the top where chooses to uses which upload function he wants.
    (b.), the file is selected (and then transferred to the DB directory).
    (c.) now when users click on the load button to execute the charge process packed for the selected workload file option.
    (d) when he pressed the Process button we need to run the program for the selected file download function unit.
    (e) when the user presses the button view the file, it should display the correct records and invalid records (found after treatment) 2 speed. The reports differ from a function to a function.
    (f) it can delete the records in the temporary table by using the Delete Temp button.

    Is it good idea? My first study tells me that it isn't a good idea since we have a form with too many features. What are the advantages and disadvantages of this approach and what is the best solution?

    Published by: user12240205 on June 25, 2012 01:16

    The code is not DUPLICATED. The code to load and process is completely different from form to form.

    Looks like the old method of copy-paste-adapt.
    But it surely is something all forms have in common, no? Even if the code is not duplicated the process is (select the file, download it, treat it, call a report, delete temporary data). Look at what needs to be done in general, create an API on that and let your forms to use this API. Ways to form stuff can be done via the user triggers, procedures referenced/copied, etc.. If I were you I would go back, look at the code and see how I can do an API.

    see you soon

  • Creating a backup for new 6s

    I needed a new 6 for personal use when my business is my current 6 s for work only. I backed up my new phone to my phone work on my Mac to save all my information, aps, etc that I have to delete my work phone aps personal, so I need now two different backups, but they are saved on the same device name.  How can I create a backup for my new phone, but all by keeping all the data?

    Each device that you are backing up to a computer via iTunes (or iCloud) will have a separate backup. It may be easier to tell apart them if you use a different name for each device in (on phones) settings > general > topic > name.

    You can check what backups that you have made to a computer via iTunes by clicking the iTunes Preferences and clicking on "Devices" in the top of the Preferences window. You can see all iCloud backups by (on your phone) going into settings > iCloud > storage > storage management.

  • What is the procedure for upgrading Thunderbird ESR 17.0.7 at 31.6 on Mac OSX 10.10.2?

    What is the procedure for upgrading from Thunderbird ESR 17.0.7 at 31.6 (last public version) on Mac OSX 10.10.2?

    Is it as simple as install new version and then run to see all local folders and my email and its folders from IMAP to my company as before the upgrade?

    Thank you

    Create a full backup of your Thunderbird profiles folder.
    Uninstall the old version of ESR.
    Download the latest version from https://www.mozilla.org/en-US/thunderbird/all.html and install it.

  • Reformat my computer to factory settings - HP Pavilion p6320a

    Hello

    Could you please help me how to reformat my computer to factory setting?  Here are the details:

    a. HPPavilion p6320a

    b. OS - Windows 7 Home 64 bit Penitum

    c. processor - Pentium (R) Dual Core

    Also is there a Posibility to convert/upgrade for Windows 8?

    I'm not a computer expert.  Kindly help me please.

    Thanks in advance.

    Ging

    Hello

    1. except if you have deleted the recovery partition on your machine, your machine must have a recovery partition. Make sure all your backup files before you restore the PC/laptop to the factory settings.

    To set your PC/laptop to the factory settings, restart the PC/laptop. At HP Home screen has reached repeatly F11 (or ESC) key to start the recovery process. Follow the instructions on the screen.

    2 my suggestion: keep Windows 7, you will not be disappointed with Windows 8. But if you want, Microsoft has a tool that resembles the Advisor Windows 7 to Windows 8 called Windows 8 Upgrade Wizard. Please download the wizard and run it on your computer:

    http://Windows.Microsoft.com/en-us/Windows-8/upgrade-to-Windows-8

    You must purchase the upgrade to Windows 8 Microsoft (download) or many computer stores (DVD).

    Kind regards.

  • Create an executable for a previous version of LabVIEW % 3F

    Title says it all.

    I have LabVIEW 2011 and my code is written using LabVIEW 2011. I know how to build an executable from my code in version 2011.

    I know how to save my code in version 2010. But I don't know how to create an executable for the 2010 version. I saw no option in

    the build process that I would create a 2010 executable. Once built, the executable must run on a computer with the runtime only 2010.

    Is this possible or do I have LabVIEW 2010 installed to create a 2010 executable?

    Just install the runtime of LV 2011 on the other PC.  A PC can have multiple versions of the Runtime installed.

  • Create a procedure SQL with SQL toolkit

    Hello

    I use the SQL Toolbox to get data from a MySQL database (using ODBC connectors).

    I would like to automatically create a procedure on my DB when lauching my application software, so that I do not know there is when I use it.

    But I can't figure out how to do with the SQL Toolbox.

    Indeed, you try to run this script (which works by operating on MySQL workbench) returns the following error:

    DELIMITER $$

    CREATE DEFINER='indus'@'%' PROCEDURE ' FPY'(datetime IN START_DATETIME, IN END_DATETIME datetime)
    BEGIN
    CREATE a temporary table ListingUUT
    (
    UUT_SERIAL_NUMBER VARCHAR (127).
    TEST_COUNTER INT,
    DateTime TEST_TIME,
    UUT_STATUS VARCHAR (32)
    );

    CREATE a temporary table Stat_FPY
    (
    TESTED INT,
    TESTED_ONCE INT,
    REPORT / FLOAT
    );

    INSERT INTO Stat_FPY VALUES (0,0,0).
    INSERT INTO ListingUUT
    (
    SELECT
    UUT_SERIAL_NUMBER, SUM (1), START_DATE_TIME, UUT_STATUS
    OF booster_results.uut_result
    WHERE START_DATE_TIME BETWEEN START_DATETIME AND END_DATETIME
    UUT_SERIAL_NUMBER GROUP
    ORDER BY DESC START_DATE_TIME
    )
    ;

    END

    -Online error-2147217900 took place at NI_Database_API.lvlib:Conn Execute.vi-> Untitled 1

    Possible reasons:
    ADO error: 0x80040E14
    Exception occurred in the Microsoft OLE DB provider for ODBC drivers: [MySQL] [ODBC 5.2.a Driver] [mysqld - 5.6.10 - log] you have an error in your syntax SQL; consult the manual for your version of the MySQL server for the right syntax to use near ' DELIMITER $$

    CREATE DEFINER='indus'@'%' PROCEDURE ' FPY '(IN START_DATETIME datet' à la ligne 1 en NI_Database_API.lvlib:Conn Execute.vi-> sans titre 1)

    An idea so that I can create the procedure?

    Finally, give up on the creation of the procedure with SQL Toolkit functions.

    In fact using exec.vi system to address directly the command-line mysql server...

Maybe you are looking for

  • 8.4 uConnect system & iOS 10 questions!

    Help! I have a Jeep Cherokee from 2016 and uConnect 8.4 (update to the latest firmware). Since I updated my phone to iOS 10, when connected via USB, my music didn't play through the stereo. Here is a break down of the issues: Audio is no longer play

  • Problems VeriStand 2011 RT and SCXI-1540

    Good afternoon As in the topic, we have problems with our card module SCXI-1540 that we use to acquire a mixed selection of RVDT and resolvers. Specifically, we have our facility on Veristand 2011 on a target of RT who has a device custom control map

  • PID inverso (enfriamiento)

    Normal 0 21 false false false MicrosoftInternetExplorer4 st1\:*{behavior:url(#ieooui)} / * Style Definitions * / table. MsoNormalTable {mso-style-name: "Tabla normal" "; mso-knew-rowband-size: 0; mso-knew-colband-size: 0; mso-style - noshow:yes; mso-

  • The controller is restarted PXI of MAX has stopped working

    I have a PXi-8196 controller in which regularly need to be restarted (will post another message on this subject).  For the last 8 months, I was able to restart using MAX from the link to remote systems.  Last week, this method no longer works.  The c

  • Money Plus Home edition is not sort my entries by date, more!

    I have money, who suddenly began to refuse to sort tickets by date.  I downloaded money House sunset Sun, but after installation I still only the files of old money.  What I am doing wrong? Thanks for any input