Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
eadbhard
Contributor III
Contributor III

Cannot LOAD from ODBC Source

Hi there,

I am trying to load data from ODBC source, like this:

CASA_Paqueteria:
LOAD num_cobo, fec_entr;
SQL select distinct c.num_cobo,a.fec_entr
from cboo_cobo c
join cboo_guias b on (b.num_cobo = c.num_cobo)
join cboo_paqueteria a on (a.num_guiacom = b.num_guiacom)
where c.fec_entr >= '2018-01-01';

When I try to load the QV Script, I am getting an error:

Field not found - <num_cobo>
SQL select distinct c.num_cobo,a.fec_entr
from cboo_cobo c
join cboo_guias b on (b.num_cobo = c.num_cobo)
join cboo_paqueteria a on (a.num_guiacom = b.num_guiacom)
where c.fec_entr >= '2018-01-01'

However, if I try the SQL code directly on the database, I do get valid data.

I am sure the ODBC source is pointed correctly, as I only have one database. Things I've tried:

  • Removing DISTINCT from the SQL
  • Quoting the field names, i,.e., LOAD "num_cobo", "fec_entr";

However, the error persists. What else can I do?

Thanks,

-Eduardo

 

Labels (3)
1 Solution

Accepted Solutions
eadbhard
Contributor III
Contributor III
Author

I found the answer. I needed to write the field names in all caps in the LOAD, like this:

CASA_Paqueteria:
LOAD NUM_COBO, FEC_ENTR;
SQL select distinct c.num_cobo,a.fec_entr
from cboo_cobo c
join cboo_guias b on (b.num_cobo = c.num_cobo)
join cboo_paqueteria a on (a.num_guiacom = b.num_guiacom)
where c.fec_entr >= '2018-01-01';

 Thanks,

-Eduardo

View solution in original post

1 Reply
eadbhard
Contributor III
Contributor III
Author

I found the answer. I needed to write the field names in all caps in the LOAD, like this:

CASA_Paqueteria:
LOAD NUM_COBO, FEC_ENTR;
SQL select distinct c.num_cobo,a.fec_entr
from cboo_cobo c
join cboo_guias b on (b.num_cobo = c.num_cobo)
join cboo_paqueteria a on (a.num_guiacom = b.num_guiacom)
where c.fec_entr >= '2018-01-01';

 Thanks,

-Eduardo