declaring a cursor

declaring a cursor

Post by peter mine » Wed, 18 Jul 2001 00:31:57



i have one field in a table which represents an sql command and i want to
associate the string from it to a cursor. After that open the cursor and use
it. The problem is that the following appears:
Ex.


table
'Operand type clash: varchar is incompatible with cursor'
So, how can i extract some sql command from a table and execute it, and
after that use the rows it returns (i cant use exec as well because i cant
get the result that way)

thank you very much!!

 
 
 

declaring a cursor

Post by Rashmi Jagadis » Wed, 18 Jul 2001 02:06:23


Hi!
  In order to get any column from a table we would use a
cursor that's rite,
 i.e

  declare cursor CUR1 for
       select sql_query_col from sometable;
  open CUR1


                       -- SQL statments
 ....
 ....

Quote:>-----Original Message-----
>i have one field in a table which represents an sql

command and i want to
>associate the string from it to a cursor. After that open
the cursor and use
>it. The problem is that the following appears:
>Ex.


stored in an other
>table
>'Operand type clash: varchar is incompatible with cursor'
>So, how can i extract some sql command from a table and
execute it, and
>after that use the rows it returns (i cant use exec as
well because i cant
>get the result that way)

>thank you very much!!

>.


 
 
 

declaring a cursor

Post by peter mine » Wed, 18 Jul 2001 14:53:28


the problem is that the declaration of the cursor is stored in a database
>   In order to get any column from a table we would use a
> cursor that's rite,
>  i.e


!!!!!Problem - the declaration is stored in a database, so i'm trying sth
like declare cursor cur1 for 'string variable'
>   declare cursor CUR1 for
>        select sql_query_col from sometable;
>   open CUR1


>                        -- SQL statments
>  ....
>  ....

> >-----Original Message-----
> >i have one field in a table which represents an sql
> command and i want to
> >associate the string from it to a cursor. After that open
> the cursor and use
> >it. The problem is that the following appears:
> >Ex.


> stored in an other
> >table
> >'Operand type clash: varchar is incompatible with cursor'
> >So, how can i extract some sql command from a table and
> execute it, and
> >after that use the rows it returns (i cant use exec as
> well because i cant
> >get the result that way)

> >thank you very much!!

> >.