QueryInformation: SQL Generated for DB2 is incorrect


Author
Message
PeterA
PeterA
StrataFrame Novice (78 reputation)StrataFrame Novice (78 reputation)StrataFrame Novice (78 reputation)StrataFrame Novice (78 reputation)StrataFrame Novice (78 reputation)StrataFrame Novice (78 reputation)StrataFrame Novice (78 reputation)StrataFrame Novice (78 reputation)StrataFrame Novice (78 reputation)
Group: Forum Members
Posts: 72, Visits: 235
I'm hooking into DB2 and it returns a DB2 error when I start view the ASP page:



[DB2Exception (0x80004005): ERROR [42601] [IBM][DB2/NT] SQL0104N An unexpected token "[ID_SUPPLIER], [NM_SUPPLIER], [CD_COUNTRY], [IND_STATUS] FROM " was found following "SELECT DISTINCT ". Expected tokens may include: "". SQLSTATE=42601]




In this case, I believe the SQL is being generated incorrectly because of the square brackets around each field name - DB2 doesn't accept these. Are there any options I need to set on the QueryInformation object to change how it generates SQL and for what database?



Thanks in advance!

Peter
Replies
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
Excellent.  Glad it's working for you Smile 

As for the objects, we tried to keep the names the same as the corresponding ADO.NET provider objects (except for a few cases where the data source uses OLE DB.

SqlDataSourceItem -> System.Data.SqlClient.SqlCommand

OracleDataSourceItem -> System.Data.OracleClient.OracleCommand

Db2DataSourceItem -> IBM.Data.DB2.DB2Command (technically this one accepts a factory, so you can use whatever provider is optimized for your database type since DB2 has several different versions of their ADO.NET provider and we didn't want to limit you)

VfpDataSourceItem -> System.Data.OleDb.OleDbCommand

AccessDataSourceItem -> System.Data.OleDb.OleDbCommand

PeterA
PeterA
StrataFrame Novice (78 reputation)StrataFrame Novice (78 reputation)StrataFrame Novice (78 reputation)StrataFrame Novice (78 reputation)StrataFrame Novice (78 reputation)StrataFrame Novice (78 reputation)StrataFrame Novice (78 reputation)StrataFrame Novice (78 reputation)StrataFrame Novice (78 reputation)
Group: Forum Members
Posts: 72, Visits: 235
Ben Chase (08/30/2007)
Excellent. Glad it's working for you Smile



As for the objects, we tried to keep the names the same as the corresponding ADO.NET provider objects (except for a few cases where the data source uses OLE DB.



SqlDataSourceItem -> System.Data.SqlClient.SqlCommand



OracleDataSourceItem -> System.Data.OracleClient.OracleCommand



Db2DataSourceItem -> IBM.Data.DB2.DB2Command (technically this one accepts a factory, so you can use whatever provider is optimized for your database type since DB2 has several different versions of their ADO.NET provider and we didn't want to limit you)



VfpDataSourceItem -> System.Data.OleDb.OleDbCommand



AccessDataSourceItem -> System.Data.OleDb.OleDbCommand




That's good to know and I'll have to keep it in mind. I'd probably have realized that if I'd worked in .NET technologies prior to now (I know more about PHP/MySQL applications than anything else at the moment).



Thanks!

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
I know more about PHP/MySQL applications than anything else at the moment

Mmm, the good old days.  That's where I started my SQL exploits.  Still to this day, I think LIMIT instead of TOP.

Don't worry about .NET, though, you'll get the hang of it quickly enough.

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