Re: how to use bcp command to output stored procedure result
- From: "BJ" <bonnie.tangyn@xxxxxxxxx>
- Date: 15 Aug 2005 03:39:01 -0700
Hello
An error occurred while I try to create existing table. My code is as
below (all code are in a file called testing)
use database_name
go
CREATE EXISTING TABLE temp_tablename
(
customer_account_id char(11),
currency char(3),
amount money,
allocated_amount money,
last_update datetime,
last_update_user char(3)
)
external procedure
at "servername.database_name.owner_name.stored_procedure_name"
SELECT * FROM temp_tablename
go
When I run the above file, I type:
isql -Uusername -Sservername -Ppassword < testing
After that an error occured, "Msg 11204, Level 16, State 2:
Server 'servername', Line 15:
There is an error in the syntax of the object definition
'temp_tablename'
I am a newbie on sybase and unix. Could you please give me some
suggestions on the coding?
Beside this, do I use create table instead of create existing table?
The stored procedure just create temp table, right? After the stored
procedure session expire, the temp table will be gone, right?
Thanks
BJ
Rob Verschoor 寫道:
> All ASE documentation is available online at
> http://sybooks.sybase.com/as.html . For 'create proxy table', go here:
> http://tinyurl.com/c25cj .
>
> HTH,
>
> Rob
> -------------------------------------------------------------
> Rob Verschoor
>
> Certified Sybase Professional DBA for ASE 12.5/12.0/11.5/11.0
> and Replication Server 12.5 / TeamSybase
>
> Author of Sybase books (order online at www.sypron.nl/shop):
> "Tips, Tricks & Recipes for Sybase ASE"
> "The Complete Sybase Replication Server Quick Reference Guide"
> "The Complete Sybase ASE Quick Reference Guide"
>
> mailto:rob@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> http://www.sypron.nl
> Sypron B.V., P.O.Box 10695, 2501HR Den Haag, The Netherlands
> -------------------------------------------------------------
>
> "BJ" <bonnie.tangyn@xxxxxxxxx> wrote in message
> news:1123948457.592184.287230@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> Where can I find the reference manual about creating existing table?
> Would you mind to give me some examples on creating the table?
>
> Thanks
>
> BJ
>
>
> Michael Peppler ??:
>
> > On Fri, 12 Aug 2005 21:09:32 -0700, BJ wrote:
> >
> > > Hello all
> > >
> > > I can use bcp command to output database views to text file. My
> statement
> > > is:
> > > bcp database_name..viewname out output_filename.txt -Uusername
> > > -Sservername -Ppassword -c
> > >
> > > However, an error occurs when I use the same statment to output stored
> > > procedure result. I typed:
> > > bcp database_name..stored_procedure_name out output_filename.txt
> > > -Uusername -Sservername -Ppassword -c
> > >
> > > Could anyone give me some suggestions?
> >
> > You can probably create a proxy table that maps to the stored procedure,
> > and then bcp out from the proxy table. Take a look at the "create existing
> > table" command in the reference manual.
> >
> > Michael
> > --
> > Michael Peppler [TeamSybase] mpeppler@xxxxxxxxxxx -
> http://www.peppler.org/
> > Sybase DBA/Developer
> > Sybase on Linux FAQ: http://www.peppler.org/FAQ/linux.html
.
- References:
- how to use bcp command to output stored procedure result
- From: BJ
- Re: how to use bcp command to output stored procedure result
- From: Michael Peppler
- Re: how to use bcp command to output stored procedure result
- From: BJ
- Re: how to use bcp command to output stored procedure result
- From: Rob Verschoor
- how to use bcp command to output stored procedure result
- Prev by Date: Re: about 2 hundred million data
- Next by Date: How to check existing table in stored procedure
- Previous by thread: Re: how to use bcp command to output stored procedure result
- Next by thread: about 2 hundred million data
- Index(es):
Relevant Pages
|
|