Variable Declaration Simplification

Variable Declaration Simplification

Post by Stephen Dow » Tue, 24 Aug 1999 04:00:00



Can anyone suggest a simpler, more efficient way of assigning the following
variable values without having to carry out the select statements each time
?






                                  FROM        OESCurrent
                                  WHERE    SatelliteNumber = 16609
                                  AND           ReceivedDatetime = '29/08/99
12:34:06'


                                  FROM        OESCurrent
                                  WHERE    SatelliteNumber = 16609
                                  AND           ReceivedDatetime = '29/08/99
12:34:06'


                                  FROM        OESCurrent
                                  WHERE    SatelliteNumber = 16609
                                  AND           ReceivedDatetime = '29/08/99
12:34:06'


                                  FROM        OESCurrent
                                  WHERE    SatelliteNumber = 16609
                                  AND           ReceivedDatetime = '29/08/99
12:34:06'

 
 
 

Variable Declaration Simplification

Post by Charles Bretana Jr » Tue, 24 Aug 1999 04:00:00










FROM        OESCurrent
WHERE SatelliteNumber = 16609
  AND     ReceivedDatetime = '29/08/99 12:34:06'


> Can anyone suggest a simpler, more efficient way of assigning the
following
> variable values without having to carry out the select statements each
time
> ?






>                                   FROM        OESCurrent
>                                   WHERE    SatelliteNumber = 16609
>                                   AND           ReceivedDatetime =
'29/08/99
> 12:34:06'


>                                   FROM        OESCurrent
>                                   WHERE    SatelliteNumber = 16609
>                                   AND           ReceivedDatetime =
'29/08/99
> 12:34:06'


>                                   FROM        OESCurrent
>                                   WHERE    SatelliteNumber = 16609
>                                   AND           ReceivedDatetime =
'29/08/99
> 12:34:06'


>                                   FROM        OESCurrent
>                                   WHERE    SatelliteNumber = 16609
>                                   AND           ReceivedDatetime =
'29/08/99
> 12:34:06'


 
 
 

1. variables in a cursor - declaration

Hi,
I have a problem using variables in a stored procedure:
I give my tablenames and columns via variables into this stored
procedure.
As long as I am concerned with updates or selects in that procedure
this works well using strings like:



But I want to use this variables for declaring a cursor, too.
I tried something like:

DECLARE Cur1 CURSOR FOR

FOR READ ONLY

This does not work in the same way: the variable is handled as a simple
string.
(note: all variables for tables and columns are declared as sysname
datatype)
(note:
DECLARE Cur1 CURSOR FOR

doesn't work)

Does anybody know a way to make a cursor-variable-declaration flexible
the way I tried?
I just want to use the sp with different tables and Columns.

TIA,
Tobias

Sent via Deja.com http://www.deja.com/
Before you buy.

2. Probably a pretty simple ODBC problem (but not for me)

3. Variable Declaration

4. NY-ALBANY-113275--ORACLE-Windows NT-UNIX-DBA

5. Variable declaration in views

6. CD-R Media

7. variable in cursor declaration

8. Storing customizations

9. Abstraction of table variable declaration

10. variable declaration > 8000 chars

11. string variable assigned in @declaration

12. Does TSQL have % Type variable Declaration

13. Variable Declaration in EXEC