Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Help with Visual Basic "INSERT" statement
On Tue, 28 Aug 2001, pixelmeow_at_aol.com wrote:
> I am using Visual Basic 6 to connect to an Oracle 8i database > and add records. I have a sequence defined, main_pkey, which > increments the pkey field of the main table. I have this code, > using RDO, in VB, which updates the table main: > > ... > rs.rdoColumns("pkey").Value = main_pkey.nextval > rs.rdoColumns("title").Value = Decode(i).First.Title > rs.rdoColumns("onlink").Value = Decode(i).First.OnLink > rs.rdoColumns("northbc").Value = Decode(i).First.NorthBC > ... > > Now, as you probably know, that first line doesn't work. Does > *anyone* here know how I can do this???
Is there a way to print out the SQL that is actually executing?
It needs to look something like:
update table set pkey = main_pkey.nextval, title = 'XXX', ...
,----[ HERE'S AN EXAMPLE ]
| SQL> create table test (fld1 int, fld2 varchar(5));
|
| Table created.
|
| SQL> insert into test values (test_seq.nextval, 'AA');
|
| 1 row created.
|
| SQL> update test set fld1 = test_seq.nextval, fld2 = 'BB';
|
| 1 row updated.
|
| SQL> select * from test;
|
| FLD1 FLD2
| ---------- -----
| 4 BB
|
| SQL> update test set fld1 = test_seq.nextval, fld2 = 'CC';
|
| 1 row updated.
|
| SQL> select * from test;
|
| FLD1 FLD2
| ---------- -----
| 5 CC
`----
I'm not sure what happens after the code is executed, but it needs to resolve to a statement like the update above.
-- Galen Boyer It seems to me, I remember every single thing I know.Received on Wed Aug 29 2001 - 09:54:18 CDT
![]() |
![]() |