dbTalk Databases Forums  

Re: SERVER CRASH on execute UNLOAD CMD

sybase.public.sqlanywhere.general sybase.public.sqlanywhere.general


Discuss Re: SERVER CRASH on execute UNLOAD CMD in the sybase.public.sqlanywhere.general forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Bruce Hay
 
Posts: n/a

Default Re: SERVER CRASH on execute UNLOAD CMD - 04-26-2006 , 09:22 AM






The UNLOAD statement can accept a variable containing the filename. Used
this way, you do not need to use EXECUTE IMMEDIATE. Since the statement is
not being re-parsed, the filename's backslashes do not need to be doubled.

It's not clear that you're seeing a server crash here, but rather just an
error being returned indicating that the filename is invalid.

set @f=getEDIROOT(@md)+@fn;
UNLOAD SELECT replace( @RESULT, '\x0A',char(13)+char(10) )
TO @f
QUOTES OFF ESCAPES OFF HEXADECIMAL OFF APPEND ON;


Whitepapers, TechDocs, bug fixes are all available through the iAnywhere
Developer Community at http://www.ianywhere.com/developer

"Torsten Brinkmann" <t.brinkmann (AT) svs_ungueltig (DOT) de> wrote

Quote:
Hello,
i' ve some probs with server crash while UNLOAD SELECT statement with
execute immediate command.
I use UNC Path to UNLOAD/LOAD data. The LOAD / UNLOAD needs 3 backslashes
in
path to work.

set @f=getEDIROOT(@md)+@fn;
execute immediate 'UNLOAD SELECT replace( @RESULT, ''\x0A'',
char(13)+char(10) ) TO '''+LPATH(@f)+''' QUOTES OFF ESCAPES OFF
HEXADECIMAL
OFF APPEND ON';
message @RESULT type info to client

Calling UNLOAD without LPATH function will show Access Error (File or path
does not exist).

-- Function LPATH because LOAD / UNLOAD need '\' 3x .
CALL DROPMETHODE('LPATH');
create function LPATH(@path_ char(255)) returns char(255) NOT
DETERMINISTIC
begin
if left(@path, 1) = '\' then
return '\\' + @path_;
else
return @path_;
end if;
end;
Im using Adaptive Server Anywhere 9.0.2.3244

Is it a bug or feature ? Some tips to workaround ? What is correct
usage
of UNC with LOAD / UNLOAD ?
Best regards,









Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.