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.

XP_READ_FILE : File Name Path

4 posts in General Discussion Last posting was on 2006-10-10 16:02:20.0Z
Gopala Reddy Posted on 2006-10-04 23:40:58.0Z
Sender: 422.45243781.1804289383@sybase.com
From: Gopala Reddy
Newsgroups: ianywhere.public.general
Subject: XP_READ_FILE : File Name Path
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <452438d0.429.1681692777@sybase.com>
X-Original-NNTP-Posting-Host: 10.22.241.42
X-Original-Trace: 4 Oct 2006 15:42:24 -0700, 10.22.241.42
Lines: 10
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 4 Oct 2006 16:29:51 -0700, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 4 Oct 2006 16:40:58 -0700
X-Trace: forums-1-dub 1160005258 10.22.108.75 (4 Oct 2006 16:40:58 -0700)
X-Original-Trace: 4 Oct 2006 16:40:58 -0700, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:5658
Article PK: 1676

I am trying to load the image file using XP_READ_FILE
statement in dbu. The onlie help mentions that; "The
filename is relative to the starting directory of the
database server". I am trying to find out what is the
starting directory of my sybase database server?

The problem I am trying to solve is; I want to load the
image file from the directory relative to my dbu file
location. I am not able to do this, so could someone please
help me out with this problem?


Rob Waywell Posted on 2006-10-05 13:49:21.0Z
From: "Rob Waywell" <rwaywell_no_spam_please@ianywhere.com>
Newsgroups: ianywhere.public.general
References: <452438d0.429.1681692777@sybase.com>
Subject: Re: XP_READ_FILE : File Name Path
Lines: 38
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2869
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2962
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: rwaywell-xp2.sybase.com
X-Original-NNTP-Posting-Host: rwaywell-xp2.sybase.com
Message-ID: <45250d61$1@forums-1-dub>
Date: 5 Oct 2006 06:49:21 -0700
X-Trace: forums-1-dub 1160056161 10.25.98.235 (5 Oct 2006 06:49:21 -0700)
X-Original-Trace: 5 Oct 2006 06:49:21 -0700, rwaywell-xp2.sybase.com
X-Authenticated-User: techsupp
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:5659
Article PK: 1677

How are you starting the database server? From the command line or as a
service?
What is/are the full command line/parameters you are using to start the
database server?
What is your exact XP_READ_FILE() statement?

--
-----------------------------------------------
Robert Waywell
Sybase Adaptive Server Anywhere Developer - Version 8
Sybase Certified Professional

Sybase's iAnywhere Solutions

Please respond ONLY to newsgroup

EBF's and Patches: http://downloads.sybase.com
choose SQL Anywhere Studio >> change 'time frame' to all

To Submit Bug Reports:
http://case-express.sybase.com/cx/cx.stm?starturl=casemessage.ssc?CASETYPE=Bug

SQL Anywhere Studio Supported Platforms and Support Status
http://my.sybase.com/detail?id=1002288

<Gopala Reddy> wrote in message news:452438d0.429.1681692777@sybase.com...
>I am trying to load the image file using XP_READ_FILE
> statement in dbu. The onlie help mentions that; "The
> filename is relative to the starting directory of the
> database server". I am trying to find out what is the
> starting directory of my sybase database server?
>
> The problem I am trying to solve is; I want to load the
> image file from the directory relative to my dbu file
> location. I am not able to do this, so could someone please
> help me out with this problem?


Stephen Rice Posted on 2006-10-05 14:36:42.0Z
From: "Stephen Rice" <sriceATianywhereDOTcom>
Newsgroups: ianywhere.public.general
References: <452438d0.429.1681692777@sybase.com>
Subject: Re: XP_READ_FILE : File Name Path
Lines: 32
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2869
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2962
X-RFC2646: Format=Flowed; Original
X-Original-NNTP-Posting-Host: srice-xp2.sybase.com
Message-ID: <452508af$1@forums-2-dub>
X-Original-Trace: 5 Oct 2006 06:29:19 -0700, srice-xp2.sybase.com
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 5 Oct 2006 07:33:00 -0700, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 5 Oct 2006 07:36:42 -0700
X-Trace: forums-1-dub 1160059002 10.22.108.75 (5 Oct 2006 07:36:42 -0700)
X-Original-Trace: 5 Oct 2006 07:36:42 -0700, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:5660
Article PK: 1678

Determining the current working directory (cwd) of your server can be a bit
of a challenge on some operating systems.

Assuming you can't just hardcode the location (I wouldn't do that for
production) and since it's difficult to rely on the cwd remaining constant
throughout time I suggest you use the system stored procedure sa_db_info()
to get the full filespec for your database file and parse out the directory
information. You can then combine this with the information you have for
your file and provide a full path to xp_read_file()

HTH
--
/steve

Stephen Rice
Technical Services Manager
iAnywhere (a Sybase Company)
email: srice@ianywhere.com

<Gopala Reddy> wrote in message news:452438d0.429.1681692777@sybase.com...
>I am trying to load the image file using XP_READ_FILE
> statement in dbu. The onlie help mentions that; "The
> filename is relative to the starting directory of the
> database server". I am trying to find out what is the
> starting directory of my sybase database server?
>
> The problem I am trying to solve is; I want to load the
> image file from the directory relative to my dbu file
> location. I am not able to do this, so could someone please
> help me out with this problem?


Stephen Rice Posted on 2006-10-10 16:02:20.0Z
From: "Stephen Rice" <sriceATianywhereDOTcom>
Newsgroups: ianywhere.public.general
References: <452438d0.429.1681692777@sybase.com> <452508af$1@forums-2-dub>
Subject: Re: XP_READ_FILE : File Name Path
Lines: 76
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2869
X-RFC2646: Format=Flowed; Response
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2962
NNTP-Posting-Host: srice-xp2.sybase.com
X-Original-NNTP-Posting-Host: srice-xp2.sybase.com
Message-ID: <452bc40c$1@forums-1-dub>
Date: 10 Oct 2006 09:02:20 -0700
X-Trace: forums-1-dub 1160496140 10.25.98.210 (10 Oct 2006 09:02:20 -0700)
X-Original-Trace: 10 Oct 2006 09:02:20 -0700, srice-xp2.sybase.com
X-Authenticated-User: techsupp
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:5668
Article PK: 1682

Because of problems accessing the nntp server some of this conversation
continued in email. Here is the thread so far...
---

The mssql syntax you used for the insert is not supported by SQLAny. The
following syntax should be used:

insert into #DBInfo select * from SA_DB_Info();

HTH

/steve


Re: XP_READ_FILE : File Name Path

Hello Stephen,
I tried to post this in the newsgroup but for some reason it didn't work.
For the some reason I get a SQL syntax errror while executing the SQL
mentioned below. I tried this SQL on MS SQL Server and it works fine. Could
please let me know what I doing wrong here?
Thanks
Gopala
-----------------------------------------------
create table #DBInfo
(
NumberCol int,
AliasCol char(255),
FileDir char(255),
ConnCountCol int,
PageSizeCol int,
LogNameCol char(255)
);

insert #DBInfo exec SA_DB_Info;

select * from #DBInfo;

drop table #DBInfo;
-----------------------------------------------

"Stephen Rice" <sriceATianywhereDOTcom> wrote in message
news:452508af$1@forums-2-dub...
> Determining the current working directory (cwd) of your server can be a
> bit of a challenge on some operating systems.
>
> Assuming you can't just hardcode the location (I wouldn't do that for
> production) and since it's difficult to rely on the cwd remaining constant
> throughout time I suggest you use the system stored procedure sa_db_info()
> to get the full filespec for your database file and parse out the
> directory information. You can then combine this with the information you
> have for your file and provide a full path to xp_read_file()
>
> HTH
> --
> /steve
>
> Stephen Rice
> Technical Services Manager
> iAnywhere (a Sybase Company)
> email: srice@ianywhere.com
>
> <Gopala Reddy> wrote in message news:452438d0.429.1681692777@sybase.com...
>>I am trying to load the image file using XP_READ_FILE
>> statement in dbu. The onlie help mentions that; "The
>> filename is relative to the starting directory of the
>> database server". I am trying to find out what is the
>> starting directory of my sybase database server?
>>
>> The problem I am trying to solve is; I want to load the
>> image file from the directory relative to my dbu file
>> location. I am not able to do this, so could someone please
>> help me out with this problem?
>
>