En la máquina cliente tiene que estar instalado el cliente Oracle.
En la lista de columnas tienen que estar todas las columnas del archivo. Para las columnas que no deben importarse se usa FILLER.
library(memisc) | |
filenames <- data.frame(c('CPV2010', 'PROV', 'DPTO', 'FRAC', 'RADIO', 'VIVIENDA', 'HOGAR', 'PERSONA'), | |
c('censo', 'provincias', 'departamentos', 'fracciones', 'radios', 'viviendas', | |
'hogares', 'personas')) | |
names(filenames) <- c('sav', 'csv') | |
sav2csv <- function(x) { | |
savname <- x[1] |
#!/usr/bin/env python | |
# | |
# AccessDump.py | |
# A simple script to dump the contents of a Microsoft Access Database. | |
# It depends upon the mdbtools suite: | |
# http://sourceforge.net/projects/mdbtools/ | |
import sys, subprocess, os | |
DATABASE = sys.argv[1] |
SELECT | |
l.inst_id, | |
SUBSTR(L.ORACLE_USERNAME,1,8) ORA_USER, | |
SUBSTR(L.SESSION_ID,1,3) SID, | |
S.serial#, | |
SUBSTR(O.OWNER||'.'||O.OBJECT_NAME,1,40) OBJECT, P.SPID OS_PID, | |
DECODE(L.LOCKED_MODE, | |
0, 'NONE', | |
1, 'NULL', | |
2, 'ROW SHARE', |
Script para obtención de establecimientos electorales de las Elecciones Nacionales Argentina 2015. Fuente de datos: INDRA.
Los establecimientos parecen estar georreferenciados por su dirección, sin mayores controles. Hay establecimientos cuyo punto está a varios kilómetros de su ubicación real.
-- Works OK in PostgreSQL 9.3 | |
DELETE FROM table_name | |
WHERE ctid NOT IN | |
(SELECT MAX(ctid) | |
FROM | |
table_name t | |
GROUP BY | |
t.column_1, t.column_2; -- t.* for completely duplicate rows |
SAVE TRANSLATE OUTFILE='C:\filename.txt' | |
/TYPE=CSV | |
/TEXTOPTIONS DELIMITER='|' QUALIFIER='"' | |
/MAP | |
/FIELDNAMES | |
/CELLS=VALUES | |
/MISSING=IGNORE | |
/REPLACE. |
<?php | |
/** | |
* PostgreSQL layer for DBO. | |
* | |
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org) | |
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) | |
* | |
* Licensed under The MIT License | |
* For full copyright and license information, please see the LICENSE.txt | |
* Redistributions of files must retain the above copyright notice. |
<?php | |
/** | |
* PostGIS to GeoJSON | |
* Query a PostGIS table or view and return the results in GeoJSON format, suitable for use in OpenLayers, Leaflet, etc. | |
* | |
* @param string $geotable The PostGIS layer name *REQUIRED* | |
* @param string $geomfield The PostGIS geometry field *REQUIRED* | |
* @param string $srid The SRID of the returned GeoJSON *OPTIONAL (If omitted, EPSG: 4326 will be used)* | |
* @param string $fields Fields to be returned *OPTIONAL (If omitted, all fields will be returned)* NOTE- Uppercase field names should be wrapped in double quotes | |
* @param string $parameters SQL WHERE clause parameters *OPTIONAL* |
Función SQL para limpiar strings (clob) de caracteres molestos a la hora de exportar a csv:
Lenguaje: Oracle SQL Motor: Oracle 10g.
Basado en http://www.supermanhamuerto.com/doku.php?id=oracle:fixhtml