Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I need basic syntax help

Status
Not open for further replies.

thendrickson

Programmer
Apr 14, 2004
226
0
0
US
I am a SQL Server developer with some old experience with a UNIX OS

I need to develop a stored procedure for an Informix database located on a linked server, but I seem to be getting syntax errors that I do not quite understand.

Could some one post a couple of examples of a basic stored procedure that accepts 1 or more input parameters? Preferably the varchar datatype for one of the parameters.

Additionally, I am using an application named dbaccess under UNIX. dbaccess permis me to open the vi editor from within dbaccess.

When I past my code into the vi editor, it loks pretty good but when I attempt to run the code in dbaccess several of the lines appear truncated.

I have few permissions other than to create stored procedures under my login even though this is a development server, so I am limited to these basic tools.

Thanks

 
It's this waht you have in mind:

Code:
CREATE PROCEDURE test_sp(x_char VARCHAR(50))
    RETURNING VARCHAR(255);

LET x_char = "my value";

RETURN x_char;

END PROCEDURE;

Execute it from dbaccess:

Code:
EXECUTE PROCEDURE test_sp("your value")
 
Bingo!

CREATE PROCEDURE test_sp(x_char VARCHAR(50))
RETURNING VARCHAR(255); <-------- I did not have this semicolon!!!!

I said it was basic. I could not find a simple example to build from.

Thank you very much
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top