Syntax for Postgres command

IT it at plastipol.com
Fri Jan 28 13:27:39 UTC 2022


Hi Das,

You believe that the syntax is right, but beyond from believing, did you test your sql code alone from Omnis Interactive sql or pgAdmin to see if there is no error in your sql?

If the sql code runs ok in Interactive sql or pgadmin, then you know that the problem is in Omnis code, if returns an error you will have a clue  

Please, run this from omnis interactive sql or pgAdmin and tell us. 

COPY fcCities ( cityname, city_count_num, city_cntry_num, long_deg, long_min, lat_deg, lat_min, long_we, lat_ns, city_rsn, city_state, ctime_zone, long_sec, lat_sec, city_acs_zone, city_acs_type, city_new, zone_we, city_ascii, city_alternate, city_latnum, city_Longnum, city_state_name, city_timezone_name, city_country_name, city_state_code, city_country_digits, city_acs, city_population )  FROM '/Users/Shared/Cities.txt'  WITH  FORMAT 'csv', DELIMITER ','

It would be a good practice after an $execdirect or $execute sql code call the $sqlerror() method

regards

x

> El 27 ene 2022, a las 21:40, Das Goravani <goravanis at gmail.com> escribió:
> 
> Do tStatObjPG.$execdirect("COPY fcCities ( cityname, city_count_num, city_cntry_num, long_deg, long_min, lat_deg, lat_min, long_we, lat_ns, city_rsn, city_state, ctime_zone, long_sec, lat_sec, city_acs_zone, city_acs_type, city_new, zone_we, city_ascii, city_alternate, city_latnum, city_Longnum, city_state_name, city_timezone_name, city_country_name, city_state_code, city_country_digits, city_acs, city_population )  FROM  '/Users/Shared/Cities.txt'  WITH  FORMAT 'csv', DELIMITER ',' “)
> 
> 
> I have tried to run the above command. It won’t run. Omnis steps right through it.
> 
> I have tried putting the import file into Users/Shared as shown and that did not help.
> 
> Any ideas why the command is not working?
> 
> The table is created, I am connected to the database, as shown by a session showing up under the SQL Browser in Omnis. I am working on my server, using a Localhost connection. The table was created from dragging a schema onto Tables in the SQL Browser. The column names were entered using the same schema under the F9 catalog. So there are no spelling mistakes in the column names. I believe the syntax of the command is right. 
> 
> ???
> _____________________________________________________________
> Manage your list subscriptions at http://lists.omnis-dev.com
> Start a new message -> mailto:omnisdev-en at lists.omnis-dev.com 



More information about the omnisdev-en mailing list