Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Sybase > Re: Select into...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 2 of 5 Topic 2390 of 2544
Post > Topic >>

Re: Select into problem

by Manish Negandhi <negandhi.manish@[EMAIL PROTECTED] > Jan 30, 2008 at 03:01 AM

On Jan 30, 3:24=A0pm, tijgertje <griet.schauw...@[EMAIL PROTECTED]
> wrote:
> Hi,
>
> I have a problem concerning the select into statement.
> I have created a procedure that contains dynamic sql, which creates a
> variable number of columns.
>
> The sql looks like :
>
> @[EMAIL PROTECTED]
 =3D 'select columnA, columnB, columnC,.... into #t from.....'
> execute(@[EMAIL PROTECTED]
)
> select * from #t
>
> #t is nowhere defined as I cannot predict the number of columns nor
> their data types.
>
> The first time I launch the procedure it gives correct results.
> However if i launch the procedure again with different arguments
> ( creating more, or less columns with different column names ) the
> definition of #t does not change.
>

Do you rename or drop the #t table explicitly within the proc ? . You
might want to have a look at section
"Creating a table with a variable number of columns" under  Rob's
site, there is stored proc written for the same purpose

http://www.sypron.nl/dynsql.html

-HTH
Manish Negandhi
[TeamSybase Intern]
 




 5 Posts in Topic:
Select into problem
tijgertje <griet.schau  2008-01-30 02:24:21 
Re: Select into problem
Manish Negandhi <negan  2008-01-30 03:01:27 
Re: Select into problem
tijgertje <griet.schau  2008-01-30 06:03:09 
Re: Select into problem
bret@[EMAIL PROTECTED]   2008-01-30 09:04:24 
Re: Select into problem
tijgertje <griet.schau  2008-01-31 07:15:53 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Wed Oct 15 12:40:55 CDT 2008.