vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| 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? Thanks BJ |
| |||
| 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@peppler.org - http://www.peppler.org/ Sybase DBA/Developer Sybase on Linux FAQ: http://www.peppler.org/FAQ/linux.html |
| |||
| 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@peppler.org - http://www.peppler.org/ > Sybase DBA/Developer > Sybase on Linux FAQ: http://www.peppler.org/FAQ/linux.html |
| |||
| 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@YOUR.SPAM.sypron.nl.NOT.FOR.ME http://www.sypron.nl Sypron B.V., P.O.Box 10695, 2501HR Den Haag, The Netherlands ------------------------------------------------------------- "BJ" <bonnie.tangyn@gmail.com> wrote in message news:1123948457.592184.287230@g44g2000cwa.googlegr oups.com... 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@peppler.org - http://www.peppler.org/ > Sybase DBA/Developer > Sybase on Linux FAQ: http://www.peppler.org/FAQ/linux.html |
| ||||
| 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_proced ure_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@YOUR.SPAM.sypron.nl.NOT.FOR.ME > http://www.sypron.nl > Sypron B.V., P.O.Box 10695, 2501HR Den Haag, The Netherlands > ------------------------------------------------------------- > > "BJ" <bonnie.tangyn@gmail.com> wrote in message > news:1123948457.592184.287230@g44g2000cwa.googlegr oups.com... > 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@peppler.org - > http://www.peppler.org/ > > Sybase DBA/Developer > > Sybase on Linux FAQ: http://www.peppler.org/FAQ/linux.html |
| Thread Tools | |
| Display Modes | |
|
|