Results 1 to 4 of 4

Thread: How to use SQL Case Statement Syntax

  1. #1
    Join Date
    Apr 2009
    Posts
    68

    How to use SQL Case Statement Syntax

    How to use the SQL Case Statement Syntax in an program, could we use the SELECT, UPDATE and DELETE statements in the application. It would be more helpful if you provide the Example along with it.

  2. #2
    Join Date
    Jan 2006
    Posts
    211

    Re: How to use SQL Case Statement Syntax

    you are no doubt allow to use SELECT, INSERT, UPDATE, and DELETE, as well as a few functions that are useful. But it is also seen that not many people are making active use of the CASE statement, although it is one of the most useful SQL keywords in existence. There are two different types of CASE statements. The simple CASE statement takes an input value and compares it to a list of expressions to select the appropriate output value.

  3. #3
    Join Date
    Jan 2009
    Posts
    143

    Re: How to use SQL Case Statement Syntax

    It is more efficient and better programming practice to put this logic in the database using a stored procedure or in the SQL statement so that some time i get data in "flag_cd" and sometimes i dont, and also some time i get data in "flag_id" This takes the first one the presentation of the data can be as clean and unencumbered by business logic as possible.

  4. #4
    Join Date
    Apr 2008
    Posts
    193

    Re: How to use SQL Case Statement Syntax

    CASE statements are often found in SELECT, UPDATE and DELETE statements as well as WHERE and IN clauses. when do we uses column name, a constant, a function, a subquery, or any combination of column names, constants, and functions connected by arithmetic or bitwise operators mostly we make use of following is the Oracle syntax we are using for..

    [ <<label_name>> ]
    CASE { WHEN boolean_expression THEN {statement to be executed ;} ... }...
    [ ELSE {statement to be displayed;}... ]
    END CASE [ label_name ];

Similar Threads

  1. Case statement in oracle database
    By Kingfisher in forum Software Development
    Replies: 4
    Last Post: 04-03-2010, 10:21 PM
  2. Use the CASE Statement in a SQL SELECT Clause
    By Abraham.J in forum Software Development
    Replies: 3
    Last Post: 12-08-2009, 01:52 PM
  3. Bash case statement help on Ubuntu
    By _Gentoo_Nile_ in forum Operating Systems
    Replies: 3
    Last Post: 29-07-2009, 12:02 AM
  4. Statement Parameter Slow in Stored Procedure case
    By HP_Crook in forum Software Development
    Replies: 3
    Last Post: 26-06-2009, 08:55 AM
  5. SWITCH....CASE statement in C#
    By Aadarsh in forum Software Development
    Replies: 1
    Last Post: 10-11-2008, 05:39 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,587,199.46419 seconds with 17 queries