Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Sql view to Oracle doesn't return match records
Message
De
08/09/2000 09:37:10
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00412559
Message ID:
00414093
Vues:
23
I answer you between your lines.
>First, I would remove the m. from the parameters in the SQL --
Ok.

>
>...WHERE Tartigen.CDARTGEN = ?cCodigo
>cCodigo = "D0001234"
>requery("producto") && returns no records found
>
>Second, what is the value returned in the view that does work? D0001234 or D00012340?

D0001234 of course. D00012340 does not exist.

>
>What happens if you set [in my example above], cCodigo = "D0001234 " and requery?
No match records
>
>YOu may have to try:
>
>... WHERE RTRIM(Tartigen.CDARTGEN) = ?cCodigo
>cCodigo = "D0001234"

¡¡¡ this works fine !!!
¿Will be, this method, optimized?
And so, ¿why my view works fine if value of codigo = '141111' and does not if value of codigo = 'D0001234'?
Thanks a lot Again Mark.

>
>or
>
>... WHERE Tartigen.CDARTGEN like ?cCodigo
>cCodigo = "D0001234" + "%"
This works but returns several records: D0001234, D000123421, D000123411, etc

>
>>no case sensitive problem. I've tested both upper and lower options.
>>
>>This is the view doesnt works:
>>
>>CREATE SQL VIEW "PRODUCTO" ;
>> REMOTE CONNECT "OracleDanosa" ;
>> AS SELECT * FROM SIGES.tartigen Tartigen ;
>> WHERE Tartigen.CDARTGEN = ?m.codigo
>>m.codigo = "D0001234"
>>requery("producto") && returns no records found
>>
>>This is the view that works fine:
>>CREATE SQL VIEW "PRODUCTO" ;
>> REMOTE CONNECT "OracleDanosa" ;
>> AS SELECT * FROM SIGES.tartigen Tartigen ;
>> WHERE Tartigen.CDARTGEN >= ?m.desde ;
>> and Tartigen.CDARTGEN <= ?m.hasta
>>m.desde = "D0001234"
>>m.hasta = "D00012340"
>>requery("producto") && returns 1 ok record
>>
>>
>>>Case sensitive problem? COuld you post your query along with some sample data?
>>>
>>>>I've tested with padr and no results too.
>>>>I've tested with other Oracle tables and everything works fine. It's only this one.
>>>>More ideas?
>>>>
>>>>>If the view was populated with data via VFP and the Oracle column is of type VarChar2, you will have to either right pad your value with spaces to match the field width or trim the field name.
>>>>>
>>>>>cValue = padr(cValue, 20, " ")
>>>>>WHERE myfield = ?cValue
>>>>>
>>>>>
>>>>>
>>>>>>I have 2 views of the same Oracle table. One returns to me every records; another one ask user a code to return only one record.
>>>>>>The first view returns correctly every records in oracle's table.
>>>>>>Well, second view only returns the record if the code is 15 characters length. Otherwise view remains empty.
>>>>>>The field in table and in views is c(20)
>>>>>>I've tested with the two oracle's ODBC drivers: Microsoft's one and Oracle's one.
>>>>>>Any ideas?
>>>>>>TIA
Saludos,
A.G.P.
---------
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform