Problem with IN/Decode combination

Hi,
Can we use DECODE function with a query in an IN operator???
e.g
select ename, sal
from emp
where job in
(decode(v_job, 'C', 'Clerk', 'S', '''Salesman'''||','||'''Systems Analyst'''||','||'''Software Engr'''));
Its not returning me the records in case of 'S'. What is wrong with this query?
Need urgent help.
Thanx in advance!
Zaaf

> But I still wonder what was wrong with the actual query.
Your where clause,
where job
  in (decode(v_job, 'C', 'Clerk',
     'S', '''Salesman'''||','||'''Systems Analyst'''||','||'''Software Engr'''));translates to:
where v_job='C' and job='Clerk'
   or v_job='S' and job='*Salesman*,*Systems Analyst*,*Software Engr*'But I have replaced the apostrophes with asterisks to illustrate what you were trying to do.
In other words, you were looking for JOB equal to the following 44 characters, including the quotes and commas:
'Salesman','Systems Analyst','Software Engr'

Similar Messages

  • Problem with Shift + Z + é combination

    Hey guys
    I've decided to ask this here, since I've been searching for a solution for 2 days now.
    I'll admit, it's for a game I really enjoy playing, where I have to press 3 keys at the same time.
    The 3 keys are shift + z + é, but when I do shift + z, I can't press é or when I press shift + é, I can't press z.
    The strange thing is, it works with every other combination for letter + number.
    Could anyone help me? I've tried turning off all the keyboard combinations, but the bug still appeared, so that's not the problem.
    Thanks!
    Michael H

    Thanks for your answers.
    But I thought I'm indexing the array from the last loop-step (therefor the shift-register). The help says, insert into index resizes the array.
    And why has the output-array of the following vi a length of 6?
    The only thing I changed is the index-source.
    Attachments:
    bug-shiftregister2.vi ‏16 KB

  • Problem with URLDecoder.decode(s, enc)

    Hi!
    I'm having problems with the URLDecoder.decode(s, enc) method... When I send a string, encoded with the Javascript escape() function, to the server side of my application, I get a problem decoding it using this:
    myString = URLDecoder.decode(myString, "iso-8859-1");It gives me this error: URLDecoder: Illegal hex characters in escape (%) pattern - For input string: "u2"
    My html defines the encoding as follows:
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />The string being submitted contains a special apostrophe ( ' ) copy/pasted from MS Word wich then translates it as %u2019 (what's that??? Unicode???).
    Can anyone tell me what is happening? How can I encode / decode this properly?

    I'm having exactly the same issue.
    Did you solved the problem?
    Regards,
    Gabriel

  • Problem with 5700 decoder

    Hey everyone, I'm new here! I have had the 5700 speakers with decoder for about 2 years now. All of a sudden, my decoder stopped working. I just woke up this morning and it wouldn't work. The power button does nothing. When I plug in the power cord, all the lights on the decoder come on and stay like that. There is no sound, nothing. Is there something I can do to fix this? Thanks for any help.

    My Friend,
    I have a post on here titled " inspire 5700's are junk" and it sounds like you have the same problem with your's as I had with mine. The digital decoder has gone out and because they are more than year old creative will not do anything about it ( I know from experience after dealing with them their attitude is too bad too sad) so there are two ways to deal with this problem ) get lucky and find someone who has one to sell ( like on e-bay) or plug in a whole bunch of audio cables and go analog, ( although this defeats the reason for spending alot of money on a digital card and speakers) other than that I can't give you much more advice except to say I know what you are going through. Maybe if enough people out there have the same problem with their systems, Creative will relieze that maybe there really is a problem here and they will take care of it ( like fixing it at no charge to us) I doubt it but it is a nice thought. Good luck.
    Mr. dave
    P.S. I packed mine away and bought a set of Klipsch speakers and they sound EXCELLANT!!.

  • Problems with nio decoder need help plz

    I want to make a flash/php chat Client with Java Server with the new nio.
    Problem is to Convert a Bytebuffer into a normal string.
    I done this with the charsetdecoder and it works...
    if i give the string with system.println out it will be the right string. but i cant use the string with the if method..
    my source:
    php:
    $nick="Nerrik";
    $host = "localhost";
    $data="-".$nick.";$REMOTE_ADDR";
    $fp = fsockopen($host,1120);
    fwrite($fp, $data,strlen($data));
    fclose($fp);
    java:
    import java.io.*;
    import java.net.*;
    import java.util.*;
    import java.nio.*;
    import java.nio.channels.*;
    import java.nio.charset.*;
    public class newserver
    Charset charset = Charset.forName("ISO-8859-1");
    CharsetDecoder decoder = charset.newDecoder();
    CharsetEncoder encoder = charset.newEncoder();
    ByteBuffer buffer = ByteBuffer.allocateDirect(1024);
    CharBuffer charBuffer = CharBuffer.allocate(1024);
    String[] user=new String[100];
    String[] user2=new String[100];
    private Selector readSelector;
    public void start() throws Exception
    System.out.println("Server Gestartet...");
    System.out.println("Protokoll aktiv");
    SocketChannel client;
    readSelector=Selector.open();
    ServerSocketChannel channel=ServerSocketChannel.open();
    ServerSocket socket=channel.socket();
    socket.bind(new InetSocketAddress ("localhost",1120));
    channel.configureBlocking(false);
    while (true)
    client=channel.accept();
    if (client!=null)
    client.configureBlocking(false);
    client.register(readSelector,SelectionKey.OP_READ);
    handleClientRequest();
    public void handleClientRequest() throws Exception
    Set keys;
    Iterator it;
    SelectionKey key;
    SocketChannel client;
    if (readSelector.selectNow()>0)
    keys=readSelector.selectedKeys();     
    it=keys.iterator();
    while(it.hasNext())
    key=(SelectionKey)it.next();
    if(key.isReadable())
    client=(SocketChannel)key.channel();
    buffer.clear();
    charBuffer.clear();
    client.read(buffer);
    buffer.flip();
    decoder.decode(buffer, charBuffer, false);
    charBuffer.flip();
    String em = charBuffer.toString();
    String aktion = em.substring(0,1);
    if(aktion=="-")
    //this don't come and em.substring(0,1) is -
    StringTokenizer st = new StringTokenizer(em,";");
    System.out.println("New Client:"+st.nextToken()+" on IP:"+st.nextToken());
    client.close();
    public static final void main(String args[]) throws Exception
    (new newserver()).start();
    sorry for my bad bad english ;)

    The code segment...
    if(aktion=="-")
    //this don't come and em.substring(0,1) is -
    StringTokenizer st = new StringTokenizer(em,";");
    System.out.println("New Client:"+st.nextToken()+" on IP:"+st.nextToken());
    will always return false. You are comparing the object reference of aktion to "-". The code should read:
    if(aktion.equals("-"))
    //this don't come and em.substring(0,1) is -
    StringTokenizer st = new StringTokenizer(em,";");
    System.out.println("New Client:"+st.nextToken()+" on IP:"+st.nextToken());
    The reason why it works when you hard code the values is because the Java comiler will only keep one object for each String literal. Thus:
    String aTest = "test";
    aTest=="test"; // This will return true but
    String aTest = getStringFromWhereElseThatIsTest();
    aTest=="test"; // Will most likely return false
    - Chris

  • Problems with 'ProtectDoubleSubmit' in combination with 'TableView'

    Hello all,
    maybe there is someone around who can help me with the following problem:
    I am using a tableview (based on a table) with an additional column with an image ('dustbin'). When the user clicks on it the user deletes the chosen row.
    It works perfectly well unless I include 'ProtectDoubleSubmit'. The 'ProtectDoubleSubmit' leads to a different behaviour of the event that is triggered when the user clicks on the u2018dustbinu2019-image:
    lr_event = cl_htmlb_manager=>get_event_ex( request ).
    Without 'ProtectDoubleSubmit' i get an event with the expected event_class CL_HTMLB_EVENT_TABLEVIEW (with column and row index which I need for my delete activity).
    With 'ProtectDoubleSubmit' I get an event with the event_class CL_HTMLB_EVENT with event_name = u2018imageu2019!. I dont get the information which cell i clicked on.
    Has anybody an idea how this comes and how I can avoid this behaviour?
    Do I have the chance to redefine/change the class CL_XHTMLB_PROTECTDOUBLESUBMIT in a way that I can avoid the problem? I had a look in that class, but unfortunatly I do not understand the logic how 'ProtectDoubleSubmit' works.
    Thanks in advance for your efforts!
    Frank

    Hello Chandra,
    thanks for your answer.
    Unfortunatly the link didnt help in my case. I implemented javascript function in onClientClick for the image as described but without effect. The class of the event stayed the same...still the general event from class CL_HTMLB_EVENT. Do you have any other idea or would you need some other information?
    Thanks!
    Frank

  • Problem with Adobe Decoder ST 7.5 - decoding error

    Hi all,
    I have an Adobe LiveCycle Barcoded Forms ST version 7.5 installed on
    Windows XP. While trying to decode a barcoded pdf it logs the following
    AdobeException: "Error in the PDF library."
    The same pdf file is successfully decoded on Adobe LiveCycle Barcoded Forms ST version 7.0.
    I've try to design the barcoded pdf with Adobe Designer 7.1 and 8.0 the decoding error is the same with Adobe Barcoded Forms 7.5.
    I'll be very thankful for any kind of information about it.

    Hi Lee,
    I'm decoding a PDF that was filled, then saved without printing or scanning.
    I create it with Adobe Designer 8.0, after that I'm adding it all rights (including 2D barcode decoding) with ReaderExtension 7.2. During the execution I have an error in the ReaderExtension console - "ERROR: document does not have certifying signature".
    After that I'm filling and saving the extended pdf file with Adobe Reader 7.0.5, then I put the filled file in the input directory of the decoder and I receive the decoder error.
    I'll send you the file.
    Thank you very much.
    Stanislava.
    P.S. The ReaderExtensions and Barcoded Forms Decoder are both installed on Windows XP (one computer).

  • Photoshop has problem with .JPEG decoding ??

    There seems to be an issue with either JPEG decoding in Photoshop or the blend modes don't work as they should. Or maybe someone finds the true reason ... ?
    Let's go step-by-step:
    This is the original image file (JPEG):
    This is the same image converted to .png:
    I examined the differences. Open one image and add the second image as a new layer over it with blend mode = difference. Use magic wand tool, with tolerance=zero. Expected results: entirely black image, entire image selected. Actual esults (white filled selection):
    [IMG]http://img372.imageshack.us/img372/694/differencepg1.png[/IMG]
    Merge both layers, invert the colors and you see the differences between the images. I applied a curves adjustment to exaggerate the differences:
    [IMG]http://img241.imageshack.us/img241/1995/difference2zw5.png[/IMG]
    Again, this time you should see an entirely white image, if both images were identical.
    The JPEG-to-PNG conversion was done with a third party image viewer that I trust. Obviously, the possibility exists, that this conversion is not exact/losless. But I can refute this, as I converted both the source JPEG image and the converted PNG image to BMP images, and the two files that were obtained this way were bit-for-bit identical:
    So it's impossible that any loss occured, given that in the a losless reconstruction was possible.
    Thus the error must be somewhere within Photoshop.
    Any ideas?

    There seems to be an issue with either JPEG decoding in Photoshop or the blend modes don't work as they should. Or maybe someone finds the true reason ... ?
    Let's go step-by-step:
    This is the original image file (JPEG):
    This is the same image converted to .png:
    I examined the differences. Open one image and add the second image as a new layer over it with blend mode = difference. Use magic wand tool, with tolerance=zero. Expected results: entirely black image, entire image selected. Actual esults (white filled selection):
    Merge both layers, invert the colors and you see the differences between the images. I applied a curves adjustment to exaggerate the differences:
    Again, this time you should see an entirely white image, if both images were identical.
    The JPEG-to-PNG conversion was done with a third party image viewer that I trust. Obviously, the possibility exists, that this conversion is not exact/losless. But I can refute this, as I converted both the source JPEG image and the converted PNG image to BMP images, and the two files that were obtained this way were bit-for-bit identical:
    So it's impossible that any loss occured, given that in the end a losless reconstruction was possible.
    Thus the error must be somewhere within Photoshop.
    Any ideas?

  • Having problems with JPassword fields combined with terminalIO

    i copy pasted the code from the java tutorials of the JPasswordField program PasswordDemo. the code is found here... http://java.sun.com/docs/books/tutorial/uiswing/components/examples/PasswordDemo.java
    then i went to the part that defines what the program does if the password is correct and copy pasted one of my programs in. i did this twice. one with a terminalIO program and one with a JOptionPane program. for some reason the JOptionPane works but the TerminalIO freezes the program and does not allow me to type anything into it. Does anybody have any sugestions on how to fix this other than translating the code to a JOptionPane program?
    any help is greatly appreciated.

    and this is the whole program so that you can put it into an editor:
    import TerminalIO.KeyboardReader;
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    /* PasswordDemo.java requires no other files. */
    public class PasswordDemo extends JPanel
    implements ActionListener {
    private static String OK = "ok";
    private static String HELP = "help";
    private JFrame controllingFrame; //needed for dialogs
    private JPasswordField passwordField;
    public PasswordDemo(JFrame f) {
    //Use the default FlowLayout.
    controllingFrame = f;
    //Create everything.
    passwordField = new JPasswordField(10);
    passwordField.setActionCommand(OK);
    passwordField.addActionListener(this);
    JLabel label = new JLabel("Enter the password: ");
    label.setLabelFor(passwordField);
    JComponent buttonPane = createButtonPanel();
    //Lay out everything.
    JPanel textPane = new JPanel(new FlowLayout(FlowLayout.TRAILING));
    textPane.add(label);
    textPane.add(passwordField);
    add(textPane);
    add(buttonPane);
    protected JComponent createButtonPanel() {
    JPanel p = new JPanel(new GridLayout(0,1));
    JButton okButton = new JButton("OK");
    JButton helpButton = new JButton("Help");
    okButton.setActionCommand(OK);
    helpButton.setActionCommand(HELP);
    okButton.addActionListener(this);
    helpButton.addActionListener(this);
    p.add(okButton);
    p.add(helpButton);
    return p;
    public void actionPerformed(ActionEvent e) {
    String cmd = e.getActionCommand();
    if (OK.equals(cmd)) { //Process the password.
    char[] input = passwordField.getPassword();
    if (isPasswordCorrect(input))
    KeyboardReader reader = new KeyboardReader();
    System.out.println("Enter a number: ");
    int theInteger = reader.readInt();
    System.out.println(theInteger);
    else {
    JOptionPane.showMessageDialog(controllingFrame,
    "Invalid password. Try again.",
    "Error Message",
    JOptionPane.ERROR_MESSAGE);
    //Zero out the possible password, for security.
    for (int i = 0; i < input.length; i++) {
    input[i] = 0;
    passwordField.selectAll();
    resetFocus();
    } else { //The user has asked for help.
    JOptionPane.showMessageDialog(controllingFrame,
    "You can get the password by searching this example's\n"
    + "source code for the string \"correctPassword\".\n"
    + "Or look at the section How to Use Password Fields in\n"
    + "the components section of The Java Tutorial.");
    * Checks the passed-in array against the correct password.
    * After this method returns, you should invoke eraseArray
    * on the passed-in array.
    private static boolean isPasswordCorrect(char[] input) {
    boolean isCorrect = true;
    char[] correctPassword = { 'b', 'u', 'g', 'a', 'b', 'o', 'o' };
    if (input.length != correctPassword.length) {
    isCorrect = false;
    } else {
    for (int i = 0; i < input.length; i++) {
    if (input[i] != correctPassword) {
    isCorrect = false;
    //Zero out the password.
    for (int i = 0; i < correctPassword.length; i++) {
    correctPassword[i] = 0;
    return isCorrect;
    //Must be called from the event-dispatching thread.
    protected void resetFocus() {
    passwordField.requestFocusInWindow();
    * Create the GUI and show it. For thread safety,
    * this method should be invoked from the
    * event-dispatching thread.
    private static void createAndShowGUI() {
    //Create and set up the window.
    JFrame frame = new JFrame("PasswordDemo");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    //Create and set up the content pane.
    final PasswordDemo newContentPane = new PasswordDemo(frame);
    newContentPane.setOpaque(true); //content panes must be opaque
    frame.setContentPane(newContentPane);
    //Make sure the focus goes to the right component
    //whenever the frame is initially given the focus.
    frame.addWindowListener(new WindowAdapter() {
    public void windowActivated(WindowEvent e) {
    newContentPane.resetFocus();
    //Display the window.
    frame.pack();
    frame.setVisible(true);
    public static void main(String[] args) {
    //Schedule a job for the event-dispatching thread:
    //creating and showing this application's GUI.
    javax.swing.SwingUtilities.invokeLater(new Runnable() {
    public void run() {
    createAndShowGUI();

  • I HAVE ANOTHER PROBLEM WITH MY DECODE

    Here is the following decode in an SQL statement.
    SELECT
    SUM(DECODE(V.LCL_ER_RECV_DT - ADD_MONTHS(V.IND_ER_PER_END_DT,3)) > 0) AND
    ((V.LCL_ER_RECV_DT - ADD_MONTHS(V.IND_ER_PER_END_DT,3)) <= 30),1,0)
    FROM NCOER V, NCOER_IN_ERROR NIE, NCOER_ERROR NE, ALL_CMD_VIEW ACV
    WHERE V.MIL_CMD_ASGN_CD IN ('FC')
    and v.lcl_er_form_cd = '4'
    and acv.cmd_cd = v.mil_cmd_asgn_cd
    and nvl(acv.lcl_code_stat,'N') = 'Y'
    and NVL(v.lcl_omit_from_stats_ind,'N') <> 'Y'
    AND V.PSC_CD IN ('FS10')
    AND (V.LCL_ER_RECV_DT >= '01-MAR_2007' AND V.LCL_ER_RECV_DT <= '31-MAR-2007')
    AND ((V.LCL_ER_RECV_DT - ADD_MONTHS(V.IND_ER_PER_END_DT,3)) > 0) AND((V.LCL_ER_RECV_DT - ADD_MONTHS(V.IND_ER_PER_END_DT,3)) <= 30)
    AND V.IND_SSN = NIE.IND_SSN(+)
    AND V.IND_ER_PER_END_DT = NIE.IND_ER_PER_END_DT(+)
    AND V.LCL_ER_RECV_DT = NE.LCL_ER_RECV_DT(+)
    AND V.IND_SSN = NE.IND_SSN(+)
    AND V.IND_ER_PER_END_DT = NE.IND_ER_PER_END_DT(+)
    AND V.LCL_ER_RECV_DT = NE.LCL_ER_RECV_DT(+)
    I get the following error message ORA-00907 Missing right parenthesis
    I want to sum up all the records when the difference between 2 dates is greater than 0 and less than 30. I know that I can do it by using a COUNT function and without a DECODE but I would like to use a DECODE. How do I go about doing this?

    in DECODE() you cannot include an operators such as the greater than, less than, and/or equal sign.
    instead you can use the CASE...WHEN in the SELECT statement:
    SELECT Sum(case when (V.LCL_ER_RECV_DT - ADD_MONTHS(V.IND_ER_PER_END_DT,3)) between 0 and 30 then 1
                    else 0
               end) as sm
      FROM NCOER V, NCOER_IN_ERROR NIE, NCOER_ERROR NE, ALL_CMD_VIEW ACV
    WHERE V.MIL_CMD_ASGN_CD IN ('FC')
       and v.lcl_er_form_cd = '4'
       and acv.cmd_cd = v.mil_cmd_asgn_cd
       and nvl(acv.lcl_code_stat,'N') = 'Y'
       and NVL(v.lcl_omit_from_stats_ind,'N') <> 'Y'
       AND V.PSC_CD IN ('FS10')
       AND (V.LCL_ER_RECV_DT >= '01-MAR_2007' AND V.LCL_ER_RECV_DT <= '31-MAR-2007')
       AND ((V.LCL_ER_RECV_DT - ADD_MONTHS(V.IND_ER_PER_END_DT,3)) > 0) AND((V.LCL_ER_RECV_DT - ADD_MONTHS(V.IND_ER_PER_END_DT,3)) <= 30)
       AND V.IND_SSN = NIE.IND_SSN(+)
       AND V.IND_ER_PER_END_DT = NIE.IND_ER_PER_END_DT(+)
       AND V.LCL_ER_RECV_DT = NE.LCL_ER_RECV_DT(+)
       AND V.IND_SSN = NE.IND_SSN(+)
       AND V.IND_ER_PER_END_DT = NE.IND_ER_PER_END_DT(+)
       AND V.LCL_ER_RECV_DT = NE.LCL_ER_RECV_DT(+)note: untested.

  • Problem with inspire 5100 digital decoder

    I have some problem with the decoder included with the Inspire 500 digital. I usually have it connected by soundblaster's audigy digital out to decoder's coaxial digital in (SPDIF). and recently sound has dissaperas replaced by a chipping and cropping low noise. Have you any ideas about it's. When I connect the soundblaser's speakers out to decoder's line in works only for stereo (losing 5.1 capabilities), and bypassing the decoder i can get 5.1 sound, but i can't use the included remote control to change volume or anything.
    Thank you.
    I'm sorry for my poor english, it's not my native lenguage.

    I'm not sure exactly how you're connecting things. You say you connected an optic out to a digital DIN on the receiver? These are totally different connectors.
    The output on the card itself isn't optical. What you could use is a minijack to RCA (female) adapter, and then connect a standard RCA to RCA, male to male (SPDIF) cable to that, which plugs into the coaxial input on the receiver. Alternati'vely you could use a minijack to Digital DIN adapter and connect the DIN cable to that, and connect to the receiver.
    Do you have the SBLi've 24-bit External? Do you mean you connected the optical output to the optical input on the receiver?
    It may be best to contact Customer Support to speak to them one-on-one, to go over the connections and settings, if you're unsure of which to use.
    Cat

  • Hum problem with DDTS-100 with Klipsch Promedia 5.1

    I have a problem with me decoder DDTS-100 since the beginning. I use it with Promedia 5.1 Klipsch kit.
    When I use digital sources either optical or coax, when my decoder does'nt receive any signal from my DVD or X-box, I am earing a big hum coming out from my speakers. And then when my DDTS-100 receive a digital signal the hum disapeer.
    I am not earing the hum when I use the analog input.
    I am very disapointed about this bug because when the volume is high I am worried about my Klipsch kit.
    Thanks in advance
    Mat

    I finnaly found out my problem
    The buzz came out from my coax cable from my DVD. My DVD player was probably inducing 60Hz on the coax output.
    I switched to the optical output and no more buzz.
    I'll need to buy a new toslink cable to plug my x-box on the optical input #2
    Also I pluged my TV audio out in my st analog input, it also induced a 60 Hz on my DDTS-100. The decoder does not seem to filter out electric noises.
    I'm pretty happy to have found out my problem but I'm very dispointed that the DDTS-100 does not filter any electric noises.
    Mat

  • Any problems with K8N neo4-FI and Creative X-FI Xtreme Music ???

    Hi. Anyone having problems with the mentioned combination. (I've heard about incompatibility issue with creative and nforce4 chipsets) and since I have the mentioned board I would like to avoid future problems and maybe go with Audigy 4 instead. Thanks in advance.

    Here's MSIs technical support answer:
    Sometimes before, there was incompatibility issues between the X-FI Xtreme card and motherboards based on nforce 4 chipset. And then, Creative official has stated it existed on almost noforce4 motherboard, not only some or one manufacturer, so user met this issue should contact Creative.
    But from Creative's official statement as you find, they thought it caused by nforce4 chip, but our motherboard chipset is from NVIDIA. If NVIDIA had no plan to change the chipset architecture, we can't solve this issue. So we suggest you'd better not use this audio card if you use this MB.
    Best wishes,
    MSI Technical Support
    Now when I think about it, I have been using SB live 5.1 for years now and I have changed several platforms (VIA KT 400, Nforce2 (Soltek, Epox), Nforce 3 (soltek) and finaly Nforce 4 and have noticed strange behaviour with many of them in combination with mentioned card (I had to remove additional raid controller card because of skipping video and audio during video capturing on Nforce 2 platform). Now with SB live 5.1 removed, on MSI neo 4-FI it seems that occasional freezing of video on my DVB-T Pinnacle card has gone. I was convinced that the reason was weak reception (although my neighbour from just a few blocks away had excellent picture), but now I am not so shure. I don't know if I want to risk the possibility of repeating all those problems again even if it' "The most powerful audio processor in the world".

  • Problem with "SELECT...FOR UPDATE OF..." and "POST command" combination

    Problem with "SELECT...FOR UPDATE OF..." and "POST command" combination
    Problem in committing transactions in Multiple Forms (Oracle Forms) with POST built-in command:
    Consider that the following statements are written in WHEN-WINDOW-CLOSED trigger of a called form.
    Statements in called form (Form name: FORM_CHILD):
    go_block('display_block') ;
    do_key('execute_query') ;
    -- Data from table_b will be populated in this block, based on the value of COLUMN_1 obtained
    -- from TABLE_A.
    -- Example: If the value of COLUMN_1 is 10, then all the matching records from TABLE_B, which
    -- are inserted with value 10 in TABLE_B.COLUMN_1 will be fetched and shown here.
    if user_choice = 'YES' then
    commit ;
    else
    rollback ;
    end if ;
    Statements in calling forms:
    There are two calling forms having following statements and it is going to call the above said called form.
    CALLING FORM 1
    Statements in KEY-COMMIT trigger:
    post;
    call_form(form_child, no_activate) ;
    Statements in ON-INSERT trigger:
    select column_1
    from table_a
    for update of column_1
    where column_2 = 'X' ;
    update table_a
    set column_1 = column_1 + 1
    where column_2 = 'X' ;
    insert into table_b ...;
    insert into table_b ...; Statements in KEY-COMMIT trigger:
    post;
    call_form(form_child, no_activate) ;
    CALLING FORM 2:
    Statements in ON-INSERT trigger:
    select column_1
    from table_a
    for update of column_1
    where column_2 = 'X' ;
    update table_a
    set column_1 = column_1 + 1
    where column_2 = 'X' ;
    insert into table_b ...;
    insert into table_b ...;
    insert into table_b ...;
    Our understanding:
    Assume that both the forms are running from two different machines/instances, issuing commit at the same time. In this case, forms will start executing the statements written in ON-INSERT trigger, the moment POST command is executed. Though the commit is issued at the same time, according to oracle, only one of the request will be taken for processing first. Assume that calling form 1 is getting processed first.
    So, it fetches the value available in COLUMN_1 of TABLE_A and locks the row from further select, update, etc. as SELECT...FOR UPDATE command is used (note that NOWAIT is not given, hence the lock will be released only when COMMIT or ROLLBACK happens) and proceed executing further INSERT statements. Because of the lock provided by the SELECT...FOR UPDATE command, the statements in calling form 2 will wait for the resource.
    After executing the INSERT statements, the FORM_CHILD is called. The rows inserted in to TABLE_A will be queried and shown. The database changes will be committed when user closes the window (as COMMIT is issued in its WHEN-WINDOW-CLOSED trigger). Then the SELECT...FOR UPDATE lock will be released and calling form 2's statements will be executed.
    Actual happenings or Mis-behavior:
    Calling form 2 starts executing INSERT statements instead of waiting for SELECT...FOR UPDATE lock. Also, the value selected from TABLE_A.COLUMN_1 is same in both the calling forms, which is wrong.
    The rows inserted into TABLE_B are having similar COLUMN_1 values in calling form 2 and they are fetched and shown in the called form FORM_CHILD.
    Note that in calling form 2 also POST only is issued, but the changes posted there are accessible in calling form 1 also, which is wrong.
    Kindly suggest us as to how to fix above problem. It will be much use, if you can send us the information regarding the behavior of Oracle Forms POST built-in also.
    Our mail ID: [email protected]
    Thanks a lot in advance.

    You have several problems:
    1. On-Insert will ONLY run if you have created a new record in a base-table block. If you haven't done that, then the POST command will not cause it to run.
    2. Select for update without a "no wait" will lock records for the first form, but when the second form tries this, it will hit the ORA-00054 exception, and will NOT wait. The only way you could make it wait is to issue an UPDATE sql command, which is not such a good way to go.
    All POST does is issues SQL insert or update commands for any changes the user has made to records in a form's base-table blocks, without following with a Commit command.
    Also understand that Commit is the same as Commit_Form, and Rollback is the same as Clear_Form. You should read up on these in the Forms help topics.

  • Problem with DECODE block in WHERE clause

    Hi,
    I'm facing problem with DECODE statement. I just simulated my problem in the simple way as follows. If I execute this following query, I should get "hello", but I'm not getting anything (ZERO rows returned).
    SELECT 'hello' FROM DUAL
    WHERE 'sample1' in (DECODE(1, 1, '''sample1'', ''sample2'', ''sample3''',
    2, '''sample4'', ''sample5'', ''sample6'''
    I think some problem is there in my WHERE clause.
    But When I'm exeucting the following query as a seperate query, then I'm getting the value of DECODE block properly, but didn;t understnad why its not returning the same way when I'm putting the same DECODE statement in WHERE clause.
    SELECT DECODE(1, 1, '''sample1'', ''sample2'', ''sample3''',
    2, '''sample4'', ''sample5'', ''sample6'''
    FROM DUAL;
    Please help me to get out of this problem. Thank you so much in advance.
    Thanks,
    Ramji.

    The value returned by SELECT DECODE(1, 1, '''sample1'', ''sample2'', ''sample3''',2, '''sample4'', ''sample5'', ''sample6''') FROM DUAL;
    'sample1', 'sample2', 'sample3' is a single string. Consider it x.
    SELECT 'hello' FROM DUAL WHERE 'sample1' in ( DECODE(1, 1, '''sample1'', ''sample2'', ''sample3''',2, '''sample4'', ''sample5'', ''sample6'''));
    is like SELECT 'hello' FROM DUAL WHERE 'sample1' in ('x');
    or
    SELECT 'hello' FROM DUAL WHERE 'sample1' in ('''sample1'', ''sample2'', ''sample3''') and not
    SELECT 'hello' FROM DUAL WHERE 'sample1' in ('sample1', 'sample2', 'sample3');
    For this same reason SELECT 'hello' FROM DUAL WHERE 'sample1' in (select '''sample1'', ''sample2'', ''sample3''' from dual);
    also does'nt work.
    Please use INSTR to find whether 'sample1' exists in the string 'sample1', 'sample2', 'sample3'.

Maybe you are looking for

  • Password log on is not possible

    Hi, I just installed an IDES on Windows 2003 SP2, MS SQL server 2005 on a box with 2.8G CUP and 2G mem. The installation is successful and I can start/stop SAP instance. I failed logging on with account <sid>adm with the password i set during install

  • Resetting IPProfile?

    We have had BT Broadband since July last year, having at last left Virgin Media well behind.  We should have an 'up to' 8 Mbps service on ADSLMax, our exchange is not yet enabled for 21CN.  We have had several instances of low download speeds shown b

  • How do I set the default page size for printing on a 8450.

    A few days ago I printed some envelopes and now when I print from some programs, the print page size has remained the envelope size.  I want to print from any program on letter size paper without changing the settings every time. Thanks This question

  • At the main menu for Elements, where you can select Organizer or Photo Editor, when I signin to Editor nothing happens

    When I am at the main screen to select either Organizer or Photo Editor, I click on Editor and it requires me to sign in. Once I sign (I have confirmed the login information) in and click the signin button the screen cycles and never logs in to Edito

  • CS5 Image Blurry on Placement Resize

    I've searvhed through and can't seem to get the fix.  When I place an image (jpg) into my Indesign doc it looks sharp.  However, when I resize the image (smaller) it looses its clarity.  The image looks great in Photoshop.  I've been stuck on this fo