SQL SELECT and Return values

I have a simple SELECT statement in a Stored Proc that
queries 2 tables in
SQL Server 2000 using a join. My problem is I want to return
values based on
the outcome of the query eg. if a row is returned then return
1, or return 2
if no rows are found. I have tried various ways to implement
this and they
always work fine in Query Analyser but in Dreamweaver MX2004
either return
no return values ( or at least they are not displayed on my
page ) or the
return values are inconsistent. I am using a DW Command.
I know this is DW and not my code as Query Analyser produces
the correct
values every time. Can anyone tell me what code I can use
that is DW
friendly please.
Thanks.

I read your note with a great degree of sympathy but no
solutions. I was having the same trouble with access tables after 4
years of trouble free connections. It may not be relevant but the
solutions for my problem was a Server software SP release. Details
are:
Following the avalanche of hints and tips I am pleased to
report that there is a problem with Dreamweaver MX and MX2004 when
connecting to Access databases running on Windows Server 2003 SP1.
Whilst it is covered in the knowledge base I note that others in
the forum are having similar difficulties with Sequel connections
and unable to retrieve failures.
There is a "fix" - SP2DBFix1.0.2.mxp - for my problem and I
cannot be alone in experiencing this.
And just in case anyone from Adobe is reading this, you
should have written to all your registered and paid up members
informing us of this problem when WS2003 SP1 was released!
Hope this helps.

Similar Messages

  • Display and return value in select list.

    hi,
    i want to display the value in select list coming from this quary .
    select student_id from class_record where class_id =:p1_class_id and SECTION =:p1_section
    minus
    select student_id from STUDENT_TYPE_DETAILS where class_id =:p1_class_id and SECTION =:p1_section;
    but i want f_name and last name with student_id .f_name and l_name store in table s_per_det.student is also in that table.
    how can i define display value and return value in this quary using 3rd table s_per_det.
    How can i do this.
    Thanks
    manoj

    Ooh, MINUS.... Can you not use a NOT EXISTS in this case, could have a big effect on the execution plan?
    Something like this perhaps?
    SELECT f_name||' '||l_name,
           stundent_id
    FROM class_record a,
         s_per_det b
    WHERE a.student_id = b.student_id
    AND   a.class_id   = :P1_CLASS_ID
    AND   a.section    = :P1_SECTION
    AND   NOT EXISTS(SELECT 'X'
                     FROM student_type_details c
                     WHERE a.student_id = c.student_id
                     AND   c.class_id = :P1_CLASS_ID
                     AND   c.section = :P1_SECTION)Cheers
    Ben
    http://www.munkyben.wordpress.com
    Don't forget to mark replies helpful or correct ;)

  • Urgent! Display lookup value and return value at the same time.

    We are using pop up lov.
    How can we display lookup value and return value at the same time. let me claer..
    Our lov query is like fallowing
    select dname, deptno from dept
    we want to return deptno column into a database bind text item and dname column into a display item (look up)
    can we do it (we need to do)
    thanks for your help.

    We did it .
    But pop up key lov (display description return value ) property doesn't appear for tabular forms item.
    (Report Attributes pages Tabular Form Element section display As property list)
    can we set or not.
    Thank you.

  • Exporting and returning value question

    What is different between exporting and returning value in method of a class. if created an object inside the method and exporting it, it means I have a reference to that object inside program. If I use returning value, it means I have a copy of object created inside the method, but the object inside method is destroyed after it ends. Do I understand correctly? if so what do u prefer exporting or returning value? thanks!

    Hello Anthony
    The major difference is that you can have multiple EXPORTING parameters yet only a single RETURNING parameter. In addition, if you have a RETURNING parameter you cannot have EXPORTING parameters simultaneously.
    Defining methods with a single RETURNING parameter is more Java-like than having multiple EXPORTING parameters.
    Whenever possible and sensible I prefer RETURNING parameters over EXPORTING parameters because they allow to use the function method call, e.g.:
    go_msglist = cf_reca_messagelist_create( ).
    Regards
      Uwe

  • Display as text based on pl/sql - how to return value

    Hi,
    I have a item set as "display as text based on pl/sql". How do I get the PL/SQL anonymous block to return the value of the item?
    My function declares and populates a variable called t_output which is the value I want displayed in the item. The PL/SQL I have written is correct as I have tried it in SQLPlus* with DBMS_OUTPUT.PUT_LINE and I get the correct output, but I don't know how to set my item to the value of t_output. I have tried adding ":P73_ITEM := t_output;" into the end of the PL/SQL block.
    Thanks
    Lucy

    Hi Lucy,
    Try this and see.
    make the display as:display as text(saves state)
    source type: sql query
    in source value or expression type
    select func(arguments) from table name;
    Good luck

  • Procedure which inserted and returns value

    i don't know english very vell and sorry about it :(((
    i want write a procedure which inserted or updated table and returns it's ID ...
    it's my tabel :
    DROP TABLE T_STUDENT CASCADE CONSTRAINTS;
    CREATE TABLE T_STUDENT
    ID NUMBER(10) NOT NULL,
    NAME VARCHAR2(100) NOT NULL,
    SURNAME VARCHAR2(100) NOT NULL,
    AGE NUMBER(38) NOT NULL,
    CNAUTHORID NUMBER(10) NULL
    and i have procedure which inserted or updated this table and return's ID (if ID<=0 then inserted else updated):
    CREATE OR REPLACE procedure sp_InsertUpdate_T_STUDENT
    nResID in out NUMBER,
    nID in NUMBER,
    vchNAME in VARCHAR2,
    vchSURNAME in VARCHAR2,
    nAGE in NUMBER,
    nCNAUTHORID in NUMBER
    as
    begin
    if nID<=0 then
    insert into T_STUDENT (NAME,SURNAME,AGE,CNAUTHORID) values (vchNAME,vchSURNAME,nAGE,nCNAUTHORID );
    else
    update T_STUDENT set NAME=vchNAME,SURNAME=vchSURNAME,AGE=nAGE,CNAUTHORID=nCNAUTHORID
    where ID=nID;
    end if;
    select ID into nResID from T_STUDENT where NAME=vchNAME and
    SURNAME=vchSURNAME and AGE=nAGE and CNAUTHORID=nCNAUTHORID;
    end;
    this procedure is correct but maybe returns more then one ID and i don't want it :( ....... how i can write this procedure otherwise ???

    First of all does yout insert statement work??
    insert into T_STUDENT (NAME,SURNAME,AGE,CNAUTHORID) values (vchNAME,vchSURNAME,nAGE,nCNAUTHORID )
    Should you not insert also the value ID?
    The way i would do this was first since u have only have one return value is a function like this:
    function sp_InsertUpdate_T_STUDENT
    nID in NUMBER,
    vchNAME in VARCHAR2,
    vchSURNAME in VARCHAR2,
    nAGE in NUMBER,
    nCNAUTHORID in NUMBER
    ) return number
    is
    ln_id number;
    begin
    if nID<=0 then
    insert into T_STUDENT (ID,NAME,SURNAME,AGE,CNAUTHORID) values (SEQ_ID.NEXTVALUE,vchNAME,vchSURNAME,nAGE,nCNAUTHORID ) returning ID into ln_id;
    else
    update T_STUDENT set NAME=vchNAME,SURNAME=vchSURNAME,AGE=nAGE,CNAUTHORID=nCNAUTHORID
    where ID=nID;
    ln_id := nID;
    end if;
    return ln_id;
    end;

  • Select list return value displayed in another item

    The subject pretty much defines it. I have 3 items on a page select list, displays as text (based on LOV), and a text box. My idea is to display a control number in the select list. When the user selects the number that they want I would like the return value to fill in the displayed as text item. Then user can then use the text box to update that information.
    My question is how do I get the return value to display on the users selection?
    Thanks,
    Derek

    Try to compute that item.
    Denes Kubicek

  • How to pass a function with the same argument multiple times and return values in variables?

    The problem I have is I created a function which really is some kind of database.  Basically a bunch of:
    if (a.value == "this number"){
    b.value = "this expression";
    Inside the form are 2 dropdown lists that return numerical values which I want to process through that function and put the return value inside separate variables.
    var a = this.getField("OPE003.EVEN.1.MIP");
    Mip(a);
    var result1 = Mip();
    I tried to overwriting *a* to process the second field
    a = this.getField("OPE003.EVEN.2.MIP");
    Mip(a);
    var result2 = Mip();
    result1 and result2 are put in an array, joined as a string.
    Doing so, I always get the last processing twice as the final result.
    Can I use a function as a batch processing tool that way?

    You are right, I changed the code to what you said but how do I pass another value through my fonction so I can get Result1 and Result2?
    is it
    var a = this.getField("OPE003.EVEN.1.MIP");
    var b = this.getField("OPE003.EVEN.2.MIP");
    var result1 = Mip(a);
    var result2 = Mip(b);
    var c = new Array[result1, result2]

  • How to know that a method has been called and returning value of a method

    Hi, everyone! I have two questions. One is about making judgment about whether a method has been called or not; another one is about how to return "String value+newline character+String value" with a return statement.
    Here are the two original problems that I tried to solve.
    Write a class definition of a class named 'Value' with the following:
    a boolean instance variable named 'modified', initialized to false
    an integer instance variable named 'val'
    a constructor accepting a single paramter whose value is assigned to the instance variable 'val'
    a method 'getVal' that returns the current value of the instance variable 'val'
    a method 'setVal' that accepts a single parameter, assigns its value to 'val', and sets the 'modified' instance variable to true, and
    a boolean method, 'wasModified' that returns true if setVal was ever called.
    And I wrote my code this way:
    public class Value
    boolean modified=false;
    int val;
    public Value(int x)
    {val=x;}
      public int getVal()
      {return val;}
       public void setVal(int y)
        val = y;
        modified = true;
         public boolean wasModified()
          if(val==y&&modified==true)
          return true;
    }I tried to let the "wasModified" method know that the "setVal" has been called by writing:
    if(val==y&&modified==true)
    or
    if(x.setVal(y))
    I supposed that only when the "setVal" is called, the "modified" variable will be true(it's false by default) and val=y, don't either of this two conditions can prove that the method "setVal" has been called?
    I also have some questions about the feedback I got
    class Value is public, should be declared in a file named Value.java
    public class Value
    cannot find symbol
    symbol  : variable y
    location: class Value
    if(val==y&&modified==true)
    *^*
    *2 errors*
    I gave the class a name Value, doesn't that mean the class has been declared in a file named Value.java*?
    I have declared the variable y, why the compiler cann't find it? is it because y has been out of scale?
    The other problem is:
    Write a class named  Book containing:
    Two instance variables named  title and  author of type String.
    A constructor that accepts two String parameters. The value of the first is used to initialize the value of  title and the value of the second is used to initialize  author .
    A method named  toString that accepts no parameters.  toString returns a String consisting of the value of  title , followed by a newline character, followed by the value of  author .
    And this is my response:
    public class Book
    String title;
    String author;
      public Book(String x, String y)
       { title=x; author=y; }
       public String toString()
       {return title;
        return author;
    }I want to know that is it ok to have two return statements in a single method? Because when I add the return author; to the method toString, the compiler returns a complain which says it's an unreachable statement.
    Thank you very much!

    Lets take this slow and easy. First of all, you need to learn how to format your code for readability. Read and take to heart
    {color:0000ff}http://java.sun.com/docs/codeconv/html/CodeConvTOC.doc.html{color}
    Now as to your first exercise, most of it is OK but not this:   public boolean wasModified()
          if (val == y && modified == true)
                return true;
    y being a parmeter to the setValue method exists only within the scope of that method. And why would you want to test that anyways? If modified evaluates to true, that's all you need to know that the value has been modified. So you could have   public boolean wasModified()
          if (modified == true)
                return true;
       }But even that is unnecessarily verbose, as the if condition evaluates to true, and the same is returned. So in the final analysis, all you need is   public boolean wasModified()
          return modified;
       }And a public class has to be declared in a file named for the class, yes.
    As for your second assignment, NO you cannot "return" two variables fom a method. return means just that: when the return statement is encountered, control returns to the calling routine. That's why the compiler is complaining that the statement following the (first) return statement is unreachable.
    Do you know how to string Strings together? (it's called concatenation.) And how to represent a newline in a String literal?
    db

  • Multithreading and Returning Value from RMI

    Hi all,
    I have an RMI Object which is Multi Threaded. The scenario is like this:
    The client program will pass different program specific codes to the RMI object. Multiple clients can pass same or different codes. If the codes are different they can share common data in an asynchronous way other wise they need to be synchronized.
    This RMI object will do some database transactions and will return a value to the client. I am not sure how to return a value to the client which has invoked this method as this method executes asynchronously.
    I am sorry if this posting is inappropriate for this forum.
    Thanks in Advance
    Srinivas

    If the database transaction executes asyncrhonously, the remote method has to wait for it and return the result via the return statement.
    As the remote request is already executing in a thread of its own there is of course no need for the database transaction to execute asynchronously from RMI's point of view so if you can get rid of that complication in your architecture you may as well do it. OTOH your application architecture may do it for other reasons

  • Sorting and return values from parralell arrays

    import java.io.*;
    import java.util.*;
    class Check{
         String words;
         String signature;
         Check(String w, String s){
              words = w;
              signature = s;
    class Test{
         static String[]a = new String[100];
         static String[]b = new String[100];
         public static void main(String[] args)throws IOException{
              Scanner in = new Scanner(new FileReader("input.txt"));
              //Check []ch = new Check[100];
              String str = in.next();
    int z = 0;
          while(!(str.equals("$$$$"))){            
           a[z] = str;
           b[z] = getNumberSequenceFromString(str);
           z++;
           str = in.next();
              insertionSort(a,0,z);
              insertionSort(b,0,z);
         //     for(int i = 0; i < z; i++){
    ///     System.out.println(a);
              for (int i = 0; i < z ; i++){
                   System.out.println(a[i]+" "+b[i]);
              String key = "225533";//should give the word "move", istead it is giving me "TEXT" which is incorrect
              int rope = binarySearch(key,b,0,z-1);
              System.out.println("rrrrrrrrrrrrrrropr "+ rope);
              System.out.println("i found him :"+a[rope/2]);
         }//end main
         public static String getNumberSequenceFromString(String word){
              int l = word.length();
              String str = " ";
              word = word = word.toLowerCase();
         for(int i = 0; i < l; i++){
                   char y = word.charAt(i);
         if(y < 100){
              str +=2;
         }else if(y < 103){
              str +=3;
         }else if( y < 106){
              str +=4;
         }else if( y < 109){
              str += 5;
         }else if(y < 112){
              str += 6;
         }else if(y < 116){
              str += 7;
         }else if (y < 119){
              str += 8;
         }else{
              str +=9;
         }//end for
              return str;
         }//end getWord();
         public static void insertionSort(String[]list,int lo, int n){
         for(int j = lo+1; j < n; j++){
              String key = list[j];
              int k = j-1;
              while(k >= lo && key.compareToIgnoreCase(list[k]) < 0){
                   list[k + 1] = list[k];
                   --k;
              }//end while
              list[k+1] = key;
         }//end for
    }//end insertion sort
         public static int binarySearch(String key, String[]b, int lo, int hi){
         while(lo <= hi-1){
              int mid = (lo + hi)/2;
              System.out.println("i am mmmmmmmmmmmmmid" + mid);
              int cmp = key.compareToIgnoreCase(b[mid]);
              if (cmp==0)return mid;
              if (cmp < 0)hi = mid -1;
              else lo = mid + 1;
         }//end while
         return lo;
    }//end binarysearch
    }//end classAbove is my revise code.  Your idea worked fine, thank you.  I have a problem though.  I tried to create a class eg:
    class Check{
    String words;//for words
    String signature; //for numbers
    Check (String w, String s){
    words = w;
    signature = s;
    The idea was to store the word and its signature as an object, after which I would sort.  Howerver, when I tried reading in the values eg: check[]=str, number, it did not work.  I tried 2 separate arrays, but now I cannot return the correct word. I need some help on this one.
    Questions:
    How could I combine both arrays so that I could sort them, then search a value in the array and return the correct string?
    I tried a class but i could not get it to work.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    I'm not going to try to read all that messy code. Here is some advice.
    1. Don't use parallel arrays.
    2. If you're going to insist on doing it the wrong way and using parallel arrays, then first get your sort working for a single array.
    3. If you're going to insist on doing it the wrong way and using parallel arrays, then after getting the sort to work with a single array, in the part where you're swapping elements, whatever you do to swap in the first array, you'll need to do to the second array as well.
    4. Break your code down into methods.

  • Help : Complex parameter and return value in WebService?

    Hi guys
       These days, I publish a WebService, in it there is an
    operation like this:
       List search(List para);
       in this operation, parameter "para" is a java.util.List, which contains many elements, every element is an instance of customizing class "MyItem", I made "MyItem" implements java.io.Serializable interface. Strangely, when I call this operations in my java client,
    I found that I could not get out every element from para in server-side, but para.size() is showing it contains 10 elements in it. The same thing happen to the return value of this operation, in client, I got an instance of java.util.List class as the return value, when I try
    System.out.println(result.get(0)); it output "null", but
    result.size() is 10, I don't know how to explain this
       Does anyone who encounter this issue too?
    I guess it has something to with the Serializable issue ,but I have made every List item serializable, why it looks like this??

    Hi Kevin,
    I answered you by mail some days ago, but just to complete the thread, I am posting the hint also here:
    Custom types should be manually added to the Virtual Interface, so that they can be serialized.
    Best regards,
    Alexander

  • How to attatch sub vi . can we do it the same way as we call functions in C and return values to the main vi?

    I am creating a Vi. I want to do a sub function. I want to connect a switch to a toggle flip flop so need to  use a push button switch in the input  but at the same time take its output to a true/false loop and execute it according to the ourput of the toggle flip flop which will have an ON and OFF state.
    Jeril

    In the front panel you can r-click the top right icon and "Show Connector". Click which controls and indicator you want to be your interface. Then drag it to your main application and it'll work as a sub-vi. You can do this for all VI's. Just like the "+" VI takes two numbers (controls) and return one result (indicator).
    /Y
    LabVIEW 8.2 - 2014
    "Only dead fish swim downstream" - "My life for Kudos!" - "Dumb people repeat old mistakes - smart ones create new ones."
    G# - Free award winning reference based OOP for LV

  • CWDAQTools and return value

    What does the integer return value of the Calibrate E series function mean? (0 pass 1 fail ?????)
    Curt

    Curt,
    It returns an error code. If you set the ExceptionOnError property to true, then an exception is thrown.
    0 means that there was no error. If it is a negative number, the number indicates an error code, if it is positive, then its a warning.
    If you get an error, you can use the NI-DAQ error codes topic, to figure out what the error means, or search the Measurement studio help.
    Hope this helps. Please let me know if you have more questions.
    Nandan Dharwadker
    Staff Software Engineer
    Measurement Studio Hardware Team

  • Using Sql Result and Limit Value in Prompt OBIEE 11.1.1.5

    Dear Gurus,
    I have prompt hierarchy like this:
    Year
    Quarter
    Month
    Which are using limit value (Quarter depend on Year, Month depend on Quarter), but I have issue because appear null also in those prompt
    I have checked my database, view, repository there are not null.
    My questions is, how to remove null in prompt when sql result can't use together with limit value, I don't know how to remove it using column filter.
    NB:I already using presentation variable in sql result in order to remove null and using constraint, but it show nothing in prompt view unless we press apply button.
    So I don't use this
    Please help, kindly appreciated
    JOE
    Edited by: JoeSSI on Mar 27, 2012 2:03 AM

    Hi,
    Can you edit your prompt here you can find show option then select SQL Result please modify statement like below.
    SELECT your column name FROM subject area where your column name is not null
    Go--> Edit your prompt--> Show--> Select Sql result---> change statement like above.
    Second way.
    Go to physical layer then double click your column name here you can find *"nullable"* option please check that.
    Go--> Physical Layer--> Extract table --> select your column name-->double click your column name--> here you can find option like Nullable please check it.
    Award points it is useful.
    Thanks,
    Satya

Maybe you are looking for