commandbuilder generated sql commands

G

Guest

is there a way to influence the sql command that the commandbuilder
generates???? by default, those are extremely "ugly" sql commands, and i
don't really understand the purpose of all the sql that is generated

below is one such command, and i'm using a database (fox .dbc file) that
errs "sql statement too long" when i try to run this command (using
dataadapter.update() method for updating a row in a table)

what is the parameters after the where ... clause? i understand the first
part where it searches for the matching row via a primary key value but those
?= 1 OR something parts really confuse me.
please help

UPDATE rsdkdat SET rs_datrea = ? , rs_posmat = ? , rs_datdok = ? , rs_datpre
= ? , rs_datpri = ? , rs_novter = ? , rs_opimov = ? , rs_tipvla = ? WHERE (
(rs_brjdok = ?) AND ((? = 1 AND rs_datrea IS NULL) OR (rs_datrea = ?)) AND
((? = 1 AND rs_tipnal IS NULL) OR (rs_tipnal = ?)) AND ((? = 1 AND rs_posmat
IS NULL) OR (rs_posmat = ?)) AND ((? = 1 AND rs_brjlok IS NULL) OR (rs_brjlok
= ?)) AND ((? = 1 AND rs_primat IS NULL) OR (rs_primat = ?)) AND ((? = 1 AND
rs_sifmov IS NULL) OR (rs_sifmov = ?)) AND ((? = 1 AND rs_stabro IS NULL) OR
(rs_stabro = ?)) AND ((? = 1 AND rs_napom1 IS NULL) OR (rs_napom1 = ?)) AND
((? = 1 AND rs_napom2 IS NULL) OR (rs_napom2 = ?)) AND ((? = 1 AND rs_demdin
IS NULL) OR (rs_demdin = ?)) AND ((? = 1 AND rs_vriskl IS NULL) OR (rs_vriskl
= ?)) AND ((? = 1 AND rs_staslg IS NULL) OR (rs_staslg = ?)) AND ((? = 1 AND
rs_valpla IS NULL) OR (rs_valpla = ?)) AND ((? = 1 AND rs_indskl IS NULL) OR
(rs_indskl = ?)) AND ((? = 1 AND rs_tipkup IS NULL) OR (rs_tipkup = ?)) AND
((? = 1 AND rs_datdok IS NULL) OR (rs_datdok = ?)) AND ((? = 1 AND rs_radmod
IS NULL) OR (rs_radmod = ?)) AND ((? = 1 AND rs_datpre IS NULL) OR (rs_datpre
= ?)) AND ((? = 1 AND rs_terpre IS NULL) OR (rs_terpre = ?)) AND ((? = 1 AND
rs_vrjpre IS NULL) OR (rs_vrjpre = ?)) AND ((? = 1 AND rs_tipser IS NULL) OR
(rs_tipser = ?)) AND ((? = 1 AND rs_sersav IS NULL) OR (rs_sersav = ?)) AND
((? = 1 AND rs_usenam IS NULL) OR (rs_usenam = ?)) AND ((? = 1 AND rs_brjori
IS NULL) OR (rs_brjori = ?)) AND ((? = 1 AND rs_regozn IS NULL) OR (rs_regozn
= ?)) AND ((? = 1 AND rs_datreg IS NULL) OR (rs_datreg = ?)) AND ((? = 1 AND
rs_kilome IS NULL) OR (rs_kilome = ?)) AND ((? = 1 AND rs_brjsas IS NULL) OR
(rs_brjsas = ?)) AND ((? = 1 AND rs_brjmot IS NULL) OR (rs_brjmot = ?)) AND
((? = 1 AND rs_datpri IS NULL) OR (rs_datpri = ?)) AND ((? = 1 AND rs_vrizak
IS NULL) OR (rs_vrizak = ?)) AND ((? = 1 AND rs_vripre IS NULL) OR (rs_vripre
= ?)) AND ((? = 1 AND rs_novter IS NULL) OR (rs_novter = ?)) AND ((? = 1 AND
rs_sifrad IS NULL) OR (rs_sifrad = ?)) AND ((? = 1 AND rs_orgjed IS NULL) OR
(rs_orgjed = ?)) AND ((? = 1 AND rs_vrsrad IS NULL) OR (rs_vrsrad = ?)) AND
((? = 1 AND rs_gorivo IS NULL) OR (rs_gorivo = ?)) AND ((? = 1 AND rs_zamdje
IS NULL) OR (rs_zamdje = ?)) AND ((? = 1 AND rs_tiprad IS NULL) OR (rs_tiprad
= ?)) AND ((? = 1 AND rs_opimov IS NULL) OR (rs_opimov = ?)) AND ((? = 1 AND
rs_tipvla IS NULL) OR (rs_tipvla = ?)) )
 
V

Val Mazur

Hi,

You cannot influence how CommandBuilder generates this statement, but you do
not have to use CommandBuilder in your code. What you could do is to create
Update, Delete and Insert command using your own code and specify your own
SQL statements for them.
 
W

William \(Bill\) Vaughn

See my article on the CommandBuilder. http://www.betav.com/msdn_magazine.htm

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top