table data type question

table data type question

Post by CR » Thu, 04 Jul 2002 07:01:53



Is it possible to insert values into a table data type and then use that
value to exec another proc:
ALTER  procedure pass_to_proc
as


tr_cash_related_securities_crs

Server: Msg 137, Level 15, State 2, Procedure pass_to_func, Line 6

Thanks in advance.

 
 
 

table data type question

Post by Anith Se » Thu, 04 Jul 2002 07:10:52


No, table datatype cannot be used as a parameter for a stored
procedure.

- Anith


> Is it possible to insert values into a table data type and then use that
> value to exec another proc:
> ALTER  procedure pass_to_proc
> as


> tr_cash_related_securities_crs

> Server: Msg 137, Level 15, State 2, Procedure pass_to_func, Line 6

> Thanks in advance.


 
 
 

table data type question

Post by CR » Thu, 04 Jul 2002 07:39:44


What about to pass it into a function?

> No, table datatype cannot be used as a parameter for a stored
> procedure.

> - Anith



> > Is it possible to insert values into a table data type and then use that
> > value to exec another proc:
> > ALTER  procedure pass_to_proc
> > as


> > tr_cash_related_securities_crs

> > Server: Msg 137, Level 15, State 2, Procedure pass_to_func, Line 6

> > Thanks in advance.

 
 
 

table data type question

Post by oj » Thu, 04 Jul 2002 07:42:08


chris,


a stored procedure. input parameters are scalar by nature.

--
-oj
Rac v2.1 coming soon
http://www.rac4sql.net


> Is it possible to insert values into a table data type and then use that
> value to exec another proc:
> ALTER  procedure pass_to_proc
> as


> tr_cash_related_securities_crs

> Server: Msg 137, Level 15, State 2, Procedure pass_to_func, Line 6

> Thanks in advance.

 
 
 

table data type question

Post by Anith Se » Thu, 04 Jul 2002 07:55:30


Nope. You can return a table, not pass a table datatype as a parameter
to a function

- Anith


> What about to pass it into a function?


> > No, table datatype cannot be used as a parameter for a stored
> > procedure.

> > - Anith



> > > Is it possible to insert values into a table data type and then use
that
> > > value to exec another proc:
> > > ALTER  procedure pass_to_proc
> > > as


> > > tr_cash_related_securities_crs

> > > Server: Msg 137, Level 15, State 2, Procedure pass_to_func, Line 6

> > > Thanks in advance.

 
 
 

table data type question

Post by Steve Kas » Thu, 04 Jul 2002 08:02:16


But the procedure can create a cursor output parameter.  That's about
as close as you can come, I think.

create procedure Make_Cursor (

) as
  create table ##T (i int)
  insert into ##T values (12343)


go








go

drop procedure Make_Cursor
drop table ##T

What is it you are trying to do, anyway?

Steve Kass
Drew University


> chris,


> a stored procedure. input parameters are scalar by nature.

> --
> -oj
> Rac v2.1 coming soon
> http://www.rac4sql.net



> > Is it possible to insert values into a table data type and then use that
> > value to exec another proc:
> > ALTER  procedure pass_to_proc
> > as


> > tr_cash_related_securities_crs

> > Server: Msg 137, Level 15, State 2, Procedure pass_to_func, Line 6

> > Thanks in advance.

 
 
 

table data type question

Post by oj » Thu, 04 Jul 2002 08:10:06


agree....but you will not be able to do:



passing/receiving *array*.

--
-oj
Rac v2.1 coming soon
http://www.rac4sql.net


> But the procedure can create a cursor output parameter.  That's about
> as close as you can come, I think.

> create procedure Make_Cursor (

> ) as
>   create table ##T (i int)
>   insert into ##T values (12343)


> go








> go

> drop procedure Make_Cursor
> drop table ##T

> What is it you are trying to do, anyway?

> Steve Kass
> Drew University


> > chris,


to
> > a stored procedure. input parameters are scalar by nature.

> > --
> > -oj
> > Rac v2.1 coming soon
> > http://www.rac4sql.net



> > > Is it possible to insert values into a table data type and then use
that
> > > value to exec another proc:
> > > ALTER  procedure pass_to_proc
> > > as


> > > tr_cash_related_securities_crs

> > > Server: Msg 137, Level 15, State 2, Procedure pass_to_func, Line 6

> > > Thanks in advance.

 
 
 

table data type question

Post by Erland Sommarsko » Thu, 04 Jul 2002 08:15:40



> Is it possible to insert values into a table data type and then use that
> value to exec another proc:
> ALTER  procedure pass_to_proc
> as


> tr_cash_related_securities_crs

> Server: Msg 137, Level 15, State 2, Procedure pass_to_func, Line 6


No, this you can't do. This article discusses some possible techniques:

http://www.algonet.se/~sommar/share_data.html

--
Erland Sommarskog, SQL Server MVP

Books Online (updated!) for SQL 2000 at
http://www.microsoft.com/sql/techinfo/productdoc/2000/books.asp

 
 
 

1. Table Data Type Question

I have a stored procedure that declares 2 variables of
data type table, inserts data into each of the tables,
then attempts to join them to get a result set.  However,
I am getting an error that I have to declare the 1st table
variable to run the query.  It has been declared so I am
guessing that it doesn't like the join.  Also, if I remove
the join and just select * from either table, I can run
with no errors.  Any ideas?

2. .lck files

3. a question about table type of data

4. Strange DBNULL Error. Please help!

5. Table type with user defined data type.

6. Error 707 freezing server-- help, please!

7. Data Transfer from Long data type to SQL Server Text data type column

8. JDBC for Oracle ..

9. Data Type transparent to the type of the table field

10. Inserting Data into LONG data type field in an ORACLE Table

11. Temporary Table vs Table Data Type

12. join table to table data type

13. dynamic sql include table data type as table name