Sending commands using oledb command object

From: Kenneth Axelsson <kaxelsson_at_jda.com>
Date: 8 Mar 2002 06:48:32 -0800
Message-ID: <9260fb02.0203080648.7d6b9ec0_at_posting.google.com>


The OLEDB drivers from IBM for AS/400 allows me to use the Command Object to send more or less any command to the AS/400. I can also through the Command Object execute any user written program on the AS/400 and get the result back.

For example to execute a prgram that multiply two numbers and return the result, the code looks something like this

cmd.CommandText = "{{CALL MULTIPLY(?<?<?)}}; cmd.CommandType = CommandType.Text;

cmd.Parameters.Add("P1", OleDbType.Decimal);
.
.

etc

cmd.Prepare();
cmd.Parameters[0] = 3;
cmd.Parameters[1] = 5;
cmd.ExecuteQuery();

The result will be returned in the third parameter.

Anybody knows if it is possible to do the same thing with any other OLEDB providers and Host systems, e.g. Orcale on Unix?

Thanks,
Ken Received on Fri Mar 08 2002 - 15:48:32 CET

Original text of this message