Pass UPDATE SQL statement w/data as a String to a Calling Property/CmdText

Hello
I’m trying to create a UPDATE SQL statement that will include the data, and be passed to a calling Property/CommandText as a String. See below my two examples.

Software specs: Oracle 10.5, Tuxedo, VB 2008, Visual Studio.NET

The first is the original and will expose the data with each of the variables, including the row number in cKEY_SEQ.

UPDATE DEV4.DB_ENVIRONMENTS
SET CITRIX_ICON_NAME = :cCITRIX_ICON_NAME,
DB_NAME = :DB_NAME,
TUX_SERVER = :TUX_SERVER,
TUXCFG_INI = :TUXCFG_INI
WHERE (DB_ENVIRONMENTS.KEY_SEQ = :cKEY_SEQ)

In this second example, I used the Oracle TOAD option - Editor|Make Code Statement, to set it up as a string. But notice it hides the variables containing the data rather than expose them so the data in the variables can be passed.

**SQL = " UPDATE DEV4.DB_ENVIRONMENTS "
SQL = SQL & " SET CITRIX_ICON_NAME = :cCITRIX_ICON_NAME, "
SQL = SQL & " DB_NAME = :DB_NAME, "
SQL = SQL & " TUX_SERVER = :TUX_SERVER, "
SQL = SQL & " TUXCFG_INI = :TUXCFG_INI "
SQL = SQL & " WHERE (DB_ENVIRONMENTS.KEY_SEQ = :cKEY_SEQ) "
**If the second one IS the correct way of passing data via a stringed SQL, could one please show me how I can enter that data in the sql so it can be executed in the recordset.

I would appreciate you help with this. Thanks.

Kevin

Message was edited by: Kevin33809 Message was edited by: Kevin33809

Message was edited by: Kevin33809

Message from: wimdelange_062

The generated code looks fine to me. But much is depending on your environment
where the code has to be executed. In some environments the : (colon) should be
a ?. But I don’t often use this feature. Groetjes, Wim On Tue, May 3, 2011 at
01:07, {Toad for Oracle} on behalf of {Kevin Lowers}


Historical Messages

Author: Wim de lange
Date: Tue May 03 00:15:35 PDT 2011
The generated code looks fine to me. But much is depending on your environment
where the code has to be executed. In some environments the : (colon) should be
a ?. But I don’t often use this feature. Groetjes, Wim On Tue, May 3, 2011 at
01:07, {Toad for Oracle} on behalf of {Kevin Lowers}
__

Author: Kevin Lowers
Date: Mon May 02 16:05:35 PDT 2011

Hello
I’m trying to create a UPDATE SQL statement that will include the data, and
be passed to a calling Property/CommandText as a String. See below my two
examples.

Software specs: Oracle 10.5, Tuxedo, VB 2008, Visual Studio.NET

The first is the original and will expose the data with each of the variables,
including the row number in cKEY_SEQ.

UPDATE DEV4.DB_ENVIRONMENTS
SET CITRIX_ICON_NAME = :cCITRIX_ICON_NAME,
DB_NAME = :DB_NAME,
TUX_SERVER = :TUX_SERVER,
TUXCFG_INI = :TUXCFG_INI
WHERE (DB_ENVIRONMENTS.KEY_SEQ = :cKEY_SEQ)

In this second example, I used the Oracle TOAD option - Editor|Make Code
Statement, to set it up as a string. But notice it hides the variables
containing the data rather than expose them so the data in the variables can be
passed.

SQL = " UPDATE DEV4.DB_ENVIRONMENTS "
SQL = SQL & " SET CITRIX_ICON_NAME = :cCITRIX_ICON_NAME, "
SQL = SQL & " DB_NAME = :DB_NAME, "
SQL = SQL & " TUX_SERVER = :TUX_SERVER, "
SQL = SQL & " TUXCFG_INI = :TUXCFG_INI "
SQL = SQL & " WHERE (DB_ENVIRONMENTS.KEY_SEQ = :cKEY_SEQ) "

If the second one IS the correct way of passing data via a stringed SQL, could
one please show me how I can enter that data in the sql so it can be executed in
the recordset.

I would appreciate you help with this. Thanks.

Kevin

Message was edited by: Kevin33809 Message was edited by: Kevin33809 Message was
edited by: Kevin33809
__


The generated code looks fine to me. But much is depending on your
environment where the code has to be executed. In some environments the :
(colon) should be a ?. But I don’t often use this feature.

Groetjes,
Wim

On Tue, May 3, 2011 at 01:07, {Toad for Oracle} on behalf of {Kevin Lowers}