Using SQL statements in the code


Author
Message
StrataFrame Team
S
StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
Good to know about that foreign key that exists on the EMPS table.  Thanks for the heads up and I'm glad you're working Smile
Kari Paukku
Kari Paukku
StrataFrame User (139 reputation)StrataFrame User (139 reputation)StrataFrame User (139 reputation)StrataFrame User (139 reputation)StrataFrame User (139 reputation)StrataFrame User (139 reputation)StrataFrame User (139 reputation)StrataFrame User (139 reputation)StrataFrame User (139 reputation)
Group: Forum Members
Posts: 65, Visits: 820
Hi,
just as information, after downloading the latest version of SF (dated 10-10-2006) the attached sample worked and allowed to create a new record into the EMP table.

Cheers,
Kari

ps. Incase somebody tries the example - add the DEPTNO field to the form. Otherwise you get a referential integrity error from Oracle.

Kari Paukku
Kari Paukku
StrataFrame User (139 reputation)StrataFrame User (139 reputation)StrataFrame User (139 reputation)StrataFrame User (139 reputation)StrataFrame User (139 reputation)StrataFrame User (139 reputation)StrataFrame User (139 reputation)StrataFrame User (139 reputation)StrataFrame User (139 reputation)
Group: Forum Members
Posts: 65, Visits: 820
Ben,

thank you very much.

Kari

StrataFrame Team
S
StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
Well, not really... there were several places within the OracleDataSourceItem that changed in order for it to pass the new unit tests, but what I can do is post a new install here by the end of today.
Kari Paukku
Kari Paukku
StrataFrame User (139 reputation)StrataFrame User (139 reputation)StrataFrame User (139 reputation)StrataFrame User (139 reputation)StrataFrame User (139 reputation)StrataFrame User (139 reputation)StrataFrame User (139 reputation)StrataFrame User (139 reputation)StrataFrame User (139 reputation)
Group: Forum Members
Posts: 65, Visits: 820
Great!

Just in case if the update gets delayed, would it be possible to get the "insert"-fix so that I could work on this project during the week-end. Now I'm sort of stuck....

Cheers,

Kari

StrataFrame Team
S
StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
OK, Kari, there is no sequence created that you can use for inserting records into the Scott.Emp table.  So, I tried to manually assign one and got the same error you did.  I tracked it down and corrected the problem and we will be posting an update before the end of the week with some changes to the activation wizard, so this will be included as well.  Thanks for your patience.
Kari Paukku
Kari Paukku
StrataFrame User (139 reputation)StrataFrame User (139 reputation)StrataFrame User (139 reputation)StrataFrame User (139 reputation)StrataFrame User (139 reputation)StrataFrame User (139 reputation)StrataFrame User (139 reputation)StrataFrame User (139 reputation)StrataFrame User (139 reputation)
Group: Forum Members
Posts: 65, Visits: 820
Ben,

attached is a small application that retrieves data from table EMP.
When you retrieve data and update that's fine.
When you insert a new record (use e.g. 1 for EMPNO and Bart for ENAME) then error appears. Autoincrement is set to false.

Cheers,

Kari

Attachments
WinSCOTT.zip (125 views, 781.00 KB)
Kari Paukku
Kari Paukku
StrataFrame User (139 reputation)StrataFrame User (139 reputation)StrataFrame User (139 reputation)StrataFrame User (139 reputation)StrataFrame User (139 reputation)StrataFrame User (139 reputation)StrataFrame User (139 reputation)StrataFrame User (139 reputation)StrataFrame User (139 reputation)
Group: Forum Members
Posts: 65, Visits: 820
Hi,

I have tried both options - that is setting the autoincrement to true and false. No success. I did additional testing using a very simple table from Oracle's SCOTT.EMP using just two columns (EMPNO and ENAME)

As you see - the original error was coming from Oracle but when the autoincrement thing was fixed, then the VB.Net started to give the errors. One more thing, in the debug-window is now SQL-statement for the INSERT.

Would it be possible for you to write a simple application that can be used to enter a row to Oracle's SCOTT.EMP table? Then I could verify that it works in my environment and I could also use that as a reference point whe trying to figure out where it goes wrong. The database version 10g and I'm using VB.Net.

Cheers,

Kari

StrataFrame Team
S
StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
If you are setting your PrimaryKeyIsAutoIncremented property to False, then you will need to manually specify a primary key for the property.  Also, if you set the PrimaryKeyIsAutoIncremented property to True, then you will need to set the OracleSequenceName property on the business object so the business object knows what sequence to use for the auto-incrementing of the primary key.  It is possible that the OracleSequenceName is nothing and that might be what is throwing the error.  Try setting the sequence and let me know what happens.
StrataFrame Team
S
StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
What does the structure of your table look like?
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search