Multiple procedures to draft store

WARNING * I always try to learn Labview as much as I can through tutorials and various other modules. My coding can therefore still not very effective as it should.  WARNING *.

First of all, I'm using Labview 2014. My question is, if I can run several stored procedures with SQL VI I use? If this is not the case, how can I do? I do the following steps:

1. connect

2. connect

3 run a stored procedure

4. get the data string

5 close the connections.

I'm doing this cycle about 25 - 30 times, every 2-3 minutes. Stored procedures put about 30-60 seconds to run. I was wondering if I could do the following instead:

1. connect

2. connect

3 run all stored procedures

4. get all channels of data

5 close the connections.

If this is not the case, can advise you if there is a better way to do it?

A picture of what I currently work with is attached...

Thank you very much...

Move your connection and out of the case statement. Do it in your hand and pass the reference to the Subvi. If you use a state machine, the connection/login would be a condition called initially and then you would have a narrow State when you stop the VI.

Tags: NI Software

Similar Questions

  • creating multiple procedures at once

    When I try to create multiple procedures at once

    All procedures are stored in the first procedure


    When I run the following script:


    ------------------------------------------------------------------------------------
    create or replace
    PROCEDURE CREATE_ITEM
    (Type % items.item_id ITEM_id,
    ITEM_DESC items.item_description % TYPE,
    ITEM_COST items.item_cost % TYPE,
    ITEM_QUAN items.item_quantity % TYPE)
    AS

    BEGIN

    If (ITEM_QUAN > = 0)
    THEN

    insert into point values
    (upper (item_id) |) LPAD(seq_item_id.nextval, 4, '0'), upper (ITEM_DESC), ITEM_COST, ITEM_QUAN);

    DBMS_OUTPUT. PUT_LINE (ITEM_DESC |) 'has been saved');

    on the other
    DBMS_OUTPUT. Put_line ('quantity should be 0 or more!");
    end if;
    END CREATE_ITEM;


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

    CREATE OR REPLACE PROCEDURE CREATE_ORDER
    (customer_id customer.customer_id % TYPE)
    AS
    BEGIN
    insert into orders values
    (seq_order_id.nextval, 0, customer_id, sysdate, 1);
    END CREATE_ORDER;

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

    It creates the "CREATE_ITEM" procedure and store the entire script of...

    Is there a solution for this problem?


    concerning

    Hello

    Place a slash
    /
    between the two procedures on its own line.
    SQL * need it as well.

    Kind regards
    Dermot.
    SQL development team

  • Execute multiple procedures at the same time calls


    HI - does anyone know how run as many procedure calls in parallel without using DBMS_JOB and DBMS_SCHEDULER?  For some reason, we are not allowed to use this feature, so I have to find another way.

    Thank you

    Christine

    JustinCave wrote:

    Without knowing your version of Oracle or why prevents you from using the most obvious tools, it's hard to say.

    If you are on 11.2, you can use the package dbms_parallel_execute but which simply called dbms_scheduler under the covers.  And some restrictions on the use of dbms_scheduler would most likely also create problems for the use of any other approach which had about the same effect.

    Justin

    Unfortunately, according to the doco 11.2 to dbms_parallel_execute.

    To perform the pieces at the same time, the user must have CREATE JOB system privilege.

    A solution could be to move the multi-threading for outside of the database and use the multi-threads of something like Java or C capabilities. You can even do it using the command or a shell script, depending on your environment, but it could be a bit annoying. Overall, the simplest solution would be to convince that the DBA is to authorize the use of a feature standard and well understood by the database called the Planner, rather than circumvent their authority by using external multi-thread techniques.

    Concerning

    André

  • Calling multiple procedures

    Hi all

    I use Sql Developer and calling several procedure like this:

    Start multip (1,2); end;
    Start multip (3,2); end;
    Start multip (4.2); end;
    Start multip (5.2); end;

    and when I am trying to run this as one, treat this as a single block and not running.

    Tried that too... but still get an error.
    Start multip (1,2); end; \
    Start multip (3,2); end; \
    Start multip (4.2); end; \
    Start multip (5.2); end; \

    Please suggest what should be the syntax.

    Thank you
    VJ

    Run it as:

    begin
        multip(1,2);
        multip(3,2);
        multip(4,2);
        multip(5,2);
    end;
    

    SY.

  • Mergeing multiple procedures in one package?

    Hello gurus,


    I m moving data from a diagram i, e la source (SRC) schema to the schema an another i, e target (trg) table, only selected columns of a few tables (i, e for 4 tables)


    I m, writing procedures to achieve and maintain this procedure a planner on a daily basis to load



    I m 4 procedures of writing for each of the table... is the procedure that I got
     
    
       create or replace procedure mov_tbl1
       is 
        cursor tbl1_cur as
          select  src.col1,
                     src.col2,
                     src.col3,
                     src.col4
             from source.tbl1 src
              where col1 = ' xyz'
           
        tbl1_cur_rec   tbl1_cur%rowtype;
            
          begin 
                for  tbl1_cur_rec  in tbl1_cur
                loop 
                    insert into tgt.tabl1(col1,col2,col3,col4)
                          values (   tbl1_cur_rec.col1,
                   tbl1_cur_reccol2,
                   tbl1_cur_rec.col3,
                   tbl1_cur_rec.col4);
                         commit
                      exception 
                         when others then 
                            rollback;
                  end loop;
          end;
    
       ---for table 2
    create or replace procedure mov_tbl2
       is 
        cursor tbl2_cur as
          select  src.col1,
                     src.col2,
                     src.col3,
                     src.col4
             from source.tbl2 src
              where col3 = ' abc'
           
        tbl2_cur_rec   tbl2_cur%rowtype;
            
          begin 
                for  tbl2_cur_rec  in tbl2_cur
                loop 
                    insert into tgt.table2(col1,col2,col3,col4)
                          values (   tbl2_cur_rec.col1,
                   tbl2_cur_reccol2,
                   tbl2_cur_rec.col3,
                   tbl2_cur_rec.col4);
                         commit
                      exception 
                         when others then 
                            rollback;
                  end loop;
          end;
    
       
    same procedures for table 3 and table 4...

    Here's my question...
      
    
    1.How can i build a single package for all these four procedures in one package ???
    2. ANd i don't want to call each procedure every time ...so can i do it by passing parameters ???  how can i accomplish that ??
    
     
    I m back to writing packets... all help is greatly appreciated... Thank you so much gurus!

    First your code does not compile because the exception block is inside the loop while begin and end are on the outside.
    You must decide whether a row error should invalidate the full load or if the wrong single line must be rejected, but all other lines have been downloaded.
    I guess you need that last so I change the code as follows:

    create or replace procedure mov_tbl1
       is
        cursor tbl1_cur as
          select  src.col1,
                     src.col2,
                     src.col3,
                     src.col4
             from source.tbl1 src
              where col1 = ' xyz'
           -- the record variable declaration is implicit in FOR LOOP
          begin
                for  tbl1_cur_rec  in tbl1_cur
                loop
                  begin
                    insert into tgt.tabl1(col1,col2,col3,col4)
                          values (   tbl1_cur_rec.col1,
                   tbl1_cur_reccol2,
                   tbl1_cur_rec.col3,
                   tbl1_cur_rec.col4);
                         -- REMOVED COMMIT, Commit outside or at the end.
                      exception
                         when others then
                           null; -- May be is better to (somehow) log the error ...
                  end;
                end loop;
          end;
    

    On the package, create you it in this way:

    create or replace package p is
    procedure upd (tab1 in boolean, tab2 in boolean, tab3 in boolean, tab4 in boolean);
    end;
    /
    
    create or replace package p is
    procedure upd (tab1 in boolean, tab2 in boolean, tab3 in boolean, tab4 in boolean) is
    begin
      if tab1=true then
         mov_tbl1;
      end if;
    
      if tab2=true then
         mov_tbl2;
      end if;
    
      if tab2=true then
         mov_tbl2;
      end if;
    
      if tab2=true then
         mov_tbl2;
      end if;
    end;
    
    procedure mov_tbl1   is
        cursor tbl1_cur as
          select  src.col1,
                     src.col2,
                     src.col3,
                     src.col4
             from source.tbl1 src
              where col1 = ' xyz'
           -- the record variable declaration is implicit in FOR LOOP
          begin
                for  tbl1_cur_rec  in tbl1_cur
                loop
                  begin
                    insert into tgt.tabl1(col1,col2,col3,col4)
                          values (   tbl1_cur_rec.col1,
                   tbl1_cur_reccol2,
                   tbl1_cur_rec.col3,
                   tbl1_cur_rec.col4);
                         -- REMOVED COMMIT, Commit outside or at the end.
                      exception
                         when others then
                           null; -- May be is better to (somehow) log the error ...
                  end;
                end loop;
          end;
    
    procedure mov_tbl2   is ...
    
    procedure mov_tbl3   is ...
    
    procedure mov_tbl4   is ...
    
    end;
    /
    

    You can call the procedure upd (calling others) this way:

    begin
      p.upd(true,false,true,false);
    end;
    /
    

    Update only table1 and table3.

    Max
    http://oracleitalia.WordPress.com

  • How to run a stored procedure by using the steps in database?

    Hello

    I'm trying to run some procedures of the store and it will not work.

    See the file attached is seq.

    I have a varchar parameter (50), which must also be provided to the stored procedure and it returns an int.

    To do this I had to only use data in an open statement

  • Different VM 1 with 3 vmdk in the data store: Migration of data to rename store

    Hello

    I'm here today to ask for your help please.

    In our Organization, we have 1 large VM

    1 vmdk = > The BONES in lun, SAS performance

    1 vmdka = > 1 Tera SATA MON only of DATA

    Another 1 vmdka = > 1 Tera SATA MON only of DATA

    This virtual machine is being tested and we need to rename it to the name of the production.

    When you rename in vcenter you do a data store migration to correct all files with the new name.

    In this case, how can we specify each VMDK to go to the data store specified during migration?

    Because we could all think in the same data store due to the limitation of 2Tera by a data store

    Thanks for your help

    When you "migrate" a virtual machine and choose 'Change Datastore' use the advanced option. This will allow you to specify multiple destinations of data store. Use the drop-down arrow in the current [location].

  • Create a form based on the procedure

    Hi all

    I am creating a form based on the procedure, but when I entered the name of stored procedure, I got this error:
    Specified procedure could not be found, please choose a procedure name valid store.

    965628 wrote:
    My procedure is in a package.

    How can I prepend package name?

    Like this

    your_package_name.your_procedure_name(parameters);
    
  • relational to XML, multiple relationships, 11g

    I use 11g. I implemented the following query to extract data from 3 relational tables in XML
    select
        XMLELEMENT("PATIENT", XMLATTRIBUTES(D.PATID AS "PATID", D.DEMOGDATAVRSN AS "DEMOGVRSN", D.PARTICID AS "PARTICID"),
            XMLFOREST(D.PARTICID,D.DOB,D.GENDER,D.PATFNAME,D.PATLNAME,D.SSN,
                XMLFOREST(O.RECORDID,O.DATAVRSN,O.AGE,O.UPIN,O.SURGEON,O.ADMITDT,O.SURGDT, O.CATEGORY, 
                        XMLFOREST(P.ORGSYS,P.PROC,P.PRIMARY) 
                AS "PROCEDURES") 
            AS "OPERATIONS")) 
        AS "RESULT"
    FROM DEMOGRAPHICS D
    LEFT JOIN OPERATIONS O ON D.PATID = O.PATID
    LEFT JOIN PROCEDURES P ON O.RECORDID = P.RECORDID
    WHERE D.SSN IS NOT NULL AND ROWNUM <= 100
    ORDER BY D.PATID
    How do I change this so instead of getting a whole node of the patient for each intervention, I get a single patient with several operations and multiple procedures within these operations? Is this possible?

    Thank you!
    Eva

    Is this possible?

    Yes:

    select
        XMLELEMENT("PATIENT",
                   XMLATTRIBUTES(D.PATID AS "PATID", D.DEMOGDATAVRSN AS "DEMOGVRSN", D.PARTICID AS "PARTICID"),
                   select XMLAGG(XMLELEMENT("PROCEDURES",
                                            XMLFOREST(D.PARTICID,
                                                      D.DOB,
                                                      D.GENDER,
                                                      D.PATFNAME,
                                                      D.PATLNAME,
                                                      D.SSN,
                                                      XMLELEMENT("OPERATIONS",
                                                                 (select XMLAGG(XMLFOREST(O.RECORDID,
                                                                                          O.DATAVRSN,
                                                                                          O.AGE,
                                                                                          O.UPIN,
                                                                                          O.SURGEON,
                                                                                          O.ADMITDT,
                                                                                          O.SURGDT,
                                                                                          O.CATEGORY,
                                                                                          XMLFOREST(P.ORGSYS,
                                                                                                    P.PROC,
                                                                                                    P.PRIMARY) AS "PROCEDURES"
                                                                                          )
                                                                                 )
                                                                    from OPERATIONS O LEFT JOIN PROCEDURES P ON O.RECORDID = P.RECORDID
                                                                   where D.PATID = O.PATID
                                                                  )
                                                                 )
                                                      )
                                            )
                                 )
                   ) AS "RESULT"
    FROM DEMOGRAPHICS D
    WHERE D.SSN IS NOT NULL AND ROWNUM <= 100
    ORDER BY D.PATID
    

    Not tested, so handle with care ;)

    Max
    [My Italian blog Oracle | http://oracleitalia.wordpress.com/2010/01/10/crittografia-in-plsql-utilizzando-dbms_crypto/]

  • Last Podcast not picked up

    I have published two podcats who were picked up fine and who are in the directory of podcast itunes (https://itunes.apple.com/us/podcast/my-big-fat-bloody-mary-podcast/id1116493218 ) but the episode #3 is not added. Other directories, such as Stitcher and coil have picked up.  Here's the feed: http://mybigfatbloodymary.com/feed/podcast/ please advise. Thank you

    It is not unusual that she did not appear again (this is when you subscribe to iTunes). It is not even 24 hours since it was sent. Because of the multiplicity podcasts in the store (in thousands), the store caches the flow and it checks updates periodically. For this reason, there are usually 1-2 days for new episodes to appear in the store: sometimes it can be lower, and sometimes the whole process seems stuck and it may take several days. It should appear in the next day or so.

  • Toshiba Portugal

    Good afternoon

    I live in the municipality of Sintra, 26/12/2006 bought at Media Markt of Sintra, a Toshiba laptop computer.

    I in April 2010 was a malfunction with the laptop and I went to Media Markt in Sintra.
    Media Markt in Sintra told me a few months ago will receive computers (both were under warranty or not) and sent to Toshiba. But do not now receive computers (with no warranty or guarantee) because Toshiba has changed its procedures. I have two years (more correctly em18-02-2008) had a failure in the CD player and a laptop, I went to Media Markt of Sintra and they remained with laptop and had to organize.

    The 14/04/2010 as it had damaged the computer should now go to authorized Service Toshiba - large Quinta (AV 30 days Urb Quinta Grande Quinta Grande - Alfragide Amadora 2610-161 - Portugal).

    I sent several e-mail to Media Markt to the Portugal Sintra two to Toshiba. And said Media Markt Sintra finished with services because she had changed procedures to Toshiba and Toshiba to the Portugal said it was decided that the Media Markt end with these procedures.

    Point 1) I want the above mentioned situation is clarified. For this I ask you to read the below email and draw your conclusions.
    Point 2) I wonder why the district of Lisbon it is only the authorized Service centers in the municipality of Lisbon and Amadora municipality? The rest of the district has no importance? For example those who cannot travel to Lisbon and Amadora cannot repair your laptop to a Service Center? In a neighborhood with a high population density in the Lisbon District think that Toshiba has more than an authorized Service Center.
    Point 3) I suggest you open a Service Center authorized in the municipality of Sintra.
    Point 4) I wonder why Toshiba Portugal and Service Center authorized Quinta Grande do not have a provider of the customer? I suggest that you create the figure of the Ombudsman. Or you do not seek the opinions of the customers / consumers?
    Point 5) I think that the site and the site http://www.toshiba.pt/ http://www.quintagrande.com/ must be a space where customers can leave their complaints and suggestions.
    Point 6) Toshiba Portugal has the phone number 707 265 265. I called this number and had a lot of time waiting to be served. There was also a Friday, I tried calling several times this number and simply gave an error, it was as if this number does not exist. Toshiba will advise Portugal to improve this service.
    Point 7) I think that the site and the site http://www.toshiba.pt/ http://www.quintagrande.com/ that there should be a small card with the location Quinta Grande authorized Service centers so that customer service can cope better.

    E-mail:

    June 3, 2010 Media Markt Sintra has sent the following e-mail:
    "Good afternoon Mr. James Adams,
    Thank you for choosing this method of contact.
    Who send a Toshiba brand equipment for repair are not possible in our services, required by the manufacturer.
    If the 24-month warranty period should be the final customer to request the service through Toshiba 707 265 265 assistance line. "

    Toshiba June 15 has sent the following e-mail:
    "Caro b James Adams
    Please contact Toshiba. Your ticket is [# 70136558].
    As explained above, Toshiba has nothing to do with the stores procedures. If the stores receive no or machines, is a procedure of the store and not Toshiba.
    Also shows it in what situations is a technician at Toshiba a customer site: only when we bought the equipment with on-site assistance extended warranty. There is no service to the Toshiba which are charged 15 for a technician to the customer's home.
    Toshiba has no store. Toshiba has an authorized Service Center. These centres are defined in http://www.toshiba.pt/assistencia.
    All our services have been clarified and the guarantee conditions in their manual and on our Web site.
    Details on store procedures that States must be provided by store and by Toshiba, then you should refer your questions to them.
    Concerning
    Reis João Cerveira

    June 16, 2010, Media Markt Sintra sent the e-mail:
    "Good night, Mr. James Adams,
    In response to your question that, since April 1, 2009, with respect to technical assistance services, TOSHIBA has made available through its CAT - Toshiba Service Center, a system of support, collect-and-delivery or assistance take place in case of failure, that they plan to be used by all users regardless of the place and the date of purchase. The purpose of these needs directly, assume full responsibility for after-sales service, minimizing the costs of time and support and the repair of all equipment of the TOSHIBA brand.
    Interventions inside and outside the warranty period is always the possibility of being sued in the present, or any other group of store, with the final customer to bear the costs of the mediation and transport of this particular store is worth 50, it plus any expenses provided for by the manufacturer.
    We are available for more details
    Best regards.
    Miguel Horta
    Customer Service / Customer Support. "

    06/29/2010 Media Markt Sintra has sent the following e-mail:
    Hello
    The suggestion / decision was part of the brand and not the store.
    Sincerely,
    Rita March
    After sales service / Technical Support

    Note: After reading the notice by e-mail that sends a Toshiba brand equipment for repair are not possible in the offices of Media Markt, on the instructions of the manufacturer. If it isn't true, I ask for this shipment of Toshiba for me and the Media Mark Sintra, irrefutable evidence that it is a lie.

    I hope I can give references to this e-mail. I hope that these complaints and these suggestions aren't in the drawer.
    Sincerely, James Adams.

    A FEW FACTS:
    Media Markt to Sintra?
    Site: http://www.mediamarkt.pt/
    E-mail: @ saturn.com media - mm.info.sintra
    Address: Sintra Retail Park - Shop 4 - very high 2635-047 Rio de Mouro - Portugal
    Phone: (351) 210 098 100, (351) 210 098 171 / 3 / 4, Fax: (351) 210 098 119, 210 098 169 (351)

    Toshiba Portugal?
    Site: http://www.toshiba.pt/
    E-mail: [email protected], [email protected], [email protected]
    Address: Building of the Park of the Lakes 1 - Piso 3 2740-264 Porto Salvo

    Quinta? Large
    Site: http://www.quintagrande.com/
    E-mail: [email protected]

    Hello

    I m not the Portugal, so I can't say anything about your problem
    But I had a problem with my laptop in the past and the ASP in my country has been very useful and could help me the laptop fixed me and guaranteed covered everything.

    I'm happy with Toshiba ASP and how my business was managed in the past.

    Good luck to you...

  • TestStand database error - error converting data from nchar int type.

    Hello

    I used SQL standards database stored procedure options to store records of my test and I added the generated tables and stored procedures in a database and it seems to work OK in this form. However when I change the UUT_Results table to include a new column that contains the value of the primary key of another table in the database that I meet problems.

    I run a query that returns the primary key value (integer) for a given series number and stores the result as a global station (number format). The correct value is stored in the variable, but when I try to use this value in the stored procedure I get an error like below:

    An error occurred calling "LogResults" in "ITSDBLog" of "ZNIUGOL TestStand database logging"
    An error has occurred by executing a statement.
    Schema: SQL Server Stored Proc (NOR)
    Statement: UUT_RESULT.
    Description: Error converting data from nchar int type.
    Number:-2147217913
    NativeError: 8114
    SQLState: 22018
    Reported by: provider Microsoft OLE DB for SQL Server

    Source: TSDBLog

    My SQL statement for creating the table and the procedure for UUT_results are below:

    ~
    CREATE TABLE UUT_RESULT)
    Uniqueidentifier PRIMARY KEY ID,
    BoardDetailID int,
    STATION_ID varchar (255),
    BATCH_SERIAL_NUMBER varchar (255),
    TEST_SOCKET_INDEX int,
    UUT_SERIAL_NUMBER varchar (255),
    USER_LOGIN_NAME varchar (255),
    START_DATE_TIME is datetime,
    EXECUTION_TIME float,
    UUT_STATUS varchar (32),
    UUT_ERROR_CODE int,
    UUT_ERROR_MESSAGE varchar (255)
    CONSTRAINT UUT_RESULT_FK FOREIGN KEY (BoardDetailID) made REFERENCE BoardDetails)

    ~
    CREATE PROCEDURE InsertUUTRESULT
    @pID uniqueidentifier,
    @pBoardDetailID int,
    @pSTATION_ID varchar (255),
    @pBATCH_SERIAL_NUMBER varchar (255),
    @pTEST_SOCKET_INDEX int,
    @pUUT_SERIAL_NUMBER varchar (255),
    @pUSER_LOGIN_NAME varchar (255),
    DateTime @pSTART_DATE_TIME.
    float of @pEXECUTION_TIME.
    @pUUT_STATUS varchar (32),
    @pUUT_ERROR_CODE int,
    @pUUT_ERROR_MESSAGE varchar (255)
    AS
    INSERT INTO UUT_RESULT (ID, BoardDetailID, STATION_ID, BATCH_SERIAL_NUMBER, TEST_SOCKET_INDEX, UUT_SERIAL_NUMBER, USER_LOGIN_NAME, START_DATE_TIME, EXECUTION_TIME, UUT_STATUS, UUT_ERROR_CODE, UUT_ERROR_MESSAGE)
    VALUES)
    @pID,
    @pBoardDetailID,
    @pSTATION_ID,.
    @pBATCH_SERIAL_NUMBER,.
    @pTEST_SOCKET_INDEX,.
    @pUUT_SERIAL_NUMBER,.
    @pUSER_LOGIN_NAME,.
    @pSTART_DATE_TIME,.
    @pEXECUTION_TIME,.
    @pUUT_STATUS,.
    @pUUT_ERROR_CODE,.
    @pUUT_ERROR_MESSAGE)

    Any help would be appreciated,

    Thank you

    Stuart

    Stuart-

    What is the expression you are evaluating and the data type of the parameter that you defined in the Options database dialog box for the schema that you connect to data with?

  • Old reminders of Security Essentials

    Whenever I start up I get a reminder of security I have files waiting to be burned to a disc from a previous session. That session ended when I filled the disk, tried to label a new file and could not because the disk is full.  It was more than a week ago. Now, whenever I start, if I have a game there disc or a program disk, he's trying to write this unsuccessful file on what that is the disk is in the drive and it keeps harassing me on this subject.

    I thought about it.  It's reminding me even when he wasn't a disc in there, so I just removed it.   Pouf!  gone forever!  It's as simple as that.  I could I kick for not to think about!    It wasn't Security Essentials, it was the disc CD-DVD icon in the system tray which took a step aside dance started and who cheated me into thinking it was safe. Thanks in any case.

    I'll copy your procedure above and store for later use in case I met a bigger problem later.  You never know.

    Thanks again.

  • The addition of '\n' to a specific position in the LONG Variable

    Hello

    I have a requirement where I will read the file and it will contain a field with a data LENGTH. I'm assigning this value in a long Variable. I know that LONG is outdated, but I need to live with it now that there are a lot of changes in multiple procedures.

    Requirement is
    1. the value will be length approximately 8000 characters.

    2. I need to read the value and add a '\n' in every 79th position

    For example, in the 79th, 158th, 237th positions and so on for each 79th position.

    Please help with a solution to achieve this.

    Please let me know for any question about the requirement.

    As mentioned Blu, SQL LONG is obsolete, but it looks like you are using a long Variable. Therefore, specify here. If I understand right, read you file in PL/SQL in the LONG PL/SQL variable (which is nothing but VARCHAR2(32760) ) and then insert into the column. There is no direct relationship between the LONG SQL and PL/SQL LONG, so you can use the VARCHAR2 variable. In addition, you must specify \n. You literally mean \n or \n say CRLF? I'll assume that CRLF:

    SQL > create table tbl (long l);

    Table created.

    SQL > declare
    v_str 2 varchar2 (32760);
    3. start
    4 v_str: = ' I have a requirement where I'll read the file and it will contain a field with a data LENGTH. I'm assigning this value in a long Variable. I know that LONG is outdated, but I need to live with it now that there are a lot of changes in multiple procedures. » ;
    5. Insert
    6 in tbl
    7 values)
    8 regexp_replace (v_str,'(.{78}) ',' \1' |) Chr (13) | 10
    9              );
    10 end;
    11.

    PL/SQL procedure successfully completed.

    SQL > set 1000 long
    SQL > select *.
    2 tbl
    3.

    L
    --------------------------------------------------------------------------------
    I have a requirement where I will read the file and it will contain a field ha
    ving a BIG data. I'm assigning this value in a long Variable. I know that
    LONG is outdated, but I need to live with it now that there are a lot of cha
    NGES in several procedures.

    SQL >

    SY.

  • Raises an exception if the cursor failed

    Hi, how can I write an exception if a cursor was unable to retrieve the values in the variable? for example, I have 10 cursors in procedures from my store and I want if this cursor was not able to process then threw an exception. For example, code below, if the recovery process could not then triggered an error message like "failure on cursor c_get_card_dependencies.

    OPEN c_get_card_dependencies (v_POTENTIAL_CARDS.iv_sysid, v_POTENTIAL_CARDS.plp_log_pos_type);

    LOOP

    SEEK c_get_card_dependencies INTO v_CARD_DEPENDENCIES;

    EXIT WHEN c_get_card_dependencies % notfound;

    DBMS_OUTPUT. Put_line (LPAD ('SYS ID: ', LENGTH ('SYS ID: "") + 2' ') |) v_CARD_DEPENDENCIES.sysid);

    END LOOP;

    CLOSE C_get_card_dependencies;

    Put your OPEN... CLOSE in a BEGIN... END of block. Then, you can catch the exceptions for each cursor and raising your own exception

    BEGIN

    XY OPEN;

    ...

    NARROW xy;

    EXCEPTION

    WHEN VALUE_ERROR THEN

    raise_application_error (-20001, "failed on the xy cursor: ' |") SQLERRM, TRUE);

    END;

Maybe you are looking for