Sproc Question

Sproc Question

Post by JAF » Fri, 22 Dec 2000 04:00:19



I am trying to write a sproc that inserts a record then returns a
recordset......is this possible?

Here is what i have, however, I get nothing back....

Any Ideas?
Thanks!


As


Insert into tblPoll (yes) SELECT '1' As yes;
ELSE

Insert into tblPoll (no) SELECT '1' As no;
ELSE
Insert into tblPoll (sometimes) SELECT '1' As sometimes;

Select * From tblPoll

return

 
 
 

Sproc Question

Post by Lars Temm » Fri, 22 Dec 2000 04:25:00


Let's rework things a bit ... please tell me if this is ok.

CREATE TABLE #tblPoll
(
 yes  varchar(16),
 no  varchar(16),
 sometimes varchar(16)
)



INSERT #tblPoll (yes,no,sometimes)
SELECT  CASE

  ELSE NULL END,
 CASE

  ELSE NULL END,
 CASE

  ELSE NULL END

Select * From #tblPoll

-Lars


> I am trying to write a sproc that inserts a record then returns a
> recordset......is this possible?

> Here is what i have, however, I get nothing back....

> Any Ideas?
> Thanks!

> Alter Procedure spPoll

> As


> Insert into tblPoll (yes) SELECT '1' As yes;
> ELSE

> Insert into tblPoll (no) SELECT '1' As no;
> ELSE
> Insert into tblPoll (sometimes) SELECT '1' As sometimes;

> Select * From tblPoll

> return


 
 
 

1. sproc question

I have a sproc


it returns 1 row.

Now, I want to migrate it to

WHILE value = True
    BEGIN

    END

However, I want that sproc to be placed into a single table with 1 row for
each row returned by the sproc.

I thought that something like would work, but it fails.

WHILE value = True
    BEGIN

    END

Can anyone help?

Thank you.

--
Kevin Hill
Vice President/Webmaster
http://www.toolup.com
Quality Power Tools and Accessories online at great prices

2. Reports with Graphs

3. ResultSet returns only ten rows

4. SPROC question

5. database hurdle

6. Newbie sproc question - passing params

7. VB5 and Transactions/Locking

8. Another sproc question

9. Sproc Question

10. sproc question

11. Exec SProc from SProc (output parameter question)

12. Using sproc resultset in another sproc