using insert with Sybase Case expression

using insert with Sybase Case expression

Post by Kevi » Fri, 04 Jul 2003 00:25:24



I have a stored procedure where I would like to make a decision within
on which table to insert a row into based on the value of an input
variable.  Is it possible to use an INSERT with a CASE expression in
Sybase?  Thanks in advance.

Kevin

 
 
 

using insert with Sybase Case expression

Post by Anthony Mandi » Fri, 04 Jul 2003 14:14:28



> I have a stored procedure where I would like to make a decision within
> on which table to insert a row into based on the value of an input
> variable.  Is it possible to use an INSERT with a CASE expression in
> Sybase?  Thanks in advance.

        A normal if expression is all you need.

-am     ? 2003

 
 
 

1. CASE Expression in Sybase : Repost

I'm reposting this message, it seems to have mysteriously disappeared
since my original posting on Jan 27th (yesterday)...

Is the CASE expression supported in Sybase the same way it is
supported in MS-SQL Server? The CASE expression is ANSI SQL-92
compliant which Sybase System 11 is supposed to be but I can't
find any documentation about it and I've tried it with ISQL
and the server won't accept my request.

If it is the case that the CASE expression is not part of Sybase
System 11, is there a work-around or another way to express the
type of statement where there is conditional involved?

My statement is something like that:

select B_PORTFOL.ACCOUNT,
ENTRY_VAL=3D(B_PORTFOL.QUANTITY*B_SECURITY.PRICE*
CASE
        WHEN B_SECURITY.FACTOR < 0
                THEN -1/B_SECURITY.FACTOR
        ELSE
                B_SECURITY.FACTOR
END) =

FROM B_PORTFOL,B_SECURITY
WHERE  B_PORTFOL.SECURITY=3DB_SECURITY.SECURITY

This currently works in MS-SQL but won't in Sybase.

Thanks in advance.   =

-- =

******************************************************************
 Jean Poir=E9, eng.           Croesus, Portfolio Management System =

 Unigiciel Inc.             Tel.: 514-662-6101
 1 Place Laval, Bureau 410  Fax.: 514-662-3629

******************************************************************

2. Data Transformation from MS SQL Server 7.0 to Oracle 8.0 using DTS

3. CASE Expression in Sybase

4. *Informix employment required.CT/NY*

5. CASE expression and using it in group by

6. Logins problem

7. Insert using CASE STATEMENT

8. Ayuda con trigger

9. Using Select Case in Sybase 11

10. order by/case expression problem

11. Case expression or Cursor

12. Case sensitive criteria expressions ...

13. Order by case input expression