VA 7.5 Upgrade Oracle support to v10

VA Smalltalk is a "100% VisualAge compatible" IDE that includes the original VisualAge technology and the popular VA Assist and WidgetKit add-ons.

Moderators: Eric Clayberg, wembley, tc, Diane Engles, solveig

VA 7.5 Upgrade Oracle support to v10

Postby mariocarrera » Tue May 15, 2007 8:33 am

Hi!
I read that it is an upgrade Oracle support to v10. I use actuali vast 601 and oracle 10 and I have no probles, I want to know wy I need the new suport?
thanks

Mario
mariocarrera
 
Posts: 17
Joined: Thu Dec 14, 2006 6:53 am

Postby tc » Sat May 19, 2007 10:58 am

Hello,

The Oracle 10 feature of VA Smalltalk provide LOBs (true LOB suppport), and BFile support. It also includes fixes.

For example, the following high level DB code did not work with native Oracle:

Code: Select all
| connection newRow table oc |
(AbtDatabaseConnectionSpec forDbmClass: AbtOracle10DatabaseManager databaseName: 'orcl') connect.
connection := AbtDbmSystem activeDatabaseConnection.
table := (connection openTableNamed: 'sql_table').
oc := OrderedCollection new.
1 to: 2 do: [ :n |
   newRow := table emptyRow.
   newRow
      at: #ID put: n;
      at: #LAST_NAME put: 'SMITH', n asString;
      at: #START_DATE put: Date today.
   oc add: newRow ].
connection autoCommit: true.
table addRows: oc

. . . a LOB script is as follows:

Code: Select all
"Insert an empty blob in a table"
| connection table oc clob newRow |
(AbtDatabaseConnectionSpec forDbmClass: AbtOracle10DatabaseManager databaseName: 'orcl') connect.
connection := AbtDbmSystem activeDatabaseConnection.
connection autoCommit: true.
table := (connection openTableNamed: 'clob_table').
clob := AbtOracleEmptyClob new.
oc := OrderedCollection new.
newRow := table emptyRow.
newRow
   at: #ID put: 5;
   at: #DATA put: clob.
oc add: newRow.
table addRows: oc.

. . . an empty LOB must first be inserted (above) then the data is inserted:

Code: Select all
| result fromFile querySpec resultCollection sqlString dict connection lobLocator buffer |
"get locator address"
(AbtDatabaseConnectionSpec forDbmClass: AbtOracle10DatabaseManager databaseName: 'orcl') connect.
connection := AbtDbmSystem activeDatabaseConnection.
sqlString :=  'select * from clob_table where id = 5 for update'.
querySpec := (AbtQuerySpec new) statement: sqlString.
resultCollection := OrderedCollection new.
result := connection resultTableFromQuerySpec: querySpec.
result do: [:eachRow | resultCollection add: eachRow asDictionary ].
dict := resultCollection first.
lobLocator := (dict at: 'DATA') locatorAddress.

buffer := 'Hello World!  Hello World! Hello World!  Hello World! Hello World!  Hello World! Hello World!  Hello World! Hello World!  Hello World!' asByteArray.
AbtOracleLobBuffer new
   writeBufferToLob: lobLocator buffer: buffer connection: connection.
connection commitUnitOfWork

--tc
tc
Moderator
 
Posts: 304
Joined: Tue Oct 17, 2006 7:40 am
Location: Raleigh, NC


Return to VA Smalltalk 7.0, 7.5 & 8.0

Who is online

Users browsing this forum: No registered users and 1 guest