Question about error-handling in PL/SQL

Hi friends,
I would like to know if there is a way for error handling for insert and update statements in PL/SQL???
Like when for example an insert fails!
thanxx
Schoeib

You should get a book about such fundamentals!
This is not an online course...
begin
  insert into emp values(...);
exception
  when no_data_found then
  when others then
end;

Similar Messages

  • General QUestion about error handling

    Hello,
       I am writing my own VI's to communicate with my hardware. Each one of the VI's incorporate numerous error checking routines to detect if the desired operation completed correctly. If error(s) are detected with a VI, the "Bundle by Name" VI is used to update the Natiinal Instruments error cluster with the appropriate info each time a error occurs.
      What I am finding is that the VI error cluster contains the last error found, instead of the first error found. Please be aware that I am assuming (we know what that stands for) is that the National Instruments error cluster is accumulative, so if I add four errors to the cluster, then the error cluster contains at least four errors.
      So how do I find the first error that was entered into the error cluster. I have found a vi called "Find First Error:, but I am confused (as usual) on how to get what I want. So I am asking for "divine guidance" or a kick in behind from the Labview wizards on how to correctly handle errors.
     Regards,
    Kaspar
    Regards,
    Kaspar

    The cluster is a standard cluster and is not accumulative.
    Usually, the way to handle this is to check the error in terminal and if it is has an error to pass the error instead of executing the code. That way, when you have an error, the rest of the code does not execute. Here's an example:
    If you want to merge the error numbers, search the forums for Mike Porter's error stacker.
    Try to take over the world!

  • Please brief Describes about error handling with example

    dear
    please describe about error handling and exception handling

    Darryl Burke wrote:
    This is the third thread you have started here, without bothering to reply to responses on the two earlier threads. Not the best way to continue to get help on a forum, that.Not to mention the fact that it's a horribly broad and vague question that is better answered by a combination of books, tutorials, and google searches.

  • Error Handling in the SQL Trigger 2008 R2

    Hi ,
    I need some guidance in setting up error handling process in the table  trigger. I have created a trigger on source database table and it load data to target table whenever there are any changes in last update date of source database ( given code below).
    Problem : sometime I am getting error message ( like unique Index , data length mismatch etc) and my trigger don’t work and rollback the entire transaction.  
    Requirement : If there is an error with the insertion, I would like to move that error-inducing record into an error table  .  Any guidance much appreciate.  thanks!
    /****** Object:  Trigger Defination     ******/
    USE [MPSAIntegration]
    GO
    SET
    ANSI_NULLS ON
    GO
    SET
    QUOTED_IDENTIFIER ON
    GO
    /*Description:    Trigger to insert Asset details into Siebel Table*/
    ALTER
    TRIGGER [dbo].[trg_INS_INTO_CX_PRODPROF_STG]
    ON  [MPSAIntegration].[dbo].[CustomerProductLines]
    AFTER INSERT,UPDATE
    AS
    /****** Get the current Timestamp,Max of SR_NUM from Target table and LastRun time from dbo.TIME ******/
    DECLARE @currtime
    DATETIME,
    @SR_NUM
    INT,
    @Last_Run
    DATETIME
    SELECT @currtime
    = (SELECT
    CURRENT_TIMESTAMP)
    SELECT @SR_NUM
    = (select
    max(Sr_Num)
    from dbo.SerialNum
    WHERE Entity='PROD')
    SELECT @Last_Run
    = (SELECT LastRun
    from [MPSAIntegration].[dbo].[TIME]
    where ENTITY =
    'PROD')
    BEGIN
    SET
    NOCOUNT ON;
    SET
    XACT_ABORT ON;
    /***** Update dbo.SerialNum Table *****/
    UPDATE dbo.SerialNum
    SET Sr_Num = @SR_NUM+1
    where Entity='PROD';
    /***** Insert into [dbo].[CX_PRODPROF_STG] table *****/
    INSERT
    INTO [ntscrmdbdev].[SiebelDB].[dbo].[CX_PRODPROF_STG]
    ([ROW_ID]
    ,[CREATED]
    ,[CREATED_BY]
    ,[LAST_UPD]
    ,[LAST_UPD_BY]
    ,[MODIFICATION_NUM]
    ,[CONFLICT_ID]
    ,[LOAD_STATUS]
    ,[SR_NUM]
    ,[INFO_CAPTURE_DATE]
    ,[ADDRESS_NAME]
    ,[CUSTOMER_CODE]
    ,[DESCRIPTION]
    ,[PRODUCT]
    ,[SERVER_NAME]
    ,[STATUS]
    ,[CANCEL_DATE],
          [SEQUENCE_ID])
    SELECT
    CAST(CUSTOMERCODE
    AS NVARCHAR(8))+CAST(@SR_NUM
    AS NVARCHAR(7))
    ,Current_Timestamp
    ,'dbo'
    ,Current_Timestamp
    ,Current_User
    ,0
    ,'N'
    ,'Not Processed'
    ,CAST(@SR_NUM
    AS NVARCHAR(15))
    ,InfoCaptureDate
    ,(SELECT CUST.CUSTOMERNAME
    FROM CUSTOMERS CUST where CUST.CustomerCode
    = I.CustomerCode)
    ,CustomerCode
    ,ProductLine
    ,ProductLine
    ,ServerName
    ,'ACTIVE'
    ,TerminationDate
    ,1
    FROM INSERTED I
    /****** Update the LastRun in dbo.TIME ******/
    UPDATE [MPSAIntegration].[dbo].[TIME]
    SET LastRun
    = @currtime
    WHERE ENTITY
    = 'PROD';
    END

    The first choice is stored procedure. Trigger should be last resort.
    Related links:
    http://stackoverflow.com/questions/884334/tsql-try-catch-transaction-in-trigger
    http://www.sqlservercentral.com/Forums/Topic1499938-3077-1.aspx
    http://www.sommarskog.se/error-handling-I.html
    http://www.codemag.com/Article/0305111
    Kalman Toth Database & OLAP Architect
    SQL Server 2014 Database Design
    New Book / Kindle: Beginner Database Design & SQL Programming Using Microsoft SQL Server 2014

  • Answer to question about "Error Occurring when convertion is tried for PDF to Word Document"

    There are about ten questions about the "Error Occurring" when  using Abode Reader XLto convert a PDF to a Word Doc, but no one has the answer? It has something to do with "signing in  the wrong address". I have been working on this three days Now! Soimeone has the answer? Cataloochee

    You must be kidding to say, "Adobe doesn't convert any version of Adobe Reader."'  I must be in another world! When i move an Adobe Reader file pdf that goes to a wIndow that the top line says,'' Adobe reader X1 1001 Early Dutch History. pdf ". Then i click on the far left yellow marked icon that is used to move 1001 Early Dutch History.pdf to thye far right into a gray colored slot that reads "1001 Early Dutch History.pdf'. Under the file above  or down below, the selected File for conversionis, a selection gray slot that ask if you want to convert this file(pdf) to a .docx.,.doc, tex. or Excell. After I make the selection and click onto Convert, a message comes into view where the word convert was that reads "An Error Occurred wilth Signing In  OK" Even the use of another pdf file with a complete different address produces the same message. There are eight chapters in Dutch that I need to convert to word document by tommorrow or the class i teach "the Origin of Golf" will have to listen in Dutch and I can't speak Dutch. Cataloochee

  • About Error Handling.

    Hi,
            Can any body give the brief idea of error handling.And what the option containing in the error handling tabs like
    1. NO Update , No Reporting.
    2. Update Valid Records only ,Reporting not possible(Request red).
    3. Update Valid Records only ,Reporting  possible(Request green).
              Is these options works above the error tolerance limit or below the error tolerance limit.
          like        Error Tolerance Limit   =   1000.
    How can i Test it  practically in Navigation.Plz send the detailed information about this.
    Thanks in Advance,
    D.Malla Reddy.

    Hi,
         1 Valid Records Update, No Reporting (Request Red): When you select this option, you tell the system to isolate erroneous records in a data packet from the data load and to load the valid records into the data target. The data upload request remains in red status in the data target and is unavailable for reporting. With this option, the data administrator can check the error records and then manually turn the uploaded request to green, making the data available for reporting.
    u2022     2 Valid Records Update, Reporting Possible (Request Green): When you select this option, you tell ETL to make the valid data available immediately for reporting in the data target.
    u2022     No Update, No Reporting: When you select this option, you tell the system to suspend data processing to the data targets if it encounters an erroneous record, preventing further data from loading into the data target. The system keeps scanning the remaining data packages for erroneous records.
    Another important aspect of error handling is the process to deal with the erroneous records. In SAP NetWeaver BI 7.0, the error handling process identifies the erroneous record from the original data upload request and isolates it by storing the records in a separate container called the error stack. After you correct or modify the erroneous records, you can then load them to the original intended data target by using a special DTP called the error DTP. This helps to ensure data consistency.
    you can check the data packets data at monitor
    Thanks
    Ramesh.
    Edited by: Ramesh Raju on Feb 11, 2010 2:24 PM

  • Questions about errors

    These are my latest HH3a stats after a DLM resynch - part of an ongoing battle with it over the SNR
    Connection Information
    Line state:
    Connected
    Connection time:
    2 days, 03:05:42
    Downstream:
    6.711 Mbps
    Upstream:
    888.9 Kbps
    ADSL Settings
    VPI/VCI:
    0/38
    Type:
    PPPoA
    Modulation:
    G.992.5 Annex A
    Latency type:
    Interleaved
    Noise margin (Down/Up):
    5.1 dB / 8.3 dB
    Line attenuation (Down/Up):
    44.1 dB / 26.0 dB
    Output power (Down/Up):
    20.0 dBm / 12.6 dBm
    FEC Events (Down/Up):
    324989772 / 315
    CRC Events (Down/Up):
    761667 / 0
    Loss of Framing (Local/Remote):
    0 / 0
    Loss of Signal (Local/Remote):
    0 / 0
    Loss of Power (Local/Remote):
    0 / 0
    HEC Events (Down/Up):
    7393116 / 2
    Error Seconds (Local/Remote):
    31313 / 1
    IP is 6.06 and speed 5.92.
    The errors an hour after the resynch were  CRC 702269  HEC 6925930  Secs 28828
    What I want to know/understand is why the errors were so high after the resynch and why am I currently still able to get the speed I can as in the past errors less than half the total shown have completely throttled the line.
    FYI this is a follow on from this thread  http://community.bt.com/t5/BB-Speed-Connection-Issues/Low-Noise-high-errors-again/td-p/734960
    Solved!
    Go to Solution.

    It's not an easy question to answer ... but this may give you an insight.
    Sync is acheived by the msan sending a series of tones down the line to the modem, and according to the acknowledgements, the modulation standard is set. The loop loss is measured electronically and according to same, the amount of SNR (not SNRm) is used to set power factors so that the dslam can transmit the databits over the frequencies for the tones that were accepted. Some tones and thus frequencies will have been lost, as the line can't sustain them, because of either outside influences or mere line length. Once the SNR and power is set, the dslam will apply a buffer which is normally target margin (6db) (can be 3db on DSL2 running a special algo at the msan control).
    Once all these parameters are set the line will attempt to transmit data putting analog information into digital virtual buckets to transmit down the wire.
    If any of the databits are destroyed in total, or the majority of the packet is useless, a cyclic checksum will command a resend of that packet. If the packets are fairly good, and transmittable, they will go but will be checked and error corrected by a soft block code algorithm using RS codewords to fix the packet, these don;t get resent merely fixed.
    If the line is having a bad day, the errors may rack up and quickly, so the modem has the capability to drop the connection if it sees multiple second counts whereby the entire payload was corrupted, but it won't do it until a threshold (count) is breached.
    Lines change all the time, and at different times of day, as for example impulse noise increases at night owing to external influences, street lamp radiation, radio frequencies etc. and this is normally absorbed by the margin of the SNR, or put another way the noise margin. If databit transmission becomes difficult the MSAN control can increase the margin to enable the linedata to be "heard"... at the cost of linespeed.
    To get back to your original point about error rates .... if your line sees high CRC checks (and resends) high HECS , header corrections ... it will absorb high levels of bandwidth and reduced throughput will ensue.
    With FEC high figures simply shows interleave and block error correction is working, and it is demonstrating the rate of bits that are acknowledged as repaired. All lines will see some, and some more than others. The better the line and quality of the path, the less errors will be seen.
    The DSL also has a further trick up its sleeve. If certain frequencies can't be used when negotiation takes place, it has the ability to swap databits from one virtual bucket to another bit-free part of the spectrum, that isn't being utilised for transmission, and in doing so maintains the throughput without wasting any bandwidth. That's bitswapping and is used frequently on longer, or errornous lines where "normal" databit transmission is difficult.
    To put all this into perspective .... if your line starts to crackle .... high counts of errored seconds will be seen, and cyclic checking will go up, along with packet header correction. And as all this takes up overhead, throughput and data transfer depletes until the modem drops the connection.
    On regaining a new re-negotiated connection, the dslam may according to line history and the "fault" that caused linedrop .... impose a higher level of interleave, via the DLM line algorithm. It can also reduce sync like it does at night, in order to negotiate a connection that is sustainable.
    Crackle is probably the worst case scenario, as eventually the connection is bound to drop. But even high levels of impulse noise can destroy data packets, so if you have say poor extension wiring that absorbs REIN it will do the same, cut back the throughput.
    Hope this helps.

  • Question about displaying handler errors in the webdynpro

    Hello all, Please forgive any EM terminology mixups as I am new to this unique module!
         Here is my scenario, I am in EM WebDynpro and updating the actual dates on a purchase req. The event handler accepts the date I entered and in the background makes a synchronous rfc call to ECC to update the related project with the new date. This rfc call fails because I have the project open and it is locked. This call is synchronous so I get the error right away and I set the return code to 4 and populate an error message that I want passed back to the user in WebDynpro. For some reason the EM system is ignoring this error and returning to the user a successful 'sent' message.
    EM WebDynpro --> Purchase Req --> PO Approved Actual Date entered --> synchronous RFC to ECC to update Project --> project locked error returned by ECC --> error message populated in EM --> EM WebDynpro returns as if it was successful
    I have put in breakpoints to ensure I was populating error messages back to EM and I see the details flowing back that are correct, but no details are returned to the actual user. If I go to the Event Handler Overview in the GUI I can find my error message recorded there. Problem is our users will be working from the Web primarily and would not see this message in a normal course of work.
    Is there a config piece that I should be setting to return this error to the users in WebDynpro? This seems like a trivial/standard piece of functionality so I am confused as to why it is not showing up in the dynpro.
    Thank you for any help or ideas and points awarded of course!
    John

    Hello Berthold,
       I believe we understand what you are saying we should do and we have mimicked the activity you described. Now we are running into a short dump when the system tries to process the RETRIEVE MSG method. The code is looking for the class /AIN/CLPUB_ID_CONVERT for some reason. This class does not exist in this release. There is a /SAPTRX/ class that matches.
    So in /SAPTRX/CL_PUB_ID_CONVERT method CALL_AII_FOR_SINGLE_ID at line 45 there is this statement:      CALL METHOD (co_ain_class_name)=>(co_ain_method_id_mapping). Since this is a dynamic class/method call we think we must have something still incorrect in the IMG so we are going through troubleshooting and looking at OSS Notes. No luck so far.
    Any additional input or ideas as to possible missed steps would be greatly appreciated.
    John
    PS Release 7 (SAPK-70004INSCEMSRV pack level)
    Edited by: John D Norman on May 6, 2010 2:00 AM

  • Questions about 1Z0-047 Oracle Database SQL Expert

    I am planning to take this exam and I have several questions:
    1) I am using Steve O'Hearn's 'SQL Certified Expert Exam Guide' book and this states the following about SQL functions:
    "Be sure to review the Oracle Database SQL Language Reference Manual and review the lengthy description of all of the SQL functions before taking the exam"
    In trial tests it seemed that book's information was enough, but how about real exam? Is it necessary to study something in addition to this book information? You can answer regarding other exam objectives as well, if there is something that I should read from some other materials.
    2) The book states that I can add not null constraint to column that has null values, if I specify default value. I tried and cannot, I get error. So the book states it wrongly or do I misunderstand something?
    3) The book states that I cannot drop a NOT NULL constraint, but I can get the job done using: ALTER TABLE table_name MODIFY column_name NULL;
    I tried and I can execute: alter table table_name drop constraint nameofnotnullconstraint;
    4) To use external tables, is only read grant on the directory necessary or also write?
    5) I understood from the book that to flashback table (e.g to before drop) I need to have row movement enabled on the table. But I tried and I can make this flashback operation to table that does not have row movement enabled. How can this be explained!
    Big thanks in advance!

    #1) well, the manual is free; find here the SQL Language Reference - http://www.oracle.com/pls/db112/portal.all_books#index-SQL
    #2 & 3) If you proved it yourself, that settles it!
    #4) Here's a good article about external tables: http://www.oracle-developer.net/display.php?id=512
    I noted this paragraph in it, which might answer your question:
    In addition to the standard read-write Oracle directory that we need for our external table, we also need an additional executable directory object for the preprocessor. This directory defines the location of the executables used by the preprocessor (we will be using gzip below). As far as Oracle is concerned, an executable directory is one that has EXECUTE privileges granted on it (this is an 11g feature specifically to support the preprocessor).
    #5) don't know

  • Question about Find and Replace PL/SQL option in Forms Builder

    Dear All
    I have a small question .
    I am using Find and Replace PLSQ/SQL in forms Builder ( Edit - Find and Replace PLSQL) to search any code in a form.
    Let say I am searching for EMP .
    Then all the places is coming where EMP is used as well as EMPloyee , EMPloyee_Desc tables also coming .
    So is there any way to serach only the EMP part .

    If you look closely to the right of the "Find What" field, you should see a button - "Expression". This allows you to add some logic to your search. Alternatively, depending on how you code, you could just look for spaces. For example, if you are looking for EMP and not EMPLOYEE, search for EMP with a blank space before and after it (assuming you code this way) or use something like this \bEMP\b This would work for me because I code the same way I write sentences - each work is separated by spaces.
    <blockquote> EMPLOYEE := EMP || ' - ID';</blockquote>
    In this example, seaching for EMP with a blank space after would find what I wanted. However, if you only search for a trailing blank, you may end up also finding words like tEMP. This is where have a blank space before each word is helpful.
    Other, more valuable expressions could be written to accomplish your task. Refer to the Forms Builder Online help for more information about using Expressions in the Find and Replace search window.

  • A question about error with jasperserver for pdf and Apex

    I have created a pdf report on jasperserver and I can call it from apex via a url and it displays fine. The url is this format {http://server:port/jasperserver/flow.html?_flowId=viewReportFlow&reportUnit=/reports/Apex/deptemp&output=pdf&deptNo=#DEPTNO#&j_username=un&j_password=pw}
    However, I am trying to follow a stored procedure executed from Apex so it would not expose the username/pwd in the url like above.
    If I am reading the apache error log correctly it is erroring in this piece of the code below where it executes {Dbms_Lob.writeAppend}
    loop
    begin
    -- read the next chunk of binary data
    Utl_Http.read_raw(vResponse, vData);
    -- append it to our blob for the pdf file
    Dbms_Lob.writeAppend
    ( lob_loc => vBlobRef
    , amount => Utl_Raw.length(vData)
    , buffer => vData
    exception when utl_http.end_of_body then
    exit; -- exit loop
    end;
    end loop;
    Utl_Http.end_response(vResponse);}
    The error log says this; HTTP-500 ORA-14453: attempt to use a LOB of a temporary table, whose data has alreadybeen purged\n
    What is this error telling me and how can I correct it?
    The stored procedure I am following is below but replaced the vReportURL with my url like above that works.
    Thank you,
    Mark
    {CREATE OR REPLACE procedure runJasperReport(i_deptno   in varchar2)
    is
    vReportURL       varchar2(255);
    vBlobRef         blob;
    vRequest         Utl_Http.req;
    vResponse        Utl_Http.resp;
    vData            raw(32767);
    begin
    -- build URL to call the report
    vReportURL := 'http://host:port/jasperserver/flow.html?_flowId=viewReportFlow'||
         '&reportUnit=/reports/Apex/deptemp'||
         '&output=pdf'||
         '&j_username=un&j_password=pw'||
         '&deptNo='||i_deptno;
    -- get the blob reference
    insert into demo_pdf (pdf_report)
    values( empty_blob() )
    returning pdf_report into vBlobRef;
    -- Get the pdf file from JasperServer by simulating a report call from the browser
    vRequest := Utl_Http.begin_request(vReportUrl);
    Utl_Http.set_header(vRequest, 'User-Agent', 'Mozilla/4.0');
    vResponse := Utl_Http.get_response(vRequest);
    loop
    begin
    -- read the next chunk of binary data
    Utl_Http.read_raw(vResponse, vData);
    -- append it to our blob for the pdf file
    Dbms_Lob.writeAppend
    ( lob_loc => vBlobRef
    , amount  => Utl_Raw.length(vData)
    , buffer  => vData
    exception when utl_http.end_of_body then
    exit; -- exit loop
    end;
    end loop;
    Utl_Http.end_response(vResponse);
    owa_util.mime_header('application/pdf',false);
    htp.p('Content-length: ' || dbms_lob.getlength(vBlobRef));
    owa_util.http_header_close;
    wpg_docload.download_file(vBlobRef);
    end runJasperReport;
    /}

    I am new to working with working with jasperserver to apex interfacing, and also using utl_http with binary data.
    But I guess typing my question down helped me figure out a way to make it work for me.
    I combined info from http://www.oracle-base.com/articles/misc/RetrievingHTMLandBinariesIntoTablesOverHTTP.php
    and from http://sqlcur.blogspot.com/2009_02_01_archive.html
    to come up with this procedure.
    {create or replace PROCEDURE download_file (p_url  IN  VARCHAR2) AS
      l_http_request   UTL_HTTP.req;
      l_http_response  UTL_HTTP.resp;
      l_blob           BLOB;
      l_raw            RAW(32767);
    BEGIN
      -- Initialize the BLOB.
      DBMS_LOB.createtemporary(l_blob, FALSE);
      -- Make a HTTP request, like a browser had called it, and get the response
      l_http_request  := UTL_HTTP.begin_request(p_url);
      Utl_Http.set_header(l_http_request, 'User-Agent', 'Mozilla/4.0');
      l_http_response := UTL_HTTP.get_response(l_http_request);
      -- Copy the response into the BLOB.
      BEGIN
        LOOP
          UTL_HTTP.read_raw(l_http_response, l_raw, 32767);
          DBMS_LOB.writeappend (l_blob, UTL_RAW.length(l_raw), l_raw);
        END LOOP;
      EXCEPTION
        WHEN UTL_HTTP.end_of_body THEN
          UTL_HTTP.end_response(l_http_response);
      END;
    -- make it display in apex
    owa_util.mime_header('application/pdf',false);
    htp.p('Content-length: ' || dbms_lob.getlength(l_blob));
    owa_util.http_header_close;
    wpg_docload.download_file(l_blob);
      -- Release the resources associated with the temporary LOB.
    DBMS_LOB.freetemporary(l_blob);
    EXCEPTION
      WHEN OTHERS THEN
        UTL_HTTP.end_response(l_http_response);
        DBMS_LOB.freetemporary(l_blob);
        RAISE;
    END download_file; }
    Don;t know what I did wrong, but I could not create an 'on-demand' process to call my procedure. I did not understand what it means when it says 'To create an on-demand page process, at least one application level process must be created with the type 'ON-DEMAND'.
    so I had to use a blank page with a call to my procedure in the onload - before header process and that seems to work ok.
    Thank you,
    Mark

  • Error handling in Native SQL for ORACLE

    Hi,
    I have the next code:
    DATA instr TYPE char4.
    EXEC SQL.
        SELECT INSTRUMENTO INTO instr FROM DATOSMAESTROS
    END EXEC.
    And I want to control if the select has no results. Is it possible with the statement EXCEPTION inside EXEC SQL? Something like that:
    DATA instr TYPE char4.
    EXEC SQL.
        SELECT INSTRUMENTO INTO instr FROM DATOSMAESTROS WHERE id_inst = '01'
        EXCEPTION
             WHEN NO_DATA_FOUND THEN
                      :err = SQLCODE
                      INSERT INTO error( field, code_err) VALUES ( 'instrumento',:err)
    END EXEC.
    Is this a correct code? If not, how can I do it?
    Thank you all,
    Cris.

    Hello,
    Take a look on this: http://help.sap.com/saphelp_nw04s/helpdata/en/fc/eb3b8b358411d1829f0000e829fbfe/frameset.htm
    Try this:
    DATA instr TYPE char4.
    EXEC SQL.
    SELECT INSTRUMENTO INTO :instr FROM DATOSMAESTROS
    ENDEXEC.
    Look that I put : inside the native SQL before the intr.
    To catch if no data was recovered try this:
    DATA instr TYPE char4.
    EXEC SQL PERFORMING no_data.
    SELECT INSTRUMENTO INTO :instr FROM DATOSMAESTROS
    ENDEXEC.
    FORM no_data.
      IF instr IS INITIAL.
        MESSAGE ...
      ENDIF.
    ENDFORM.
    Regards.

  • A question about input values inside PL/SQL block

    Dear all,
    I would appreciate if you could kindly help me with this question.
    Consider the following code.
    DECLARE
      myvar1 NUMBER;
      myvar2 NUMBER;
      myvar3 NUMBER;
    BEGIN
      myvar1 := &1;
      myvar2 := &2;
      myvar3 := &3;
      DBMS_OUTPUT.put_line('myvar1 = ' || myvar1);
      DBMS_OUTPUT.put_line('myvar2 = ' || myvar2);
      DBMS_OUTPUT.put_line('myvar3 = ' || myvar3);
    END;
    /This program reads three values as input and prints them. However, I noticed that if instead of writing
    myvar1 := &1;
    myvar2 := &2;
    myvar3 := &3;I write
    myvar1 := '&1';
    myvar2 := '&2';
    myvar3 := '&3';The program will have very same result. I would like to know whether there is a semantic difference between both syntax,
    that is, is there any difference between for example &myvar1 and 'myvar1'?
    Thanks in advance,
    Dariyoosh

    Try this
    CREATE TABLE test_sem  (x VARCHAR2(10), y NUMBER)
    INSERT INTO test_sem VALUES ('A',1);
    INSERT INTO test_sem VALUES ('B',1);
    INSERT INTO test_sem VALUES ('C',1);
    INSERT INTO test_sem VALUES ('D',1);
    SELECT * FROM test_sem WHERE x='&1' --OK
    SELECT * FROM test_sem WHERE x=&1 -- error not a valid number
    SELECT * FROM test_sem WHERE y=&1 -- ok
    SELECT * FROM test_sem WHERE y='&1' -- ok since numbers can be converted to strings'&1' is for characters &1 for numbers;
    You can verify form above test case
    Regards,
    Bhushan

  • Newbie questions about Database replication, "backups", and sql version

    Just created my first Sql Database using the "SQL Database Management Portal". A blast but three questions come to mind:
    1. Is this DB automatically
    "replicated"? (In other words,  is DB "failover" or clustering,  a feature of all newly created Azure databases?) 
    2. Our on-premise model is to make a daily DB backup which is saved to a nightly tape. If needed, we can restore a two-month old database backup under a new name to compare it with the current one. Does Sql Azure support this capability
    or not? Can it be requested?
    3.  Which on-premise version of sql is "Sql Azure" closest to? (2014?)
    TIA,
    edm2
    P.S. My database was created using the "web" edition.

    Hi edm,
    According to your description, you create a SQL Azure database in Azure platform. The replication feature is not supported by Microsoft Azure SQL database. If you want to sync the SQL Azure database and local database, you can use SQL Azure Data Sync service.
    For more information, see:
    http://blogs.technet.com/b/the_cloud_pilot/archive/2011/10/24/your-first-sql-azure-data-sync-step-by-step.aspx
    In addition, if you have Web or Business Edition databases, you must create your own backup strategy. You can use database copy or Import and Export services to create copies of the data and export the file to an Microsoft Azure storage account. Meanwile,
    Windows Azure SQL Database provides a mechanism for automating the process for exporting a database to BACPAC files on a set interval and frequency. For more information, see:
    Schedule an Automated Export:
    http://msdn.microsoft.com/en-us/library/hh335292.aspx#automate
    Windows Azure SQL Database Backup and Restore strategy:
    http://www.mssqltips.com/sqlservertip/3057/windows-azure-sql-database-backup-and-restore-strategy/
    Currently, Azure uses a special version of Microsoft SQL Server as its backend. It provides high availability by storing multiple copies of databases, elastic scale and rapid provisioning, when we check the version of SQL Server, it shows as follows.
    Microsoft SQL Azure (RTM) - 11.0.9216.62
    Regards,
    Sofiya Li
    If you have any feedback on our support, please click
    here.
    Sofiya Li
    TechNet Community Support

  • Question about error code

    I have been having problems when I try to open applications such as IPhotos or Photoshop. They keep on quitting. I did the Hardware Test and it showed error code 2MEM/5/4:DIMM1/J31. Does anyone know what it means and what I should do? I do not have a warranty anymore and now I wondered if I am gonna have to get the coverage plan (my budget is tight right now). Thank you for any help you can give me.

    Either the module has failed or has come loose. At this time I'd open up your computer and make sure it's still locked in place. Afterwards, no need to run the hardware test, just check with System Profiler to see if you were able to nudge it back into position.
    Once in a while RAM modules do fail, but not very often.
    Edit-
    Since you apparently did not purchase this from Apple, it probably is still under lifetime warranty by the seller, so look up your original order number on the invoice and fill out an RMA request on the website of your supplier, or of the manufacturer (brand) itself. If they don't have a Support section or warranty or RMA section, you'll have to email them.
    Put off thinking about eBay until you find out if it will be replaced under warranty.
    [If you had an extra 1GB of memory, that is not going to be a bargain on eBay, as many are just now upgrading and trying to buy that size, but if you had an extra 512MB, then that is what can be found for a fraction of the price you'd have to pay for new anywhere else. If you're really lucky you can find someone with a relatively new iBook or PowerBook who might be looking to sell what hardly had any use. Caution in shipping is required, as the biggest cause of RAM failure is mishandling of the module between manufacture and packaging.]

Maybe you are looking for

  • How to change the cash journal voucher

    Hi Pls advice how to change  the cash journal voucher lay out , that is auto generated in the system. I need to add some fields. Thanx

  • Protoyping problem

    when prototyping an existing class, for example: Array.prototype.myMethod = function():Void{ //Perform some action here for...each loops return the new method, for exmple, after the previous prototype has been declared: my_arr = new Array[1,2,3] for(

  • How can i find a lost ipod

    how can i find my lost ipod

  • Problem when creating Expense Report

    Dears, When i tried to create Expense Report, this error appear after submitting the dates of the trip. Changes in settlement past trigger retroactive settlement. Entry not found in table T706U. Argument: 98P NO 20120118 The estimated travel amount c

  • Java.sql.SQLException: Socket read timed out

    // DbTest.java <code> import java.sql.*; import java.io.*; public class DbTest public static void main(String args[]) System.out.println("DbTest main(-)"); Connection con = null; try Class.forName("oracle.jdbc.driver.OracleDriver"); System.out.printl