If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Sybase > IQ 12.4 - Load Statement

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-02-03, 23:10
bmalar bmalar is offline
Registered User
 
Join Date: Feb 2003
Location: Brisbane, Australia
Posts: 110
IQ 12.4 - Load Statement

I am trying to create a stored proc in IQ 12.4.2 that loads a table. The sp goes along the following lines.

CREATE PROC load_tbl_a(in @input_file varchar)

BEGIN

load table a
(
col_1 '\x0d\x0a'
)
FROM @input_file
ESCAPES off
QUOTES off
;
END

The goal is to allow the input file to be passed to the stored proc. However IQ doesn't seem to like this. It only seems to accept hardcoded file paths such as:

load table a
(
col_1 '\x0d\x0a'
)
FROM 'C:\\inputfile.dat'

Does anyone know of a way I can achieve passing the filename to the stored proc?
Reply With Quote
  #2 (permalink)  
Old 03-06-03, 00:22
bmalar bmalar is offline
Registered User
 
Join Date: Feb 2003
Location: Brisbane, Australia
Posts: 110
Re: IQ 12.4 - Load Statement

I worked it out.. An execute immediate will do the trick. thanks anyways


Quote:
Originally posted by bmalar
I am trying to create a stored proc in IQ 12.4.2 that loads a table. The sp goes along the following lines.

CREATE PROC load_tbl_a(in @input_file varchar)

BEGIN

load table a
(
col_1 '\x0d\x0a'
)
FROM @input_file
ESCAPES off
QUOTES off
;
END

The goal is to allow the input file to be passed to the stored proc. However IQ doesn't seem to like this. It only seems to accept hardcoded file paths such as:

load table a
(
col_1 '\x0d\x0a'
)
FROM 'C:\\inputfile.dat'

Does anyone know of a way I can achieve passing the filename to the stored proc?
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On