Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

PB with xp_read_file

8 posts in General Discussion Last posting was on 2005-12-22 15:14:19.0Z
RONDEAU MICHEL Posted on 2005-12-12 12:56:47.0Z
Sender: 215.439d70ef.1804289383@sybase.com
From: RONDEAU MICHEL
Newsgroups: ianywhere.public.general
Subject: PB with xp_read_file
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <439d738f.233.1681692777@sybase.com>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 12 Dec 2005 04:56:47 -0800
X-Trace: forums-1-dub 1134392207 10.22.241.41 (12 Dec 2005 04:56:47 -0800)
X-Original-Trace: 12 Dec 2005 04:56:47 -0800, 10.22.241.41
Lines: 6
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:5061
Article PK: 17492

I use xp_read_file and xp_write_file for manipulate BLOB.
But i wish
to know " current working directory database server" ? how
to know this directory?

Thank's


Peter Simonsen Posted on 2005-12-15 09:30:53.0Z
From: Peter Simonsen <"Peter Simonsen">
User-Agent: Mozilla Thunderbird 1.0.6 (Windows/20050716)
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: ianywhere.public.general
Subject: Re: PB with xp_read_file
References: <439d738f.233.1681692777@sybase.com>
In-Reply-To: <439d738f.233.1681692777@sybase.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Original-NNTP-Posting-Host: blueice4n2.uk.ibm.com
Message-ID: <43a1359c$1@forums-2-dub>
X-Original-Trace: 15 Dec 2005 01:21:32 -0800, blueice4n2.uk.ibm.com
Lines: 48
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 15 Dec 2005 01:21:33 -0800, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 15 Dec 2005 01:30:53 -0800
X-Trace: forums-1-dub 1134639053 10.22.108.75 (15 Dec 2005 01:30:53 -0800)
X-Original-Trace: 15 Dec 2005 01:30:53 -0800, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:5073
Article PK: 17494


RONDEAU MICHEL wrote:
> I use xp_read_file and xp_write_file for manipulate BLOB.
> But i wish
> to know " current working directory database server" ? how
> to know this directory?

PB 9.0.2.7509
ASA 9.0.2.3044
Win 2K server

We are using xp_read_file() and xp_write_file()
to copy files from one database server to
another (because it's the only way).

I wanted to do just this:

// get packed data
selectblob compress ( xp_read_file ( :as_srcfile ) ) into :lblb_data from dummy using at_src;

// decompress and write data to file
select xp_write_file ( :as_dstfile, decompress ( :lblb_data ) ) into :ll_res from dummy using at_dst;


However there is a bug in powerbuilder (which I've logged with support CR#397153),
so we had to the following:

// get packed data
selectblob compress ( xp_read_file ( :as_srcfile ) ) into :lblb_data from dummy using at_src;

// create remote tmp table
execute immediate 'declare local temporary table tmp_for_unload ( data text ) not transactional' using at_dst;

// insert empty row into tmp table
insert into tmp_for_unload values ( null ) using at_dst;

// update with packed data
updateblob tmp_for_unload set data = :lblb_data using at_dst;

// decompress and write data to file
select xp_write_file ( :as_dstfile, decompress ( t.data ) ) into :ll_res from tmp_for_unload t using at_dst;

// drop temp table
ls_sql = 'drop table tmp_for_unload'
execute immediate :ls_sql using at_dst;

A bit cumbersome, but it works for us.

regards/Peter Simonsen


"Pavel Karady" <pavel_ns.ns_karady Posted on 2005-12-20 11:35:03.0Z
From: "Pavel Karady" <pavel_ns.ns_karady@ns_kogerusa.com>
Newsgroups: ianywhere.public.general
References: <439d738f.233.1681692777@sybase.com>
Subject: Re: PB with xp_read_file
Lines: 20
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: 217.75.90.162
X-Original-NNTP-Posting-Host: 217.75.90.162
Message-ID: <43a7ec67$1@forums-1-dub>
Date: 20 Dec 2005 03:35:03 -0800
X-Trace: forums-1-dub 1135078503 217.75.90.162 (20 Dec 2005 03:35:03 -0800)
X-Original-Trace: 20 Dec 2005 03:35:03 -0800, 217.75.90.162
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:5078
Article PK: 17498

Hi,

I'm surprised that in this forum, people want simple things but what they
mostly get are complex answers of something else that they were looking for.

The "current working directory database server" is the directory, where
dbsrvX.exe is running from; but in Windows, when you run it as a service,
it's where services are being run from - the C:\Windows\system32 directory.

Pavel

<RONDEAU MICHEL> wrote in message news:439d738f.233.1681692777@sybase.com...
>I use xp_read_file and xp_write_file for manipulate BLOB.
> But i wish
> to know " current working directory database server" ? how
> to know this directory?
>
> Thank's


Stephen Rice Posted on 2005-12-22 15:14:19.0Z
From: Stephen Rice <NSsrice@ianywhere.com>
Reply-To: NSsrice@ianywhere.com
Organization: iAnywhere Solutions
User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317)
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: ianywhere.public.general
Subject: Re: PB with xp_read_file
References: <439d738f.233.1681692777@sybase.com> <43a7ec67$1@forums-1-dub>
In-Reply-To: <43a7ec67$1@forums-1-dub>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Original-NNTP-Posting-Host: srice-laptop.sybase.com
Message-ID: <43aac068$1@forums-2-dub>
X-Original-Trace: 22 Dec 2005 07:04:08 -0800, srice-laptop.sybase.com
Lines: 44
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 22 Dec 2005 07:04:11 -0800, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 22 Dec 2005 07:14:19 -0800
X-Trace: forums-1-dub 1135264459 10.22.108.75 (22 Dec 2005 07:14:19 -0800)
X-Original-Trace: 22 Dec 2005 07:14:19 -0800, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:5082
Article PK: 8661

That is sometimes true, but, more often, I think people are trying to
answer the entire question (including the unasked parts). In the
general case the "current working directory" is indeterminate unless you
have tracked every operation that did the equivalent of a "cd" (and it
gets even uglier if you support multiple OS's). The best general answer
is to take the approach Mark & John suggest and explicitly access a
directory.

my 2 cents

/steve

Pavel Karady wrote:
> Hi,
>
> I'm surprised that in this forum, people want simple things but what they
> mostly get are complex answers of something else that they were looking for.
>
> The "current working directory database server" is the directory, where
> dbsrvX.exe is running from; but in Windows, when you run it as a service,
> it's where services are being run from - the C:\Windows\system32 directory.
>
> Pavel
>
> <RONDEAU MICHEL> wrote in message news:439d738f.233.1681692777@sybase.com...
>
>>I use xp_read_file and xp_write_file for manipulate BLOB.
>>But i wish
>>to know " current working directory database server" ? how
>>to know this directory?
>>
>>Thank's
>
>
>

--
Stephen Rice
Technical Services Manager
iAnywhere Solutions

--- Please Post ---
Whitepapers, Tech Docs, Solved Cases, Bug Fixes and
"Report a bug" are all available on www.ianywhere.com


Mark Culp Posted on 2005-12-12 13:30:12.0Z
Message-ID: <439D7941.14F72C8D@iAnywhere.com>
From: Mark Culp <reply_to_newsgroups_only_please_nospam_mark.culp@iAnywhere.com>
X-Mailer: Mozilla 4.75 [en] (Windows NT 5.0; U)
X-Accept-Language: en
MIME-Version: 1.0
Newsgroups: ianywhere.public.general
Subject: Re: PB with xp_read_file
References: <439d738f.233.1681692777@sybase.com>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Original-NNTP-Posting-Host: mculp-pc.sybase.com
X-Original-Trace: 12 Dec 2005 05:21:06 -0800, mculp-pc.sybase.com
Lines: 22
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 12 Dec 2005 05:21:06 -0800, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 12 Dec 2005 05:30:12 -0800
X-Trace: forums-1-dub 1134394212 10.22.108.75 (12 Dec 2005 05:30:12 -0800)
X-Original-Trace: 12 Dec 2005 05:30:12 -0800, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:5062
Article PK: 31522

Try

call xp_cmdshell( 'pwd > some_tmp_file_name' );
select xp_read_file( 'some_tmp_file_name' );
--
Mark Culp
SQLAnywhere Research and Development
-------------------------------------------------------------------------
** Whitepapers, TechDocs, bug fixes are all available through the **
** iAnywhere Developer Community at http://www.ianywhere.com/developer **
-------------------------------------------------------------------------
* <<<<< Please always include the ASA version and build number >>>>> *
* <<<<< _and_ the operating system version that you are using >>>>> *
-------------------------------------------------------------------------

RONDEAU, MICHEL wrote:
>
> I use xp_read_file and xp_write_file for manipulate BLOB.
> But i wish
> to know " current working directory database server" ? how
> to know this directory?
>
> Thank's


RONDEAU Posted on 2005-12-12 17:19:59.0Z
Sender: 1f59.439dad7c.1804289383@sybase.com
From: RONDEAU
Newsgroups: ianywhere.public.general
Subject: Re: PB with xp_read_file
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <439daf1c.1f70.1681692777@sybase.com>
References: <439D7941.14F72C8D@iAnywhere.com>
X-Original-NNTP-Posting-Host: 10.22.241.42
X-Original-Trace: 12 Dec 2005 09:10:52 -0800, 10.22.241.42
Lines: 32
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 12 Dec 2005 09:10:53 -0800, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 12 Dec 2005 09:19:59 -0800
X-Trace: forums-1-dub 1134407999 10.22.108.75 (12 Dec 2005 09:19:59 -0800)
X-Original-Trace: 12 Dec 2005 09:19:59 -0800, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:5067
Article PK: 31525

THe precisions:

Windows 2000 or 2003 server et Sybase 8.0.3

Where i can't find this directory

Thanks

> Try
>
> call xp_cmdshell( 'pwd > some_tmp_file_name' );
> select xp_read_file( 'some_tmp_file_name' );
> --
> Mark Culp
> SQLAnywhere Research and Development
> ----------------------------------------------------------
> --------------- ** Whitepapers, TechDocs, bug fixes are
> all available through the ** ** iAnywhere Developer
> Community at http://www.ianywhere.com/developer **
> ----------------------------------------------------------
> --------------- * <<<<< Please always include the ASA
> version and build number >>>>> * * <<<<< _and_ the
> operating system version that you are using >>>>> *
> ----------------------------------------------------------
> --------------- RONDEAU, MICHEL wrote:
> >
> > I use xp_read_file and xp_write_file for manipulate
> > BLOB. But i wish
> > to know " current working directory database server" ?
> > how to know this directory?
> >
> > Thank's


RONDEAU Posted on 2005-12-12 17:23:38.0Z
Sender: 1f59.439dad7c.1804289383@sybase.com
From: RONDEAU
Newsgroups: ianywhere.public.general
Subject: Precisions
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <439daff3.1f81.1681692777@sybase.com>
References: <439d738f.233.1681692777@sybase.com>
X-Original-NNTP-Posting-Host: 10.22.241.42
X-Original-Trace: 12 Dec 2005 09:14:27 -0800, 10.22.241.42
Lines: 14
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 12 Dec 2005 09:14:28 -0800, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 12 Dec 2005 09:23:38 -0800
X-Trace: forums-1-dub 1134408218 10.22.108.75 (12 Dec 2005 09:23:38 -0800)
X-Original-Trace: 12 Dec 2005 09:23:38 -0800, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:5068
Article PK: 31527

Precisions:
windows 2000 or 2003 serveur ou XP pro

sql anywhere 8.0.3

How to find the name of this directory ?

> I use xp_read_file and xp_write_file for manipulate BLOB.
> But i wish
> to know " current working directory database server" ? how
> to know this directory?
>
> Thank's