Re: Trouble creating stored procedure
Posted in 1998
Doug Poland wrote:
>
> My problem is I cannot create a stored procedure with either the LOAD,
> UNLOAD, or SYSTEM commands. Here's the code...
>
> CREATE PROCEDURE inf_spphonenumbers ( mid INT )>
> DELETE FROM inf_phonenumbers;>
> UNLOAD TO 'phone.in' DELIMITER ','> #^
> # 201: A syntax error has occurred.
> #
> SELECT mstr_id, m_phone, m_fax, svc_phone
> FROM inf_dif_reminder>
> SYSTEM '/usr/diskw2/sql/BuildPhoneNumbers.csh phone.in';
>
> LOAD FROM 'phone.out' DELIMITER ','
> INSERT INTO inf_phonenumbers ( DealerID, MailID, PhoneTypeID,
> PhoneNumber)>
> END PROCEDURE
>
> DOCUMENT
> 'Builds inf_phonenumbers(MailID)';
Doug, this is an easy mistake to make. LOAD and UNLOAD statements,
although they can be used in dbaccess and isql QueryLanguage, are not
true SQL statements. They are utility functions that dbaccess executes
on its own. A true SQL statement sent to the engine to be executed, with
the results sent back to dbaccess. Hence the syntax errors on LOAD and
UNLOAD commands.
Syntax error for using the SYSTEM command? Nah! Maybe an omitted
semi-colon (;) in the previous statement is hitting the syntax checker
at the SYSTEM statement.
> BTW, I'm using dbaccess on Informix 4.? on SCO UNIX SVR3.2v4.2
I find thaat verrry deeffeecult to believe, Meesterrr Smart.. ;-)
--
-- Jake (Never yelled "CROWDED THEATER!" during a fire)
+------------------------------------------------------------+
| The expedient performance of a task with excessive concern |
| regarding its duration-to-completion engenders a virtual |
| certainty of diminished benefit therefrom. |
| -- Benjamin Franklin (but he said it in 3 words) |
+------------------------------------------------------------+