Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Sql view to Oracle doesn't return match records
Message
 
 
À
07/09/2000 07:16:54
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:
00413569
Vues:
19
First, I would remove the m. from the parameters in the SQL --

...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?

What happens if you set [in my example above], cCodigo = "D0001234 " and requery?

YOu may have to try:

... WHERE RTRIM(Tartigen.CDARTGEN) = ?cCodigo
cCodigo = "D0001234"

or

... WHERE Tartigen.CDARTGEN like ?cCodigo
cCodigo = "D0001234" + "%"

>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
Mark McCasland
Midlothian, TX USA
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform