Code / review of logic

Hi all

Please review the code and logic used to download data by converting the value column separated by commas following multi-line.

Used tables.
--------------------
create the table temp_stg
(number (16) id,)
equip_name varchar2 (200),
PCB1 varchar2 (50).
pcb2 varchar2 (50));



create the table temp_org
(equip_name, varchar2 (200),)
PCB varchar2 (50));

insert into temp_stg
values (1, 'Equip1', 'PCB1 & PCB2', 'PCB3 & PCB4');

Commit
/

I want the output of following records inserted in temp_org

Equip_name PCB
------------------- --------------------------
Equip1 PCB1
Equip1 PCB2
Equip1 PCB3
Equip1 PCB4

Here is the PL/SQL code to do the same.

DECLARE
CURSOR cur_stg IS
Select equip_name, pcb1 | '&' | pcb2 as PCB
from temp_stg where id = 1;

rec_stg cur_stg % ROWTYPE;
PROCEDURE process_pcbs
IS
l_pcb_str VARCHAR2 (500);
l_single_pcb VARCHAR2 (50);
l_cnt PLS_INTEGER: = 0;
BEGIN
l_pcb_str: = rec_stg.pcbs;
While (length (trim (l_pcb_str)) > 0)
LOOP
IF instr (l_pcb_str, '&', 1, 1) > 0 THEN
l_single_pcb: = substr (l_pcb_str, 1, instr (l_pcb_str, '&', 1, 1));
l_pcb_str: = substr (l_pcb_str, instr (l_pcb_str, '&', 1, 1));
ON THE OTHER
l_single_pcb: = l_pcb_str;
l_pcb_str: = NULL;
END IF;
INSERT INTO temp_org
VALUES (rec_stg.equip_name, l_single_pcb);
END LOOP;
COMMIT;
END process_pcbs;

BEGIN
OPEN cur_stg.
LOOP
SEEK cur_stg INTO rec_stg;
EXIT WHEN cur_stg % NOTFOUND;
IF rec_stg.pcbs IS NOT NULL THEN
process_pcbs;
END IF;
END LOOP;
CLOSE Cur_stg;
EXCEPTION
WHILE OTHERS THEN
IF cur_stg % ISOPEN THEN CLOSE cur_stg; END IF;
LIFT;
END;
/

Thank you
Srini

I'm close by using the type clause (just cause the type clause is fun to use)
but I'm not strong with all the susbstr analysis of functions, instr etc.

in any case if someone wants to end it up,
Oh and I added a line to the temp_stg original table just so I could see it working for several lines.

Select * from)
with one also (select 1 rn, "Nixon #2, PCB1 and PCB2, PCB3 & PCB4" double text)
Union
Select the rn 2, 'Nixon #3, PCB2 and PCB3, PCB4 & PCB5' double text
)
Select col1, col2
a
model update return lines
partition by (rn)
dimension (0d)
measures (col1 text,
col2 text)
iterate rules (10)
(
col1 [iteration_number + 1] = substr (col1 [0], 1, instr(col1[0],',',1) - 1).
col2 [iteration_number + 1] = substr (col1 [0], (length(col1[1]) + 2) * (iteration_number + 1), 5)

)

order by col1
)
When col2 is not null

Tags: Database

Similar Questions

  • Code review

    Could someone review this code on a Mac or Windows 7 computer and tell me if you have any questions?

    It is a JavaFX application written with eclipse and scene generator

    The value that you enter in the PMRC field is a 1, and the small brown buttons are ToggleButton controls as is the male/female ToggleButton

    Main class

    the appCC package;

    Import javafx.application.Application;

    Import javafx.stage.Stage;

    Import javafx.scene.Scene;

    Import javafx.scene.layout.AnchorPane;

    Import javafx.fxml.FXMLLoader;

    public class CLRC extends Application {}

    @Override

    {} public void start (point primaryStage)

    try {}

    Root AnchorPane = FXMLLoader.load (getClass ().getResource("crcl.fxml")) (AnchorPane);

    Scene = new Scene (root);

    primaryStage.setScene (scene);

    primaryStage.setTitle ("Calculator creatinine Clearance");

    primaryStage.show ();

    } catch (Exception e) {}

    e.printStackTrace ();

    }

    }

    Public Shared Sub main (String [] args) {}

    Launch (args);

    }

    }

    Controller class

    the appCC package;

    java.awt.Component import;

    import java.net.URL;

    import impossible;

    import java.text.NumberFormat;

    import java.util.ResourceBundle.

    Import javax.swing.JOptionPane;

    Import javafx.event.ActionEvent;

    Import javafx.fxml.FXML;

    Import javafx.fxml.Initializable;

    Javafx.scene.control import. *;

    / public class CRCLController implements {bootable

    @FXML

    Private Label lblLBW;

    @FXML

    Private Label lblABW;

    @FXML

    Private Label lblTBW;

    @FXML

    private TextField txfAge;

    @FXML

    private TextField txfCI;

    @FXML

    private TextField txfKL;

    @FXML

    private TextField txfHt;

    @FXML

    private TextField txfWt;

    @FXML

    private TextField txfSC;

    @FXML

    tbnCI private ToggleButton;

    @FXML

    tbnKL private ToggleButton;

    @FXML

    tbnMF private ToggleButton;

    @FXML

    private Button btnClear;

    @FXML

    private Button btnCalc;

    NumberFormat nf = new DecimalFormat("##.00");

    private int Mals.

    Private float vHtin;

    Private float vHtcm;

    Private float vWtlb;

    Private float vWtkg;

    private int vSex;

    Private float vIBW;

    private float TFPN; / / weight for IPN

    Private float vSrCr;

    Private float vCrCL; / / CLRC LBW

    private float DAVL; / / weight for AdjBW

    Private float vCrCA; / / CLRC ABW

    Private float vCrCT; / / CLRC TBW

    @FXML

    Private Sub onCalc (ActionEvent ep) throws Exception {}

    Test all TextFields

    String regNum1 = (".") * [a - z A - Z]. * ») ;

    String regNum2 = (".") * [a - z A - Z]. * ») ;

    String regNum3 = (".") * [a - z A - Z]. * ») ;

    String regNum4 = (".") * [a - z A - Z]. * ») ;

    String W1 = String.valueOf (txfAge.getText () .trim ());

    String W2 = String.valueOf (txfHt.getText () .trim ());

    W3 string = String.valueOf (txfWt.getText () .trim ());

    W4 channel = String.valueOf (txfSC.getText () .trim ());

    NOTE the use of the. trim() < -.

    If (W1.length () > 3

    || W1 is nothing

    || W1. IsEmpty()

    || W1. Matches (regNum1)

    || (W2.length () > 3 |) W2 == null | W2. IsEmpty() | W2

    . Matches (regNum2))

    || (W3.length () > 3 |) W3 == null | W3. IsEmpty() | W3

    . Matches (regNum3))

    || (W4.length (> 4) |) W4 == null | W4. IsEmpty() | W4

    {.matches (regnum4)))}

    Component Reflection2 = null;

    JOptionPane.showMessageDialog (Reflection2, "Entered Value Invalid",

    'Information', JOptionPane.WARNING_MESSAGE);

    If (W1.length () > 3 |) W1 == null | W1. IsEmpty()

    || {W1. Matches (regNum1))}

    txfAge.setText("");

    txfAge.requestFocus ();

    return;

    }

    If (W2.length () > 3 |) W2 == null | W2. IsEmpty()

    || {W2. Matches (regNum2))}

    txfHt.setText("");

    txfHt.requestFocus ();

    return;

    }

    If (W3.length () > 3 |) W3 == null | W3. IsEmpty()

    || {W3. Matches (regNum3))}

    txfWt.setText("");

    txfWt.requestFocus ();

    return;

    }

    If (W4.length (> 4) |) W4 == null | W4. IsEmpty()

    || {W4. Matches (regNum4))}

    txfSC.setText("");

    txfSC.requestFocus ();

    return;

    }

    }

    Test range values of the data incorporated in TextFields

    // ================================================

    int Age = Integer.parseInt (txfAge.getText () .trim ());

    If (age < = 11 |) Age > 110) {}

    Component Reflection2 = null;

    JOptionPane.showMessageDialog (Reflection2,

    "Age group 12 to 110 year', 'Information ',.

    JOptionPane.WARNING_MESSAGE);

    txfAge.setText("");

    txfAge.requestFocus ();

    return;

    }

    If (! tbnCI.isSelected ()) {/ /!} Selected NOT Ht in cm rated

    float Ht = Float.parseFloat (txfHt.getText () .trim ());

    If (Ht 130 < |) HT > 213) {}

    Component Reflection2 = null;

    JOptionPane.showMessageDialog (Reflection2,

    'Beach 130 cm to 213 cm in height', 'Information ',.

    JOptionPane.WARNING_MESSAGE);

    txfHt.setText("");

    txfHt.requestFocus ();

    return;

    }

    }

    If (tbnCI.isSelected ()) {}

    float Ht = Float.parseFloat (txfHt.getText () .trim ());

    If (Ht < 51 |) HT > 83) {}

    Component Reflection2 = null;

    JOptionPane.showMessageDialog (Reflection2,

    "Adjustable height 51 to 83 in ', 'Information ',.

    JOptionPane.WARNING_MESSAGE);

    txfHt.setText("");

    txfHt.requestFocus ();

    return;

    }

    }

    If (! tbnKL.isSelected ()) {/ /!} Selected NOT Wt in kg rated

    float Wt = Float.parseFloat (txfWt.getText () .trim ());

    If (Wt < 30 |) WT > 136) {}

    Component Reflection2 = null;

    JOptionPane.showMessageDialog (Reflection2,

    "Weight range 30 kg, 136 kg', 'Information ',.

    JOptionPane.WARNING_MESSAGE);

    txfWt.setText("");

    txfWt.requestFocus ();

    return;

    }

    }

    If (tbnKL.isSelected ()) {}

    float Wt = Float.parseFloat (txfWt.getText () .trim ());

    If (Wt < 66 |) WT > 300) {}

    Component Reflection2 = null;

    JOptionPane.showMessageDialog (Reflection2,

    'Range 66 lb to 300 lb of weight', 'Information ',.

    JOptionPane.WARNING_MESSAGE);

    txfWt.setText("");

    txfWt.requestFocus ();

    return;

    }

    }

    float SC = Float.parseFloat (txfSC.getText () .trim ());

    If (SC < 0.4 |) SC > 24) {}

    Component Reflection2 = null;

    JOptionPane.showMessageDialog (Reflection2,

    '"PMRC range of 0.4 mg/dl to 24 mg/dl', 'Information ',.

    JOptionPane.WARNING_MESSAGE);

    txfSC.setText("");

    txfSC.requestFocus ();

    return;

    }

    If (tbnCI.isSelected ()) {/ / Selected is inches and cm}

    vHtcm = (float) (Float.parseFloat (txfHt.getText (.trim (())) * 2.54);

    vHtcm = Float.parseFloat (nf.format (vHtcm));

    calculated inches it is necessary to other calculations

    vHtin = (float) (Float.parseFloat (txfHt.getText (.trim (())));

    vHtin = Float.parseFloat (nf.format (vHtin));

    } else {}

    vHtin = (float) (Float.parseFloat (txfHt.getText (.trim (())) * 0,3938);

    vHtin = Float.parseFloat (nf.format (vHtin));

    }

    If (tbnKL.isSelected ()) {/ / Selected is kg}

    vWtkg = (float) (Float.parseFloat (txfWt.getText (.trim (())) * 0.4546);

    vWtkg = Float.parseFloat (nf.format (vWtkg));

    } else {}

    vWtlb = (float) (Float.parseFloat (txfWt.getText ()) * 2.2 .trim ());

    vWtlb = Float.parseFloat (nf.format (vWtlb));

    calculated kg it is necessary to other calculations

    vWtkg = (float) (Float.parseFloat (txfWt.getText (.trim (())));

    vWtkg = Float.parseFloat (nf.format (vWtkg));

    }

    If (tbnMF.isSelected ()) {}

    vSex = 1; / / woman

    } else {}

    vSex = 0; / / man

    }

    calculation for IBW

    If (tbnMF.isSelected ()) {/ / Selected is FEMALE}

    vIBW = (float) (45.5 + (2.3 * (vHtin - 60)));

    vIBW = Float.parseFloat (nf.format (vIBW));

    } else {}

    vIBW = (float) (50 + (2.3 * (vHtin - 60)));

    vIBW = Float.parseFloat (nf.format (vIBW));

    }

    Hypotrophy of the IBW

    If (vWtkg < vIBW) {}

    TFPN = vWtkg;

    } else {}

    TFPN = vIBW;

    }

    convert mathematical variables age & SrCr

    vSrCr = (float) (Float.parseFloat (txfSC.getText (.trim (())));

    Mals = (int) (Integer.parseInt (txfAge.getText (.trim (())));

    CLRC LBW

    vCrCL = ((140-vAge) * TFPN) / (vSrCr * 72);

    vCrCL = Float.parseFloat (nf.format (vCrCL));

    lblLBW.setVisible (true);

    lblLBW.setText (String.valueOf (vCrCL) + ' mL/min');

    If (vSex == 1) {/ / if female}

    vCrCL = (float) (vCrCL * 0.85).

    vCrCL = Float.parseFloat (nf.format (vCrCL));

    lblLBW.setVisible (true);

    lblLBW.setText (String.valueOf (vCrCL) + ' mL/min');

    }

    Calculate the weight adjusted to CLRC ABW

    If (vWtkg > TFPN) {}

    DAVL = (float) (TFPN + (0.4 * (vWtkg - TFPN)));

    } else {}

    DAVL = vWtkg;

    }

    CLRC ABW

    vCrCA = ((140-vAge) * DAVL) / (vSrCr * 72);

    vCrCA = Float.parseFloat (nf.format (vCrCA));

    lblABW.setVisible (true);

    lblABW.setText (String.valueOf (vCrCA) + ' mL/min');

    If (vSex == 1) {/ / if female}

    vCrCA = (float) (vCrCA * 0.85).

    vCrCA = Float.parseFloat (nf.format (vCrCA));

    lblABW.setVisible (true);

    lblABW.setText (String.valueOf (vCrCA) + ' mL/min');

    }

    CLRC TBW

    vCrCT = ((140-vAge) * vWtkg) / (vSrCr * 72);

    vCrCT = Float.parseFloat (nf.format (vCrCT));

    lblTBW.setVisible (true);

    lblTBW.setText (String.valueOf (vCrCT) + ' mL/min');

    If (vSex == 1) {/ / if female}

    vCrCT = (float) (vCrCT * 0.85).

    vCrCT = Float.parseFloat (nf.format (vCrCT));

    lblTBW.setVisible (true);

    lblTBW.setText (String.valueOf (vCrCT) + ' mL/min');

    }

    }

    @FXML

    Private Sub labels (ActionEvent ep) throws Exception {}

    lblLBW.setText (null);

    lblABW.setText (null);

    lblTBW.setText (null);

    txfAge.setText (null);

    txfHt.setText (null);

    txfWt.setText (null);

    txfSC.setText (null);

    tbnCI.setSelected (false);

    tbnCI.setText ("cm");

    tbnCI.setStyle ("background - fx - color: tan;") ("police - fx - weight:" BOLD "");

    tbnKL.setSelected (false);

    tbnKL.setText ("kg");

    tbnKL.setStyle ("background - fx - color: tan;") ("police - fx - weight:" BOLD "");

    tbnMF.setSelected (false);

    tbnMF.setText ("Male");

    tbnMF.setStyle ("background - fx - color: Blue;") ("- fx - police-weight:" BOLD "");

    txfAge.requestFocus ();

    }

    Toggle the setting button code

    @FXML

    Private Sub onPCI (ActionEvent ep) throws Exception {}

    If (tbnCI.isSelected ()) {}

    tbnCI.setText ("in");

    tbnCI.setStyle ("- fx - do - weight:bold");

    } else {}

    tbnCI.setText ("cm");

    tbnCI.setStyle ("background - fx - color: tan;") ("police - fx - weight:" BOLD "");

    }

    }

    @FXML

    Private Sub onPKL (ActionEvent ep) throws Exception {}

    If (tbnKL.isSelected ()) {}

    tbnKL.setText ("lb");

    tbnKL.setStyle ("police - fx - weight:" BOLD "");

    } else {}

    tbnKL.setText ("kg");

    tbnKL.setStyle ("background - fx - color: tan;") ("police - fx - weight:" BOLD "");

    }

    }

    @FXML

    Private Sub onPMF (ActionEvent ep) throws Exception {}

    If (tbnMF.isSelected ()) {}

    tbnMF.setText ("Female");

    tbnMF.setStyle ("background - fx - color: pink;") ("police - fx - weight:" BOLD "");

    NOTE css inline code construction use; After the first construction

    } else {}

    tbnMF.setText ("Male");

    tbnMF.setStyle ("background - fx - color: Blue;") ("- fx - police-weight:" BOLD "");

    }

    }

    @Override

    Public Sub initialize (URL arg0, arg1 ResourceBundle) {}

    }

    }

    File FXML

    <? XML version = "1.0" encoding = "UTF-8"? >

    <? import javafx.scene.shape. *? >

    <? import javafx.scene.text. *? >

    <? import javafx.geometry. *? >

    <? import javafx.scene.control. *? >

    <? import java.lang. *? >

    <? import javafx.scene.layout. *? >

    <? import javafx.scene.layout.AnchorPane? >

    < AnchorPane prefHeight = "420,0" prefWidth = "1060,0".

    style = "" background - fx - color: gray; "xmlns =" " http://JavaFX.com/JavaFX/8 "

    ' xmlns:fx = ' http://JavaFX.com/fxml/1 "fx:controller ="appCC.CRCLController">

    < children >

    < prefHeight pane = "420,0" prefWidth = "1060,0".

    "AnchorPane.bottomAnchor ="0.0"AnchorPane.leftAnchor =" 0.0 ".

    AnchorPane.rightAnchor = "0.0" AnchorPane.topAnchor ="0.0" > "

    < children >

    < rectangle arcHeight = "5.0" arcWidth = "5.0" fill = "transparent".

    height = "250.0" layoutX "60.0" = on = "70.0" opacity = race '0.99' = 'blue '.

    strokeType = "INSIDE" strokeWidth = "2.0" width = "280.0" / >

    < button fx:id = "btnCalc" focusTraversable = 'false' layoutX = "230,0.

    On = "340,0" mnemonicParsing = "false" onAction = "#onCalc".

    prefHeight = "28.0" prefWidth = "100.0" style = "" fonts - fx - weight: bold; ' "

    Text = 'Calculate' / >

    < button fx:id = "btnClear" focusTraversable = 'false' layoutX = "80.0.

    On = "340,0" mnemonicParsing = "false" onAction = "#onClear".

    prefHeight = "28.0" prefWidth = "100.0" style = "" fonts - fx - weight: bold; ' "

    Text = "Clear form" / >

    < rectangle arcHeight = "5.0" arcWidth = "5.0" fill = "transparent".

    height = "260.0" layoutX '400.0' = on = race "65.0" = 'blue '.

    strokeType = "INSIDE" strokeWidth = "2.0" width = "600,0" / >

    < rectangle arcHeight = "5.0" arcWidth = "5.0" fill = "transparent".

    height = "250.0" layoutX '405.0' = on = race '70.0' = 'blue '.

    strokeType = "INSIDE" strokeWidth = "2.0" width = "590,0" / >

    < layoutX label = "450.0" on = "100.0" text = "Formula" >

    < font >

    < do size = "18.0" / >

    < / make >

    < / label >

    < layoutX label = "450.0" on = '140.0' text 'Formula of Cockcroft and Gault LBW' = >

    < font >

    < do size = "18.0" / >

    < / make >

    < / label >

    < layoutX label = "450.0" on = "180.0.

    Text = "Cockcroft and Gault formula adjusted BW" >

    < font >

    < do size = "18.0" / >

    < / make >

    < / label >

    < layoutX label '450.0' = on = text '220.0' = 'Formula of Cockcroft and Gault BW True' >

    < font >

    < do size = "18.0" / >

    < / make >

    < / label >

    < layoutX label = "780.0" on = "100.0" text = "Clearance of creatinine" >

    < font >

    < do size = "18.0" / >

    < / make >

    < / label >

    < label fx:id = "lblLBW" = "800,0" layoutX on = "140.0.

    prefHeight = "23.0" prefWidth = "130.0" visible = "false" >

    < font >

    < do size = "18.0" / >

    < / make >

    < / label >

    < label fx:id = "lblABW" = "800,0" layoutX on = "180.0.

    prefHeight = "23.0" prefWidth = "130.0" visible = "false" >

    < font >

    < do size = "18.0" / >

    < / make >

    < / label >

    < label fx:id = "lblTBW" = "800,0" layoutX on = "220,0.

    prefHeight = "23.0" prefWidth = "130.0" visible = "false" >

    < font >

    < do size = "18.0" / >

    < / make >

    < / label >

    < layoutX label = "100.0" on = "28.0" text = 'Patient demographics' >

    < font >

    < do size = "20.0" / >

    < / make >

    < / label >

    < / children >

    < / component >

    < rectangle arcHeight = "5.0" arcWidth = "5.0" fill = "transparent".

    height = "260.0" layoutX '55.0' = on = "65.0" opacity = race '0.99' = 'blue '.

    strokeType = "INSIDE" strokeWidth = "2.0" width = "290,0" / >

    < layoutX label '105,0' = on = "100.0" text = 'Âge' >

    < font >

    < do size = "18.0" / >

    < / make >

    < / label >

    < layoutX label = "90.0" on = '140.0' text 'Height' = >

    < font >

    < do size = "18.0" / >

    < / make >

    < / label >

    < layoutX label '90.0' = on = "180.0" text = 'Weight' >

    < font >

    < do size = "18.0" / >

    < / make >

    < / label >

    < layoutX label '90.0' = on = "220.0" text = "Gender" >

    < font >

    < do size = "18.0" / >

    < / make >

    < / label >

    < layoutX label = "105.0" on = "260.0" text = "PMRC" >

    < font >

    < do size = "18.0" / >

    < / make >

    < / label >

    < layoutX label = "240.0" on = "100.0" text = 'years' >

    < font >

    < do size = "18.0" / >

    < / make >

    < / label >

    < layoutX label = "240.0" on = text "260.0" = "mg/dl" >

    < font >

    < do size = "18.0" / >

    < / make >

    < / label >

    < fx:id = "txfAge" = "155.0" layoutX TextField on = "100.0".

    prefHeight = '28.0' prefWidth = "75.0" / >

    < fx:id = "txfHt" = "155.0" layoutX TextField on = "135,0.

    prefHeight = '28.0' prefWidth = "75.0" / >

    < fx:id = "tbnCI" = "240.0" layoutX ToggleButton on = "135,0.

    mnemonicParsing = "false" onAction = "#onPCI" prefHeight = "28.0.

    prefWidth = "45.0" style = "background - fx - color: tan;" fonts - fx - weight: bold; »

    text = "cm" / >

    < fx:id = "txfWt" = "155.0" layoutX TextField on = "175,0.

    prefHeight = '28.0' prefWidth = "75.0" / >

    < fx:id = "tbnKL" = "240.0" layoutX ToggleButton on = "175,0.

    mnemonicParsing = "false" onAction = "#onPKL" prefHeight = "28.0.

    prefWidth = "45.0" style = "background - fx - color: tan;" fonts - fx - weight: bold; »

    Text = "kg" / >

    < fx:id = "tbnMF" = "155.0" layoutX ToggleButton on = "220,0.

    mnemonicParsing = "false" onAction = "#onPMF" prefHeight = "28.0.

    prefWidth = "75.0" style = "background - fx - color: Blue;" fonts - fx - weight: bold; »

    Text = "Male" / >

    < fx:id = "txfSC" = "155.0" layoutX TextField on = "258,0."

    prefHeight = '28.0' prefWidth = "75.0" / >

    < / children >

    < / AnchorPane >

    This is not a complete code review, just a report on my results when I tried to run your code.

    I ran your code on OS X 10.9, Java8u40.

    The application has started in the end.

    If you enter an invalid value, the application crashes.

    It is because you are trying to create Swing components in a JavaFX application on the thread of JavaFX application, rather than on the Swing thread.

    If you want to call code swing, then you must encapsulate this code in a call from SwingUtilities.invokeLater :

    SwingUtilities.invokeLater (new Runnable() {}

    @Override
    public void run() {}

    JOptionPane.showMessageDialog (Reflection2, "Entered Value Invalid",
    'Information', JOptionPane.WARNING_MESSAGE);
    }

    });

    I suggest simply ditch completely Swing code and use alerts 8u40 which originate in JavaFX Java (it will work only in Java8u40 +):

    Alert alert alert = new (Alert.AlertType.ERROR, "Invalid input");
    alert.showAndWait ();

    Even better perhaps is to not create windows separated for validation errors.

    Third party frameworks can help provide the user interface for online validation ( FXForm2, JideFX with the Developer's guide, ControlsFX, etc.).

  • Code review for Oracle 11 g Administration Dataguard

    Can all give the code to review for exams for Oracle 11 g Dataguard Administration code.

    Thanks in advance.

    There is no review of Data Guard 11g.  The review of Data Guard Administration 12 c is 1Z0-066:

    Exam1Z0-066

  • Oracle Database 11 g: Introduction to SQL - what his Code review?

    I have read from Oracle Database 11 g: SQL Fundamentals I and book II. Should what test I take?

    user11164565 wrote:
    I have read from Oracle Database 11 g: SQL Fundamentals I and book II. Should what test I take?

    Hmmm, I know, that there is no such book text... which is its ISBN number?

    Also reading is not enough, you must be practiced.

    Please read confirm you have read the announcements forum especially the road you choose [http://forums.oracle.com/forums/ann.jspa?annID=1122]

    Are also studying the certification website, [www.oracle.com/education/certification]... reviews-list all reviews... and drill on those which appear to be relevant.

  • Reg: Validation of the PL/SQL codes-

    Hi Experts,

    Need some ideas/advice about a tool " check/validation of the code syntax .

    Is it possible - to create a PL/SQL procedure (for example, ' X') where the i / p will be any creation of the Table or procedure script. X will check the syntax and any other coding loophole postings.
    In fact, we have a lot of overhead of manual checking the code for some best practices of coding. Just so desirable to automate their in a proc X.
    Can be written Regexs or any other way... a few checks as -.
    + 1] + CREATE or REPLACE PROCEDURE < schema_name >. < proc_name >
    Usually developers here avoid the schema name.

    + [2] + good Exception blocks with no. SO that OTHER THEN NULL;

    Is it really feasible or I'm just too think?

    (I have access to 10g and 11g databases).

    Please suggest some ideas. (from now on, I've tried for a windows batch script that will check for the validation of the scripts stored in a folder that + .txt)
    Help much appreciated.

    Vanessa B.

    nordine B wrote:
    The words were really wonderful, Etbin. Thank you!

    But, naming conventions g_ , v_ and . can never (mostly) right change..?
    So just try to find something like that.

    Start a simple tool and gradually increase the complexity.

    Or, do you have any other tool in mind which can reduce the daily effort?
    No matter what tool you find really useful and interesting development - to facilitate the daily efforts

    FYI - we have one tool, input a proc/table gives all other objects related to IT... same indexes, triggers, etc. Something new as this ;)

    When I was a 'Developer' (we called the postion "Programmer/Analyst"), we spent a lot of effort on the naming of standards. And given that the standards have been published and known by all programmers in the shop, catch violations has been easy to do during code reviews, even if it wasn't the purpose of focus or the destination of the revision of the code.

    So, if you are doing critical business logic code and you have a manual of standards published to cover the naming conventions, etc., then standards will be a trivial addition to a revision of the code "business logic". I think that you are pursuing a solution in search of a problem. I know it's hard for the younger generation to accept, but sometimes automation is simply not the solution. Or at least not the optimal solution.

    In fact, there is a little human psychology comes into play. If you have published standards, you don't even have to do "compliance" of the order of the day on a revision of the code "business logic". Developers will be quick to them yelling, and the fear of this will help the grip in the car in the first place. This is a factor that is not understood by computers or human beings who believe that computers are the solution to everything.

    That said, he has there the tools that will help identify some problems. SQL Navigator is one that comes to mind.

    Published by: EdStevens on February 17, 2013 18:19

    Published by: EdStevens on February 17, 2013 18:22

  • The create a System Image will save the FPGA code and the RT code?

    I have some cRIO systems which were broadcast in our manufacturing plant for some time. A slight problem has been discovered in the programming and created a workaround solution, but a fix should be implemented. Currently, I have no way to test my new code without loading on the cRIO and it works on the tool while the product is running. If there is a problem and I need to do some debugging, the tool cannot be down for an extended period. I would write a vi that will save an image of the cRIO so I can reload the software that is currently running and prevent a situation of prolonged downtime.

    My question is, when I did in the past with a product that has different tests, calibration and the final client software RT, it seems that the code FPGA not be saved (not a big deal at the time since the new FPGA code was compatible with different deployments RT). The new FPGA code won't be compatible with the old RT software, so now I'm worried. I would like to just check on it until I have all the boss breathing down my neck. If the service will not save the bitfile FPGA, is there anything else I can do for the tool to return to the previous running state while I solved problems that may exist with the new code review? The original code was lost by my predecessor. Otherwise, I would use just that.

    Hi Jeremy,.

    You are right, because the create a System Image does not record the bitfile with the image of the RT. Using the configuration system API, you will need to deploy the RT image and then the bitfile FPGA compiled later. To ensure that you can return to the previous version of the software running on your RIOs, you could simply save the current image and bitfile before deploying the new image and bitfile.

    However, the best way to proceed is to use replication Deployment Utility (RAD of OR). I have provided the link to the tutorial on the wheel, where you can download the utility. This exe will make images of the any of your RT targets and will also include the bitfiles with them. You can also deploy these images to several targets at once. In particular, you can read about the Bitfile (s) configure for FPGA Deployment Flash; the bitfile will be deployed at the start when stored in flash memory.

    Replication and deployment (RAD) utility-

    http://www.NI.com/example/30986/en/

  • I don't see any review of Vmware Vsphere CIM 5.1. they renamed to this review?

    I don't see any review of Vmware Vsphere CIM 5.1. they renamed to this review?

    Certification for vSphere 5.1 is VCP5-VTC (she was previously VCP5), the code review remains VCP510

    More details here: Virtualization VCP-Datacenter (VCP5-VTC)

  • Examples of pl/sql code that can be used in training for new developers

    Hello

    I'm working on a training ride on the pl/sql to some developers who are totally new to PL/SQL. Although they are experienced in another language. I have power point on pl/sql presentations, but they especially the theory oriented with just a few examples. I'm looking for more help to have a few example pl/sql that can be given to interns as the code for example and also to practice. It should be a bit detailed and like to print the odd numbers or print "hellp world." Can anyone help to suggest if there is an example of code that is a bit detailed with a kind of complex problem which will give students a hands good example? I see a nice example at this link: http://tucano.tucanowebdesign.com/oracle/tutorial5.html - on an inventory system. It gives the feeling of being one on the issue of real-world work. So that if anyone knows of some other example say about 150 t0 300 lines or so of the code, I'll be grateful if it is shared.

    Thank you

    OrauserN

    That said, I feel again (my perception) that more code a person writing/comments the better he gets. So, I want students to examine several code examples. I guess I need to see some books to bring out some really long piece of PL/SQL - like case studies.

    . . .
    But these guys are too busy and so I try to find the net / books some really detailed examples.

    But you seem to be overlooking that PL/SQL is supposed to be used for: PL means "procedural language.

    So, PL/SQL must be used to 'procedure' treatment; This is typically several process steps. For example, when you want to run three applications as a "TRANSACTION". If all three completed successfully you COMMIT and if any of the three you don't ROLLBACK.

    You can do this by using SQL only. And a developer doesn't have to write the code until they have a technical requirements doc that explains what problem the code is supposed to solve and the constraints and requirements that the code must implement.

    So, my suggestion is the following:

    1. identify and teach the types of issues that PL/SQL is used to help solve. Multi-step transactions, I mentioned above is an example

    2. use the documentation and the code of your own organization in the form of samples. These 'guy' is perhaps too busy, but they should be able to provide to you all the documents for the code they wrote and that you use which would be good to use as examples. If they have no documents technical requirements so you just identify a MAJOR gap in the operations of your org that you must bring to the attention of management.

    3. you can provide value added a lot more if you use code from your own org as a basis for what you are doing. A very useful training exercise is to ask students to perform 'code review' of a code (a procedure or function) and write simple comments, one line that explain, in plain English, what makes each piece of code.

    4 comments, students create to step #3 can actually be incorporated into your code then existing so that future developers can use these comments to understand what the code actually does.

    5 part of your 'education' should be on the way to 'test' correctly a piece of code PL/SQL to make sure it is doing what it is supposed to do. Again, if your students actually your own org code allows to create tests, these tests can then be added as a result of 'test' for this application and that adds value. A lot of times those developers 'busy' will not create the actual test cases and that your students can help remedy that. In addition, it does no good to know how to write PL/SQL code if you don't know how to test properly.

  • Java code to extract data from a custom table to form

    I need to transfer data from one table to the form. Please provide the java method to do this. The table has 4 columns. I need to fill in all the data form as level. It will be a great help if sombody can provide the same java code and the logic of xpress to achieve the same.

    Please refer to the documentation for the com.waveset.util.JdbcUtil API. The class has functions for the features you need.

  • Drag and drop interaction - logical flaw

    Hello

    I hope help to smooth out this little piece of code. My logic is somehow screwed up.

    I have 10 clips and 10 targets. The user is dragging the clips for targets, and when dropped on a target, the clip locks in place at the x and the y coord of the target.


    The code below allows the user to drop the clip onto its corresponding target; that is to say:

    -droppedClip1 can only be dropped on hitTarget1
    -droppedClip2 can only be dropped on hitTarget2
    -etc.

    How can I change the code so that the droppedClip can be placed on any of the 10 targets?

    Ty for any help,
    ~ chipleh

    //droppedClip = movie clip the user just dropped
    //totalClips = total number of draggable clips
    function evaluateDroppedClip(droppedClip:Object,totalClips:String):void
    { 
     for (var i:Number = 0;i<Number(totalClips);i++)
     {
      var hitTarget:Object = objectContainer.getChildByName("hitTarget" + i);       
      if(droppedClip.hitTestObject(hitTarget))  
      {           
       trace("hitTarget = " + hitTarget.name);            
       droppedClip.x = hitTarget.x;
       droppedClip.y = hitTarget.y;      
      }else{
       droppedClip.x = droppedClip.xPos;//the original position of the dropped clip
       droppedClip.y = droppedClip.yPos;//the original position of the dropped clip   
      }
     }
    }
    


    I did not try to interpret what your additional coding is trying to accomplish.  Your original publication aims to allow an object slipped to be dropped on a target and stick.  So I'd head back to what you did initially and start here with what I already offered.  Assign a property to each of your targets, name it 'isTarget' or something and set it to true.  If the target isTarget property is true, and if so, leave this field then test in the first conditional.

  • transaction in a procedure

    Hello
    I've implemented this procedure but I don't know about the syntax.
    I have 4 operations. The examples I've looked at don't seem to have the 'end' between each transaction. I don't know how word error messages, I have I don't have one, when you insert values.
    I think I have the right to record.
    An example I looked said to name the transaction as I did and the other example said to set the name of the transaction to 'rollback_rs1.
    Is how important it?
    I have to name each transaction (1,2,3,4)? I do not think, but yet again, I'm not sure.
    I use oracle 10.2.0.3
    Here is the table, it is emptey at this time.
    {code}
    Catalogue of DROP TABLE CASCADE CONSTRAINTS;
    CREATE TABLE catalog
    (NUMBER OF NOCS,
    Varchar2 (25) CTITRE,.
    CREATED_BY varchar2 (30),
    CREATED_DATE date,
    UPDATED_BY varchar2 (30),
    Date of UPDATED_DATE);
    {code}

    my surgery is lower with comments where I don't know if I'm right.
    -It comes to question3. create a procedure
    -who will perform the operations of insertion of values in the catalog table.

    {code}
    CREATE OR REPLACE PROCEDURE week_11
    Start
    Set transaction read write catalogue name - is that correct?

    Insert into catalog
    VALUES ("cmis420", "Advanced Relational Database", "Bill Warren', sysdate,"Jean Todd", sysdate);
    Insert into catalog
    VALUES ('CMST385', 'Introduction to XHTML', 'Terry Woods", sysdate, 'john Miller', sysdate);

    SAVEPOINT cmis420_cno;

    EXCEPTION - is this true or do I have to use the clause "IF"?
    while others then
    dbms_output.put_line (SQLERRM);
    Rollback; -If an error occurs rollback.
    -I don't know how to do this part... display message if an error occurred, then roll back the transaction.

    Insert into catalog
    VALUES ('cmst170', 'Introduction to XML', ' richard Jones, sysdate, 'Mary Smith', sysdate);
    Insert into catalog
    values ('CMIS315', "Programming in C++", "richard Jones, sysdate, 'Paul Todd', sysdate);
    SAVEPOINT cmst170_cno;
    exception
    while others then
    dbms_output.put_line (SQLERRM);

    Rollback; -If an error occurs rollback.
    -I don't know how to do this part... DisplayMessage if an error occurred, then roll back the transaction.


    Insert into catalog
    values ('CMIS111', ' Social Networking and cybersecurity best practices, "Terry Woods", sysdate, 'john Miller', sysdate); »
    Insert into catalog
    values ('CMIS125', in Programming', sysdate, c# ', "richard Jones, sysdate, Peter Greenburg, sysdate);
    SAVEPOINT cmis111_cno;

    exception
    while others then
    dbms_output.put_line (SQLERRM);

    Rollback; -If an error occurs rollback.
    -I don't know how to do this part... display message if an error occurred, then roll back the transaction.


    Insert into catalog
    values ('CMIS225', 'Windows Presentation Foundation (WPF) development', "George Allen", sysdate, 'Richard Jones' sysdate);
    Insert into catalog
    values ('CMIS465', 'Software' and Validation, sysdate, 'Bill Warren', sysdate, "Jean Todd");

    SAVEPOINT cmis225_cno;

    exception
    while others then
    dbms_output.put_line (SQLERRM);
    backup restore point cmst170_cno; -If an error occurs rollback transaction 2 using the restore.
    -I don't know how to do this part... display message if an error occurred, then roll back the transaction.
    end;
    commit;
    {code}

    I appreciate any help you can give
    kabrajo

    Published by: BluShadow on August 15, 2011 13:00
    Add tags {noformat} {code} {noformat}. Please read {message identifier: = 9360002} to learn how to do it yourself.

    Closer-
    If you want an exception handler in the inserts, you use this structure:

    BEGIN
        (your code, inserts, whatever)
    EXCEPTION
         WHEN (what you are trapping)
    END;
    

    If you are missing this syntax.

    Insert into catalog
    VALUES ("cmis420", "Advanced Relational Database", "Bill Warren', sysdate,"Jean Todd", sysdate);
    Insert into catalog
    VALUES ('CMST385', 'Introduction to XHTML', 'Terry Woods", sysdate, 'john Miller', sysdate);

    EXCEPTION
    WHILE OTHERS THEN


    DBMS_OUTPUT. Put_line (' error insertion class: ': substr (SQLERRM, 1, 75));
    ROLLBACK;

    I don't know your needs, but you should review the logic here and see if that's really what you intend to happen. You do: insertion of 2 lines. If there is an error message on the screen. Then, because ERROR has BEEN HANDLED, your program will pronounce on the next 2 inserts, etc. If that's what you intend, very well, but from my experience, this is not the typical requirement.

    It is also very important out of the habit of using SO many OTHER as your exclusive exceptions management method. Much more appropriate in this case would be:

    WHEN DUP_VAL_ON_INDEX THEN    (whatever particular error you might raise)
         (insert or whatever)
    WHEN OTHERS THEN
         (code for something unexpected)
    END
    

    If you have access, I highly recommend you PL/SQL of Steven Feuerstein, programming books - starting with "Oracle PL/SQL Programming" - they are very clear, use step by step explanations syntax and correct usage and I think I have more information on the net that you can download to use with examples in the book. I learned all that I know (PL/SQL) Steven. This can reduce the confusion see several examples that have discrepancies in the documentation.

    Good luck!

  • How to access the instance property of the main class via child class

    Hi I hv done 3 classes objecthandler, box and nav

    NAV is child chass objecthandler, I hv make an instance of objecthandler box and now I want to access the property of box via NAV... See the code

    Class Objecthandler

    package code {}
    import flash.display.MovieClip
    import code.box
    import code.nav

    public class objectHandler extends MovieClip {}
    public var container: box
    public var navigation: nav

    public void addObjects() {}

    Navigation = new nav()
    addChild (navigation)
    navigation.addEvents)
    navigation.x = 275
    navigation.y = 400

    container = new box()
    addChild (container)
    putcontainer ("default")< < works well here
    }
    public void putcontainer(page:String) {}
    Container.OpenPage (page) < < when this function is executed it returns ("page is open"+ page)
    }
    }
    }

    Class of NAV

    package code {}
    import flash.display.MovieClip
    import flash.events.MouseEvent
    import flash.display.DisplayObjectContainer
    import code.box

    public class nav extends objectHandler {}
    public void nav() {}

    }

    public void addEvents() {}
    homeBtn.addEventListener (MouseEvent.CLICK, releaseFun)
    galleryBtn.addEventListener (MouseEvent.CLICK, releaseFun)
    productsBtn.addEventListener (MouseEvent.CLICK, releaseFun)
    contactBtn.addEventListener (MouseEvent.CLICK, releaseFun)
    }

    public void releaseFun(event:MouseEvent):void {}
    putcontainer(Event.currentTarget.Name) < < showing the error over here
    }
    }
    }

    You should review your logic.

    It is not supposed have nav extend objectHandler and then has an objectHandler method that creates a new instance of nav.

  • In the bar of windows svn revision number

    Hello

    I think about the possibility of putting on the application toolbar (exe) SVN revision number. I would be characteristic of the usueful to quickly assess, what source application, code review is to build in.

    What I need is therefore a kind of trigger/interface that I could use to launch scrap one code that modify the bar of the application window when the application is being built. I thought to prepare the chain using the Exec.vi system (to run the command - st svn.exe to get the information I need). But how is it I can impose on LV to trigger this code only when the build operation starts?

    Or maybe I'll use different approach?

    Hello

    in the build specification, you can run a VI prior to construction.

    So if you know how to find the svn revision number, you can call a vi that change the name of your VI main when you build the exe...

    I think it is the right way! :-)

    Best regards

  • Projects and project libraries

    I have luckily been using projects since their introduction in LabVIEW 8 - something.

    I have a project whose job is to look at the trees of directories containing the other screws in some cases, screw my code reviews have the same name as a screws used in the code (I am slot in development, not of an executable Mode).  To avoid "name conflicts", I did a search on and learned namespaces on the project libraries.

    So I have brought successfully on all the files in my project in a project the same library name.  The code works fine.

    Today, I opened my project to watch one of my screws, and to my horror, the project had No files showing.  He also did not show the library project (where I "knew" all the files are located).  A little worried, I looked on my drive and found the project library file (.lvlib) - if I double-click on it, there are my files!

    What I do have trouble (maybe because it's impossible!) becomes an 'inside' view of my library of Project Explorer project.  In view of the close relationship between the projects and the project libraries (the second is created from the beginning, for example), I expected to see such a link.  Are there?  Or are you expected to open both a project (which, in my case, has files that are not in the project library) and the corresponding project library?

    Note that I did a search in the Documentation OR on the project libraries, and what I've read has pointed out the close relationship between a project and an associated project library, including giving them the same (or similar) name and now the files in the same folders.  [Hmm - I just realized I did not name my project and the library identically - I called the project "Project XYZ" and the "Library XYZ" library project...].

    Experience "on the ground" would be welcome!

    Bob Schor

    The library project is just an xml file containing links to all of the objects that make up the project. A .lvlib is also an XML file that contains links to the objects he owns. Screws are marked as belonging to a library. They do not belong to the project. If the .lvlib is included in the project, you will be able to expand to see the items it contains. You don't need to have a project to create a .lvlib. You can create a file/new in the getting started window. You can drag any .lvlib in a project as you can a VI. You shouldn't screw that contains a .lvlib existing in the Project Explorer. Also remember that the .lvlib contains no screws or other objects. If you open it in Notepad, you will see a list of objects.

    What probably happened, is that you did not save the .lvproj after creating and adding the .lvlib. All you would have to do is find the .lvlib in Windows Explorer and drag it to your project.

  • under condition of read/write terminals on the side of the connector (basic training 3)

    Hello

    During my practice towards the review of the CLD, I examine the Core 3 online training material too. I just read a few tips of 'best practices' on the forum, for example this post:

    http://forums.NI.com/T5/LabVIEW/Community-Nugget-wired-terminals-in-subdiagrams-clearing-up-the/m-p/...

    It should be noted, that we should not use terminals (which are on the connector pane) to the inside of while loop or condition of the structure. Neither control, nor indicators (read/write terminals): "terminals conditionally read or written on the side of the connector are BAD!"

    I can find many examples in the online training materials, when the indicators and controls are placed inside while loop and the case of structures in a Subvi.

    I guess I should not do this during my review of the CLD, as they will run benchmark on my project? Should not be the core training materials updated some time? Or it's just not too important to have terminals on the outside? I would lose points during the CLD Exam my project as in the Core 3 screws?

    example 1: Core 3, exercise 4-6 design of an error-handling strategy:

    EDIT:

    What's even more ugly in this project, is that, in the case of 'Get empty Cue', the Cue output indicator is updated via a local variable, because the indicator is not accessible via 'outside ': wire

    Nice catch on the training material.  that the application would take an if subject to a review of the CLD test graders.

    As noted in the nugget: sentencing of perfomance for conditionally reached terminals is a function of the size of the data.  So, it is sometimes acceptable for simple data.  The larger point being to learn about compromise and make the right choice for your code.

    Preping for the CLD on other means of hand knowing that VI Analyzer will run on your project.  Like any other code review you walk in - know the guidelines for the review and code to ' review ' as well as 'reply spec.'

    I've not seen an instance where an example of shipping (2013 and later versions) would fail this test VIA (there are a few screws deep inside the vi.lib which can date back to before the adoption of this recommendation from style)

Maybe you are looking for

  • I forgot my password what I do

    I have an old iPad I have not used. It includes games for children. I forgot the password and have been able to unlock now the iPad is disabled. Help please!

  • Best way to make this step motor control system

    The goal of my project is to have real-time data collected by a controller of Sir 158u Dataq a stepper motor.  I grappler planned on executing it with the basic stamp, but I realize that's not possible.  I have a stepper motor and a L293DNE driver.  

  • Printer gives error "Ink system failure" 0xc18a0206

    printer error my printer HP C7150 model all in a room "ink system failure" error 0xc18a0206. After following the suggestions of assistance and support, nothing has changed!

  • Update of table after SELECT COLLECT in BULK IN

    HelloI have the following query       SELECT TYPE(A, B, C, D)       BULK COLLECT INTO ARRAY_TYPE_VAR       FROM table       WHERE ROWNUM <= number; And after execution of this I need to update the selected lines to mark as processed.       UPDATE tab

  • Photosmart C4599: How change the language after it has been initialized?

    After searching 'language', I found: -c00313570 indicates bpu01868: no longer exists. Ring may not be withdrawn. I tried to reset the printer in order to have the ability to select the language, but... -c01369750: indicates that you must press "OK" a