Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problem with SQL in a View
Message
 
 
À
14/09/2003 17:15:22
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00828814
Message ID:
00828854
Vues:
15
A string literal is limited to 255 characters, a character field to 254 characters.

>>>HI,
>>>
>>>Is there any limit in sql clouse in view designer. I create a view from a table containing 12 fields, having 1 join, and 14 where conditions. It did not accept them all (altohout are valid) just says error and in SQL preview window my sql statemet is truncated.
>>>
>>>Also it dont vork if i try to make this view programaticaly.
>>>
>>>Thanks
>>
>>Does it work as SQL? Can you post it here?
>
>Ifound the problem. The thing is that foxpro string literal is limited to 254 chars. Most probably VFP view wizard whe it compiles the wizard chosen setings to sql string to execute query it also get in trouble vith this limit.
>If you do
>
>
lcsql='SELECT ...... long clouse na conditinons'
>over 255 shars and than create sql view it dosn't works.
>But if you do TEXT to lcSQL .... then big strinh ...ENDTEXT, and then create sql view it just works fine.
>
>Here is he sql and you see that it is quite normal (simple but long one):
>
>SELECT Spec_cek.specid, Spec_cek.bankaid,
>Spec_cek.sifra_spec,Spec_cek.data_spec, Spec_cek.docid, Spec_cek.tip_dok,
>Spec_cek.komid_do,Spec_cek.data_prim, Spec_cek.data_nap, Spec_cek.ime_pre,
>Spec_cek.br_lk,Spec_cek.ser_broj_cek, Spec_cek.ser_broj_tekovna,
>Spec_cek.iznos,Spec_cek.realiziran, Spec_cek.sifra_rab, Spec_cek.zabeleska,
>Banki.naziv FROM  blagajna!spec_cek LEFT OUTER JOIN blagajna!banki ON
>Spec_cek.bankaid = Banki.bankid WHERE Spec_cek.komid_do = ?m_sifra_kom_do
>AND Spec_cek.ser_broj_cek >= ?m_ser_broj_od
>AND Spec_cek.ser_broj_cek <= ?m_ser_broj_do AND
>Spec_cek.sifra_spec >= ?m_spec_od AND Spec_cek.sifra_spec<= ?m_spec_do
>AND Spec_cek.data_prim >= ?m_od_data_prim AND Spec_cek.data_prim <= ?
>m_do_data_prim AND Spec_cek.data_nap >= ?m_od_data_nap
>AND Spec_cek.data_nap <= ?m_do_data_nap AND Spec_cek.bankaid = ?m_banka_od
>AND Spec_cek.IME_PRE == ?m_ime_pre AND Spec_cek.tekovna == ?m_tekovna
>AND Spec_cek.br_lk == ?m_br_lk AND Spec_cek.iznos >= ?m_od_iznos
>AND Spec_cek.iznos <= ?m_do_iznos
>
>Vladimir
--sb--
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform