need only vales param specific but get all values

Hi all

DECLARE

v_num VARCHAR2 (50);

v_a VARCHAR2 (50);

YaeUb VARCHAR2 (50);

V_c VARCHAR2 (50);

BEGIN

SELECT Substr (order_number, 1, 3)

IN v_num

TABLE

WHERE cust_id =: p_cust_id;

IF v_cust_num = "A" THEN

v_a: = 'Evertghing is very well. "

ELSIF: v_cust_num = 'B' THEN

YaeUb: not = "ok";

ELSIF: v_cust_num = 'C' THEN

V_c: = "Ok";

END IF;

dbms_output. Put_line ('A' | v_a);

dbms_output. Put_line ('B' |) YaeUb);

dbms_output. Put_line ("C" |) V_c);

END;

I'm getting out put also like

output

--------

An Evertghing is very good

B

C

Hello

If this is the goal of your function returns v_status.

But keep in mind that your selection will throw an exception if p_cust_id is not found in the table where twice or more.

DECLARE

v_num VARCHAR2 (50);

v_status VARCHAR2 (50);

BEGIN

BEGIN

SELECT Substr (order_number, 1, 3)

IN v_num

TABLE

WHERE cust_id =: p_cust_id;

--

IF: v_cust_num = 'A' THEN

v_status: = 'Evertghing is very well. "

ELSIF: v_cust_num = 'B' THEN

v_status: = 'not ok ';

ELSIF: v_cust_num = 'C' THEN

v_status: = "Ok";

END IF;

--

exception

When no_data_found then

v_status: = 'no line selected for cust_id =' | to_char(:p_cust_id);

When too_many_rows then

v_status: = "more than one line selected for cust_id = ' |" to_char(:p_cust_id);

end;

dbms_output. Put_line(v_num ||) ' Status: ' | '. v_status);

END;

If v_num and: v_cust_num are identical there may be another problem, v_num is of type varchar 3 digits and compared with a tank to 1 digit. Is this good?

concerning
Kay

Tags: Database

Similar Questions

  • Need to activate windows 7, but get the error 0xC004C020 code

    I need to reinstall the OS system, but when I did I get a pop up window that says unexpected error code 0xC004C020 the key code is pass many times, it can be activated. I never had this problem before, but it's only one of the problems that happens with this problem. The others are with Media Center, you try to use Netflix will not play instance movies keep getting script error 50 line, oh I only have half of gimp too when I install it. No one knows what to do with it.

    See this article, it seems you need to do a phone activation:

    http://support.Microsoft.com/kb/938450

    After graduating from active Windows, you can work on the following problem.

  • How can I configure Firefox 8.0 to accept 3rd party cookies ONLY from some sites but NOT all other sites?

    I don't like to accumulate 3 cookies and would not simply check accept first-party Cookies 3rd box in preferences. BUT I have to accept 3rd party cookies to use the web page from my Bank, a separate site that manages some of their transactions (such as payment of invoices). This means that I have to accept 3rd party cookies, and then remove them by hand, OR should I check accept whenever I use the website of the Bank and then uncheck the box when I'm done.

    I don't think, but it's easy to do it every time you visit. Simply, you click the CM then stationary on Third Party Cookies and then click temporarily allow all. Then you do the same thing, but use the option to revoke to deny again.

    Note: It is not allow temporarily 'everything' (on each site) uses cookies, it allows only those of this site. But I think that if you let authorized if they are used by another site, they will be able too.

    Jack

  • Desperately need help with win XP Edition family, I need to update my PC but get the error message "cannot connect to the server.

    I need to update my pc, I have windows xp home edition. I had sp2 on my computer, but my system crashed almost and I had to do a total system recovery and it removed my files. Tried to download again, but I can't. I get error could not connect to the server. I have no virus or worms and checked each article are saying sp1 kb. I can't update the Explorer or anything like that

    Follow the links in this article to download the Service Packs from Microsoft.  You can download on another computer if necessary and move them to your machine to update.

    "How to obtain the latest Windows XP service pack"
      <>http://support.Microsoft.com/kb/322389 >

    HTH,
    JW

  • How to get all values when using IN paragraph?

    Hi all

    create the table test_case

    as

    Select ' AB-101' ord_no, to_date('06/17/2015','mm/dd/yyyy') dr_date, dr_type 'AB', 'ABC' double dr_name.

    Union of all the

    Select ' AB-100', to_date (' 17/04/2015 ',' mm/dd/yyyy'), 'AB', ' ABC' of the double

    Union of all the

    Select '124', to_date (' 06 / 07/2015 ', ' dd/mm/yyyy'), 'BB', 'BBA' from dual

    Union of all the

    Select '123', to_date (' 06 / 07/2015 ', ' dd/mm/yyyy'), 'BB', 'BBA' from dual

    Union of all the

    Select '145', to_date (' 06 / 07/2015 ', ' dd/mm/yyyy'), 'CC', "CCA" to double

    Union of all the

    Select '144', to_date (' 06 / 07/2015 ', ' dd/mm/yyyy'), 'CC', "CCA" to double

    Getting output

    AB-10117/06/2015ABABC
    AB-10017/04/2015ABABC
    12406/07/2015BBBBA
    12306/07/2015BBBBA
    14506/07/2015CCCOMMON COUNTRY ASSESSMENT
    14406/07/2015CCCOMMON COUNTRY ASSESSMENT

    Expected O/p

    Select max (ord_no), max (dr_date), max (dr_type), max (dr_name) of

    where test_case

    and dr_type in('AB','BB','CC')

    I have to use dr_type in ('AB', 'BB', 'CC')

    AB-10117/06/2015ABABC
    12406/07/2015BBBBA
    14506/07/2015CCCOMMON COUNTRY ASSESSMENT

    Are there opportunities to use CASE?

    Hello

    Rajesh123 wrote:

    Hi all

    create the table test_case

    as

    Select ' AB-101' ord_no, to_date('06/17/2015','mm/dd/yyyy') dr_date, dr_type 'AB', 'ABC' double dr_name.

    Union of all the

    Select ' AB-100', to_date (' 17/04/2015 ',' mm/dd/yyyy'), 'AB', ' ABC' of the double

    Union of all the

    Select '124', to_date (' 06 / 07/2015 ', ' dd/mm/yyyy'), 'BB', 'BBA' from dual

    Union of all the

    Select '123', to_date (' 06 / 07/2015 ', ' dd/mm/yyyy'), 'BB', 'BBA' from dual

    Union of all the

    Select '145', to_date (' 06 / 07/2015 ', ' dd/mm/yyyy'), 'CC', "CCA" to double

    Union of all the

    Select '144', to_date (' 06 / 07/2015 ', ' dd/mm/yyyy'), 'CC', "CCA" to double

    Getting output

    AB-101 17/06/2015 AB ABC
    AB-100 17/04/2015 AB ABC
    124 06/07/2015 BB BBA
    123 06/07/2015 BB BBA
    145 06/07/2015 CC COMMON COUNTRY ASSESSMENT
    144 06/07/2015 CC COMMON COUNTRY ASSESSMENT

    Expected O/p

    Select max (ord_no), max (dr_date), max (dr_type), max (dr_name) of

    where test_case

    and dr_type in('AB','BB','CC')

    I have to use dr_type in ('AB', 'BB', 'CC')

    AB-101 17/06/2015 AB ABC
    124 06/07/2015 BB BBA
    145 06/07/2015 CC COMMON COUNTRY ASSESSMENT

    Are there opportunities to use CASE?

    If you want a separate line of output for each distinct value of dr_type, then use GROUP BY dr_type.

    For example:

    SELECT MAX (ord_no) AS max_ord_no

    MAX (dr_date) AS max_dr_date

    , dr_type - no need to MAX here

    MAX (dr_name) AS max_dr_name

    FROM test_case

    WHERE dr_type IN ('AB', 'BB', 'CC')

    GROUP BY dr_type

    ;

  • CF10 active metrics logging but getting NULL values instead

    In an effort to troublshoot issues I'm having I activated the connection CFADMIN settings but this is what I see in the metrics.log file.  What gives?

    "Information","scheduler-1","11/13/13","15:59:54",,"Max threads: null Current thread count: null Current thread busy: null Max processing time: null Request count: null Error count: 21 Bytes received: null Bytes sent: null Free memory: 1737648152 Total memory: 2117206016 Active Sessions: 0"
    "Information","scheduler-1","11/13/13","16:00:54",,"Max threads: null Current thread count: null Current thread busy: null Max processing time: null Request count: null Error count: 21 Bytes received: null Bytes sent: null Free memory: 1565060456 Total memory: 2117206016 Active Sessions: 0"
    "Information","scheduler-3","11/13/13","16:01:54",,"Max threads: null Current thread count: null Current thread busy: null Max processing time: null Request count: null Error count: 21 Bytes received: null Bytes sent: null Free memory: 1634382744 Total memory: 2089222144 Active Sessions: 0"
    "Information","scheduler-2","11/13/13","16:02:54",,"Max threads: null Current thread count: null Current thread busy: null Max processing time: null Request count: null Error count: 21 Bytes received: null Bytes sent: null Free memory: 1532903104 Total memory: 2089222144 Active Sessions: 0"
    "Information","scheduler-0","11/13/13","16:03:54",,"Max threads: null Current thread count: null Current thread busy: null Max processing time: null Request count: null Error count: 21 Bytes received: null Bytes sent: null Free memory: 1371544704 Total memory: 2089222144 Active Sessions: 0"
    "Information","scheduler-2","11/13/13","16:04:54",,"Max threads: null Current thread count: null Current thread busy: null Max processing time: null Request count: null Error count: 21 Bytes received: null Bytes sent: null Free memory: 1193930792 Total memory: 2089222144 Active Sessions: 0"
    "Information","scheduler-3","11/13/13","16:05:54",,"Max threads: null Current thread count: null Current thread busy: null Max processing time: null Request count: null Error count: 21 Bytes received: null Bytes sent: null Free memory: 1749200240 Total memory: 2117664768 Active Sessions: 0"
    "Information","scheduler-3","11/13/13","16:06:54",,"Max threads: null Current thread count: null Current thread busy: null Max processing time: null Request count: null Error count: 21 Bytes received: null Bytes sent: null Free memory: 1614707664 Total memory: 2117664768 Active Sessions: 0"
    "Information","scheduler-2","11/13/13","16:07:54",,"Max threads: null Current thread count: null Current thread busy: null Max processing time: null Request count: null Error count: 21 Bytes received: null Bytes sent: null Free memory: 1485357392 Total memory: 2117664768 Active Sessions: 0"
    

    I found the answer here: ColdFusion 11 settings log NULL values. Chris Tierney

    Change the connector port in CFIDE (just underneath where you check "Enable logging of measures" to the one defined as the port of the AJP connector in server.xml - 8012 often.)  You need to restart coldfusion.

    Several ways to check a second time, I used

    grep - ir 'port connector' / opt/coldfusion10 /.

  • get all the vertices of a geometry of polygons

    I tried to use sdo_util. GetVertices to retrieve all vertices of a geometry column. Some of the geometry of gType 2007 which contains several elements. GetVertices function seems to give the vertices of the first item only. How can I get all vertices then?

    Published by: 937152 on May 29, 2012 11:56

    Why you all NULL values in your sdo_elem_info_array and sdo_ordinate_array? It's very very bad - see http://docs.oracle.com/cd/E11882_01/server.112/e17766/e12700.htm#sthref3897

    Despite this, I can get all the 'tops' return of the geometry of your sample - notice that I changed your SELECT a little statement.

    jot_test@JOHNOT> create table assessment_parcel_merged (
      2  id number,
      3  geometry sdo_geometry);
    
    Table created.
    
    jot_test@JOHNOT>
    jot_test@JOHNOT> insert into assessment_parcel_merged
      2  (id, geometry)
      3  values
      4  (506833,
      5  mdsys.sdo_geometry(2007,82232,null,
      6  mdsys.sdo_elem_info_array(1,1003,1,13,1003,1,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null),
      7  mdsys.sdo_ordinate_array(632941.3695,5536245.0144,632939.95209944,5536241.97593627,633251.020958124,5536096.38289373,633369.443364573,5536040.95632826,633371.0274,5536043.9168,632941.3695,5536245.0144,631892.0616,5536736.1337,631892.8842984,5536702.62493823,632873.47478553,5536243.66593412,632884.740084103,5536267.81696815,632886.1576,5536270.8559,631892.0616,5536736.1337,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null)));
    
    1 row created.
    
    jot_test@JOHNOT>
    jot_test@JOHNOT> select sdo_geom.validate_geometry_with_context(geometry, 0.0005) as geom_validate
      2  from assessment_parcel_merged;
    
    GEOM_VALIDATE
    ------------------------------------------------------------------------------------------------------------------------
    13033
    
    1 row selected.
    
    jot_test@JOHNOT>
    jot_test@JOHNOT> set null null
    jot_test@JOHNOT> select o.x, o.y
      2  from assessment_parcel_merged a, table(sdo_util.getvertices(a.geometry)) o
      3  where a.id = 506833;
    
             X          Y
    ---------- ----------
     632941.37 5536245.01
    632939.952 5536241.98
    633251.021 5536096.38
    633369.443 5536040.96
    633371.027 5536043.92
     632941.37 5536245.01
    631892.062 5536736.13
    631892.884 5536702.62
    632873.475 5536243.67
     632884.74 5536267.82
    632886.158 5536270.86
    631892.062 5536736.13
    null       null
    null       null
    null       null
    null       null
    null       null
    null       null
    null       null
    null       null
    null       null
    null       null
    null       null
    null       null
    null       null
    null       null
    null       null
    null       null
    null       null
    null       null
    null       null
    null       null
    null       null
    null       null
    null       null
    null       null
    null       null
    null       null
    null       null
    null       null
    null       null
    null       null
    null       null
    null       null
    null       null
    null       null
    null       null
    null       null
    null       null
    null       null
    
    50 rows selected.
    

    John

  • Get the value of the user in plsql environment

    Hi all

    I am writing a program like below:

    DECLARE

    v_user VARCHAR2 (10);

    v_pswd VARCHAR2 (4);

    v_cardN VARCHAR2 (5);

    v_authState BOOLEAN;

    v_choice NUMBER;

    BEGIN

    DBMS_OUTPUT. Put_line ("Welcome to the Bank! Enter your 5-digit card number ");"

    v_cardN: = '& Card_Number';

    v_user: = "& username ';"

    v_pswd: = "& PIN";

    v_authState: = Authenticate_user (v_cardN, v_user, v_pswd);

    IF this is v_authState THEN

    DBMS_OUTPUT. Put_line ("failed authentication! Please re - enter your details).

    GOTO end_line;

    ON THE OTHER

    DBMS_OUTPUT. Put_line (' authentication successful!) Welcome ' | v_user);

    -ATM_Operation();

    END IF;

    DBMS_OUTPUT. Put_line (' what do you want to run');

    DBMS_OUTPUT. PUT_LINE(' 1.) Balance inquiry '. CHR (10) | "2 remove ' | CHR (10) | "3 deposit '. CHR (10) | ("4 check last three Transactions ');

    v_choice: = & choice;

    < < end_line > >

    NULL;

    END;

    /

    Enter the value of card_number: 12347

    Enter the user name: Himanshu

    Enter the value for the PIN: 1234

    Enter the value of the choice: 3

    Welcome to the Bank! Enter your 5-digit card number

    Authentication failed! Please enter your details

    PL/SQL procedure successfully completed.

    It's getting all values quoted with & < variable > got guest quickly even if requested subsequently.

    What is my requirement is: I want the value that arises only when it is requested in order. As choice is requested only after successful authentication.

    Have we not all features in plsql done for user input in this way.

    Please let me know is there within language plsql or not? Or it is possible by taking help of coding code plsql with unix environment or java to achieve?

    It's getting all values quoted with & got invites quickly even if requested subsequently.

    Of course they are! SQL * more is a client tool. It will be:

    1 parse the input

    2. ask all THE required values

    3 replace the values by the user entry in the code

    4. present the code for execution

    5. display the results.

    The code runs on the server and the server has NO contact with the user.

    What is my requirement is: I want the value that arises only when it is requested in order. As choice is requested only after successful authentication.

    Then, you will need to write a client application that will ask at your leisure. Write a Java application to do and then use JDBC to send code or queries to the database.

    Have we not all features in plsql done for user input in this way.

    No - PL/SQL runs on the server. The server has NO contact or interaction with the user.

  • Programatically register values of control only works with Ctrl Val.Get all (not recommended)

    Hello

    I just downloaded "programmatically save 86 vi of https://decibel.ni.com/content/docs/DOC-3551 control values.

    This works.  In the recording, but there an invoke with Ctrl Val.Get All (deprectated) node structure of the event.  I thought that I would get rid of the obsolete reselecting the control method get all.  Of course it was more an (outdated) at the end and the top of the page, little changed from pink to yellow.  However when I run and load a file that is saved I get: error 116 took place to Unflatten chain... Possible reasons:

    LabVIEW: Unflatten or stream of bytes read operation was in pain due to corrupted, unexpected or truncated data.

    A few questions:

    If I were writing this thing without having to download the example it wouldn't work.  Any ideas how I would work in LabVIEW 2011?

    The example is quite old, people would use another method of loading and storage of the parameters in a VI these days?

    This VI crashes after a while.  Is it because he has two event Structures in a loop or because there is no case of timeout or what? (I am not really concerned about why it crashes but if someone knows the answer without wasting time running it I'd appreciate it)

    Thanks for the tips, things that I can draw from this

    The old ways worked with a data type that was {name, type descriptor, flattened data}. The use of new methods {name, variant}, to adapt the code to work with this data type. Also, you cannot use the old data with the new code files.

    I'm assuming that the VI is lock because you have two structures of event in a loop simple (it would make sense, since each structure must wait for an event is to occur), but I'm not the code itself, I can't be sure.

    With respect to the other options, I generally without saving all the controls on a front panel, but when I want to record a bunch of controls, I usually use something like this, which can also work if you collect all the controls of the FP. There are also links to other similar things in the more 'like this' section with the page.

  • How can I allow only a specific list of employees to receive marketing emails, but exclude all others in the same company?

    We have an important customer who said they don't want their employees who receive emails from marketing except a specific list of their management team. Also, we do not want the employees of our customers who decide to opt-in to receive emails from our registration page if they use their work email address.

    How can I allow only a specific list of employees (management team) to receive marketing emails, but exclude all others in the same company?

    One way is to create a list of sharing, "company A does not include." Build a program in the program generator with a charger that looks for the domain "company A". Place a filter in the program on a decision rule with the emails to management teams; If they are in the filter (that is, they are on the management team), remove them program, if they are not (that is, they are not the management team), add them to the list of sharing "excludes company A. Then you can add the list of sharing "Company A excludes" as an exclusion on your segments or implement a model that they will automatically as an exclusion.

    They oppose all non management team emails? If they are, as an extra precaution, you could add the "exclude company A" to master exclusion list.

  • Is Acrobat Pro just for us. We have an employee handbook that needs editing. A part is current pdf, some of an earlier version. You want to get all in a manual, the table of contents automatically adjust and links to specific pages of the table of content

    Is Acrobat Pro just for us. We have an employee handbook that needs editing. A part is current pdf, some of an earlier version. You want to get all in a manual, the table of contents automatically adjust and links to specific pages of the table of contents.

    Acrobat Pro is certainly not the right tool for editing. You want to change the manual using the source - MS Word files for example. Once you have the full changes including OCD work as you want, Acrobat Pro is the tool to convert the source document to PDF format, and ensure the accessibility requirements of 508 - and preferably ISO 14289 (PDF/UA) - are met.

  • Get specific references for all controls

    Using slightly modified code from here, I'm generating a table of references of control on my main façade which is then transmitted to a number of subVIs. Although this feature does not work, it would be preferable to obtain specific references to controls (for example, Boolean RefNum instead of RefNum of control).

    Get these specific references seem possible using constants more specific class and the class specifier. However, the storage of data becomes a problem because I can use is more tables (because they are a different type of data). I don't know if there is another way to transmit these data. I experienced casting the RefNums in the variants, but to get the data of the variant, I need to know what type of RefNum I'm waiting order, of defeats the purpose of making it in the first place.

    A secondary problem is the names of references. The RefNums of control do not have names associated with them, and I do not know how to assign names to them. I tried again using variants and using the function name of the OpenG value data, but this block LabVIEW without indicating why.

    I have attached a version of my code that tries to assign names by using the name of the OpenG value data and build an array of variant. To run it, simple addition the VI as a Subvi has VI that has some Boolean controls on the front panel. My apologies for the crude State of the code - I'm still trying to find how to run things are a bit messy.

    I don't know if you're going to get much better.  There is really no way I know to have a completely flexible way to the building called cluster of references based on any set of given façade, Subscribe to this.

    I tend to do things the manual way (as there are also a bunch of references to elements of façade, that I wouldn't need).  I would like to do all the work for the grouping in a Subvi.

    I am attaching a zip file that contains the key to VI (unless I missed something) on the first project where I really tried to resume on the reference building.  The files are LV9.

    My main VI, I have the Sub - VI soon called to build the interface user of VI references during an initialization phase.  I pass the reference to the main VI in this sub - VI that generates all the references.  I worked on it as a master cluster that contains items that are arrays of references to related controls.  It uses an other sub - VI, called get references and names of labels that I created to help find witnesses.  I still need to use more specific class to get the property references, but I put only once at the beginning.  I then move this thread to cluster out and anywhere in my VI which should have access to references of the façade elements.

    I use arrays of strings to supply the names, I need to build and group references.  This allows me to ignore the controls, I don't care.  The drawbacks to my system, is that if I change the name of a command, I need to update the name in the Subvi.  And if I want to add all controls, not only do I need to add the label to search functions names, I also need to update my cluster typedef (and you absolutely want it is a typedef) to add a place to store the new reference.

    I hope that gives you some ideas.  It worked for me and I will probably use the scheme on another project (or even rewrite other projects using this diagram.)  If there are ideas of improvements, I'd be happy to hear.

  • In bulk API - how to get all contacts that when, in a specific campaign

    Hello

    I am trying to retrieve all contacts only when a specific campaign ID.

    I looked in most activities of the api and it seems that I can not filter the results according to the type of activity: entry campaign.

    Basically what I tried and succeeded is to get all the contacts that are in a specific activity as "EmailOpen" type and a specific campaignid.

    but I need to extract the results of entry of campaign activity.

    is there a way to do this using the API as a whole?

    If this isn't the case, I can do it using a different api? or by creating a segment / list based on the entrance to the campaign activity?

    10 x,

    Eliram

    In bulk API will give you feature dataset and data activity (ver 2). Entry into a campaign is not an activity that the contact is made, but it is rather something that you do everything for them - so therefore, that is not a valid activity to expect from the bulk API.

    This information is available through REST:

    GET https://secure.eloqua.com/API/REST/2.0/data/report/7?count=400&page=1&assetId=42&startAt=1414532956&endAt=1415742956

    It is used in the operational report "Entry campaign report" under the active campaign options menu. Like all OTHER calls, number of max is 1000. That would be 1 call of the API by campaign, by 1000 responses. Slots are at the time Unix.

  • Only one of the many files tagged same tag show during the search. How can I get all show them?

    Under Vista, I have marked several jpeg files (all in the same folder), but only you can see when I search using the ' tag: whatever ", although there are several JPGs with the same tag. I tried to re-indexing, but no help. Y at - it a bug, or how to get all files with the same tag to show when searched?

    This problem is resolved in that additional open JPG files in Adobe Elements and resave measures will allow them to accomplish what I need... to throw the tags to work for these files.  It would be nice to know (and maybe others that falls on this thread) is exactly what is on some JPG files that are not compatible with the Vista tags, somehow, but maybe this will give them an idea of something else to judge if they have the same problem.

    Thank you. If I ever have to 'knead' more help, I know where to go.

    -"Dough" ;-)

  • Use Insert all but want only to insert records for non-null values

    Hi, New here and could use some help with my sql statement.  I have a portfolio with denormalized data table that has been inserted via .csv file.  It is a contract with a base, options and extensions.  I need to create a contract record, then a separate record in the table for each base/option/extension contract Details.  I use INSERT ALL so I maintain the CONTRACT_ID for the secondary table.  My problem is that my statement puts a line in the table of details for the null records, that I don't want.  (i.e. 123 contract has a Base, Option 1, Option 2 and Option 3, but I'm getting a line for these lines with dates more null for Option 4, Ext 1, Ext 2, Ext 3 and Ext 4).  I want to insert only when the % CTRT_STRT_DT is NOT NULL.  It will be different for each contract.  Where should I put the IS NOT NULL statement?  Here is my complete insert statement:

    -Contract data

    INSERT ALL

    IN LRTC)

    CTRT_ID,

    PRGRM_OFC_TYP_CD,

    CTRT_NME,

    CREN_DT)

    VALUES)

    CTRT_ID_SEQ. NEXTVAL,

    PRGRM_OFC_TYP_CD,

    SPLS_SRVS_DESC,

    SYSDATE)

    -Contract detail for another period of performance data

    IN CTRT_DTLS)

    CTRT_ID,

    CTRT_STAT_CD,

    CTRT_PER_NME,

    CTRT_STRT_DT,

    CTRT_END_DT,

    CTRT_CURR_AMT,

    CTRT_NO,

    CTRT_VNDR_NME,

    CREN_DT)

    VALUES)

    CTRT_ID_SEQ. NEXTVAL,

    1,

    "Other."

    OTHER_CTRT_STRT_DT,

    OTHER_CTRT_END_DT,

    OTHER_CTRT_CURR_AMT,

    CTRT_NO,

    CTRTR_NME,

    SYSDATE)

    -Contract detail data for the reference period of performance

    IN CTRT_DTLS)

    CTRT_ID,

    CTRT_STAT_CD,

    CTRT_PER_NME,

    CTRT_STRT_DT,

    CTRT_END_DT,

    CTRT_CURR_AMT,

    CTRT_NO,

    CTRT_VNDR_NME,

    CREN_DT)

    VALUES)

    CTRT_ID_SEQ. NEXTVAL,

    1,

    'Base ',.

    BASE_CTRT_STRT_DT,

    BASE_CTRT_END_DT,

    BASE_CTRT_CURR_AMT,

    CTRT_NO,

    CTRTR_NME,

    SYSDATE)

    -Data contract detail for Option 1 execution time-out

    IN CTRT_DTLS)

    CTRT_ID,

    CTRT_STAT_CD,

    CTRT_PER_NME,

    CTRT_STRT_DT,

    CTRT_END_DT,

    CTRT_CURR_AMT,

    CTRT_NO,

    CTRT_VNDR_NME,

    CREN_DT)

    VALUES)

    CTRT_ID_SEQ. NEXTVAL,

    1,

    "Option 1",

    OPT1_CTRT_STRT_DT,

    OPT1_CTRT_END_DT,

    OPT1_CTRT_CURR_AMT,

    CTRT_NO,

    CTRTR_NME,

    SYSDATE)

    -Data contract detail for Option 2 execution time-out

    IN CTRT_DTLS)

    CTRT_ID,

    CTRT_STAT_CD,

    CTRT_PER_NME,

    CTRT_STRT_DT,

    CTRT_END_DT,

    CTRT_CURR_AMT,

    CTRT_NO,

    CTRT_VNDR_NME,

    CREN_DT)

    VALUES)

    CTRT_ID_SEQ. NEXTVAL,

    1,

    'Option 2',

    OPT2_CTRT_STRT_DT,

    OPT2_CTRT_END_DT,

    OPT2_CTRT_CURR_AMT,

    CTRT_NO,

    CTRTR_NME,

    SYSDATE)

    -Data contract detail for Option 3 lead time

    IN CTRT_DTLS)

    CTRT_ID,

    CTRT_STAT_CD,

    CTRT_PER_NME,

    CTRT_STRT_DT,

    CTRT_END_DT,

    CTRT_CURR_AMT,

    CTRT_NO,

    CTRT_VNDR_NME,

    CREN_DT)

    VALUES)

    CTRT_ID_SEQ. NEXTVAL,

    1,

    'Option 3',

    OPT3_CTRT_STRT_DT,

    OPT3_CTRT_END_DT,

    OPT3_CTRT_CURR_AMT,

    CTRT_NO,

    CTRTR_NME,

    SYSDATE)

    -Data contract detail for Option 4 execution time-out

    IN CTRT_DTLS)

    CTRT_ID,

    CTRT_STAT_CD,

    CTRT_PER_NME,

    CTRT_STRT_DT,

    CTRT_END_DT,

    CTRT_CURR_AMT,

    CTRT_NO,

    CTRT_VNDR_NME,

    CREN_DT)

    VALUES)

    CTRT_ID_SEQ. NEXTVAL,

    1,

    'Option 4',

    OPT4_CTRT_STRT_DT,

    OPT4_CTRT_END_DT,

    OPT4_CTRT_CURR_AMT,

    CTRT_NO,

    CTRTR_NME,

    SYSDATE)

    -Data contract detail for Extension 1 execution time-out

    IN CTRT_DTLS)

    CTRT_ID,

    CTRT_STAT_CD,

    CTRT_PER_NME,

    CTRT_STRT_DT,

    CTRT_END_DT,

    CTRT_CURR_AMT,

    CTRT_NO,

    CTRT_VNDR_NME,

    CREN_DT)

    VALUES)

    CTRT_ID_SEQ. NEXTVAL,

    1,

    'Extension 1',

    EXT1_CTRT_STRT_DT,

    EXT1_CTRT_END_DT,

    EXT1_CTRT_CURR_AMT,

    CTRT_NO,

    CTRTR_NME,

    SYSDATE)

    -Data contract detail for Extension 2 execution time-out

    IN CTRT_DTLS)

    CTRT_ID,

    CTRT_STAT_CD,

    CTRT_PER_NME,

    CTRT_STRT_DT,

    CTRT_END_DT,

    CTRT_CURR_AMT,

    CTRT_NO,

    CTRT_VNDR_NME,

    CREN_DT)

    VALUES)

    CTRT_ID_SEQ. NEXTVAL,

    1,

    '2 Extension',

    EXT2_CTRT_STRT_DT,

    EXT2_CTRT_END_DT,

    EXT2_CTRT_CURR_AMT,

    CTRT_NO,

    CTRTR_NME,

    SYSDATE)

    -Data contract detail for Extension 3 lead time

    IN CTRT_DTLS)

    CTRT_ID,

    CTRT_STAT_CD,

    CTRT_PER_NME,

    CTRT_STRT_DT,

    CTRT_END_DT,

    CTRT_CURR_AMT,

    CTRT_NO,

    CTRT_VNDR_NME,

    CREN_DT)

    VALUES)

    CTRT_ID_SEQ. NEXTVAL,

    1,

    '3 Extension',

    EXT3_CTRT_STRT_DT,

    EXT3_CTRT_END_DT,

    EXT3_CTRT_CURR_AMT,

    CTRT_NO,

    CTRTR_NME,

    SYSDATE)

    -Data contract detail for Extension 4 execution time-out

    IN CTRT_DTLS)

    CTRT_ID,

    CTRT_STAT_CD,

    CTRT_PER_NME,

    CTRT_STRT_DT,

    CTRT_END_DT,

    CTRT_CURR_AMT,

    CTRT_NO,

    CTRT_VNDR_NME,

    CREN_DT)

    VALUES)

    CTRT_ID_SEQ. NEXTVAL,

    1,

    '4 Extension',

    EXT4_CTRT_STRT_DT,

    EXT4_CTRT_END_DT,

    EXT4_CTRT_CURR_AMT,

    CTRT_NO,

    CTRTR_NME,

    SYSDATE)

    SELECT

    PRGRM_OFC_TYP_CD,

    SPLS_SRVS_DESC,

    CTRT_NO,

    CTRTR_NME,

    To_date(PER_OF_PFRM_OTHER_ST_DT,'MM/DD/YYYY') as OTHER_CTRT_STRT_DT,

    To_date(PER_OF_PFRM_OTHER_END_DT,'MM/DD/YYYY') as OTHER_CTRT_END_DT,

    CUR_VAL_BY_POP_OTHER_AMT as OTHER_CTRT_CURR_AMT,

    To_date(PER_OF_PFRM_BASE_ST_DT,'MM/DD/YYYY') as BASE_CTRT_STRT_DT,

    To_date(PER_OF_PFRM_BASE_END_DT,'MM/DD/YYYY') as BASE_CTRT_END_DT,

    CUR_VAL_BY_POP_BASE_AMT as BASE_CTRT_CURR_AMT,

    To_date(PER_OF_PFRM_OPT1_ST_DT,'MM/DD/YYYY') as OPT1_CTRT_STRT_DT,

    To_date(PER_OF_PFRM_OPT1_END_DT,'MM/DD/YYYY') as OPT1_CTRT_END_DT,

    CUR_VAL_BY_POP_OPT1_AMT as OPT1_CTRT_CURR_AMT,

    To_date(PER_OF_PFRM_OPT2_ST_DT,'MM/DD/YYYY') as OPT2_CTRT_STRT_DT,

    To_date(PER_OF_PFRM_OPT2_END_DT,'MM/DD/YYYY') as OPT2_CTRT_END_DT,

    CUR_VAL_BY_POP_OPT2_AMT as OPT2_CTRT_CURR_AMT,

    To_date(PER_OF_PFRM_OPT3_ST_DT,'MM/DD/YYYY') as OPT3_CTRT_STRT_DT,

    To_date(PER_OF_PFRM_OPT3_END_DT,'MM/DD/YYYY') as OPT3_CTRT_END_DT,

    CUR_VAL_BY_POP_OPT3_AMT as OPT3_CTRT_CURR_AMT,

    To_date(PER_OF_PFRM_OPT4_ST_DT,'MM/DD/YYYY') as OPT4_CTRT_STRT_DT,

    To_date(PER_OF_PFRM_OPT4_END_DT,'MM/DD/YYYY') as OPT4_CTRT_END_DT,

    CUR_VAL_BY_POP_OPT4_AMT as OPT4_CTRT_CURR_AMT,

    To_date(PER_OF_PFRM_EXT1_ST_DT,'MM/DD/YYYY') as EXT1_CTRT_STRT_DT,

    To_date(PER_OF_PFRM_EXT1_END_DT,'MM/DD/YYYY') as EXT1_CTRT_END_DT,

    CUR_VAL_BY_POP_EXT1_AMT as EXT1_CTRT_CURR_AMT,

    To_date(PER_OF_PFRM_EXT2_ST_DT,'MM/DD/YYYY') as EXT2_CTRT_STRT_DT,

    To_date(PER_OF_PFRM_EXT2_END_DT,'MM/DD/YYYY') as EXT2_CTRT_END_DT,

    CUR_VAL_POP_EXT2_AMT as EXT2_CTRT_CURR_AMT,

    To_date(PER_OF_PFRM_EXT3_ST_DT,'MM/DD/YYYY') as EXT3_CTRT_STRT_DT,

    To_date(PER_OF_PFRM_EXT3_END_DT,'MM/DD/YYYY') as EXT3_CTRT_END_DT,

    CUR_VAL_BY_POP_EXT3_AMT as EXT3_CTRT_CURR_AMT,

    To_date(PER_OF_PFRM_EXT4_ST_DT,'MM/DD/YYYY') as EXT4_CTRT_STRT_DT,

    To_date(PER_OF_PFRM_EXT4_END_DT,'MM/DD/YYYY') as EXT4_CTRT_END_DT,

    CUR_VAL_BY_POP_EXT4_AMT as EXT4_CTRT_CURR_AMT

    OF CTRT_HLDG A, PRGRM_OFC_TYP_LKUP B

    WHERE UPPER (A.OFC_NME) = UPPER (B.PRGRM_OFC_TYP_NME);

    Thanks for any help.

    Chris

    You're close.  Basically, you add one when befire each Inserts lines.  Something like:

    INSERT ALL

    When the ctrt_id is not null then

    IN LRTC (PRGRM_OFC_TYP_CD, CTRT_NME, CTRT_ID, CREN_DT)

    VALUES (CTRT_ID_SEQ. NEXTVAL, PRGRM_OFC_TYP_CD,

    SPLS_SRVS_DESC, SYSDATE)

    -Contract detail for another period of performance data

    When the OTHER_CTRT_STRT_DT is not null then

    IN (CTRT_ID, CTRT_STAT_CD, CTRT_PER_NME, CTRT_DTLS

    CTRT_STRT_DT, CTRT_END_DT, CTRT_CURR_AMT,

    CTRT_NO, CTRT_VNDR_NME, CREN_DT)

    VALUES (CTRT_ID_SEQ. NEXTVAL, 1, 'Other', OTHER_CTRT_STRT_DT,

    OTHER_CTRT_END_DT, OTHER_CTRT_CURR_AMT,

    CTRT_NO, CTRTR_NME, SYSDATE)

    -Contract detail data for the reference period of performance

    When the BASE_CTRT_STRT_DT is not null then

    IN (CTRT_ID, CTRT_STAT_CD, CTRT_PER_NME, CTRT_DTLS

    CTRT_STRT_DT, CTRT_END_DT, CTRT_CURR_AMT,

    CTRT_NO, CTRT_VNDR_NME, CREN_DT)

    VALUES (CTRT_ID_SEQ. NEXTVAL, 1, 'Base', BASE_CTRT_STRT_DT,

    BASE_CTRT_END_DT, BASE_CTRT_CURR_AMT, CTRT_NO,

    CTRTR_NME, SYSDATE)

    You may need to adjust my predicates, but it should give you the idea.

    John

Maybe you are looking for