Sponsored Content
Homework and Emergencies Homework & Coursework Questions Write a shell script for SQL loader to load data into a staging table Post 302857585 by DukeNuke2 on Thursday 26th of September 2013 03:28:18 PM
Old 09-26-2013
Do not post classroom or homework problems in the main forums. Homework and coursework questions can only be posted in this forum under special homework rules.

Please review the rules, which you agreed to when you registered, if you have not already done so.

More-than-likely, posting homework in the main forums has resulting in a forum infraction. If you did not post homework, please explain the company you work for and the nature of the problem you are working on.

If you did post homework in the main forums, please review the guidelines for posting homework and repost.

Thank You.

The UNIX and Linux Forums.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to write DB2 Load Utility in Shell script

Hi, I am a beginner. I need an example of using DB2 Load Utility in Shell script. I appreciate if anyone could help me about it. Thanks, Paris (0 Replies)
Discussion started by: parisbeginner
0 Replies

2. Shell Programming and Scripting

Shell script for accessing a file in the network drive and invoking oracle sql loader

Hi, Please let me know if anybody is having a solution handy for the below tasks... It would be helpful if somebody can resolve my query. I am new to unix and oracle environment and looking for some online reference for completing a task. Task: Check if the network drive exists Check... (0 Replies)
Discussion started by: sayydevara
0 Replies

3. Shell Programming and Scripting

How to pass pl/sql table values to shell script

Hello, i am using '#!/bin/bash', i want to make a loop in pl/sql, this loop takes values from a table according to some conditions, each time the loop choose 3 different variables. What i am not able to do is that during the loop i want my shell script to read this 3 variables and run a shell... (1 Reply)
Discussion started by: rosalinda
1 Replies

4. Shell Programming and Scripting

shell script to read data from text file and to load it into a table in TOAD

Hi....can you guys help me out in this script?? Below is a portion text file and it contains these: GEF001 000093625 MKL002510 000001 000000 000000 000000 000000 000000 000001 GEF001 000093625 MKL003604 000001 000000 000000 000000 000000 000000 000001 GEF001 000093625 MKL005675 000001... (1 Reply)
Discussion started by: pallavishetty
1 Replies

5. Shell Programming and Scripting

Can we write SQL cursors from shell script

Hi I connected to oracle database through shell script My requiremnt is to get more than one record from the sql query. How can i do in unix to get multiple records. (1 Reply)
Discussion started by: vyagh
1 Replies

6. Shell Programming and Scripting

sql loader for inserting the data from multiple fields from unix

Hi , I have my log file something like this (07/29/2009 00:02:24.467) 367518 (07/29/2009 00:02:26.214) 949384011 (07/29/2009 00:02:26.236) 367524 (07/29/2009 00:02:28.207) 949395117 (07/29/2009 00:02:28.240) 337710 (07/29/2009 00:02:30.621) 949400864 I am trying to insert the data... (3 Replies)
Discussion started by: rdhanek
3 Replies

7. Shell Programming and Scripting

How to get full sql table data using shell script

i have a Oracle table like col1 col2 ---- ----- a 1 b 2 c 3 when i write a script for it , it gives me all the data in one column. Please give me the solution which gives the exact result like we see in sql editors. for a in `echo " set feedback off; set pagesize 40;... (1 Reply)
Discussion started by: ss135r
1 Replies

8. Shell Programming and Scripting

Need to write shell script for my .sql file call

Hi Guys, I need to write a simple shell script which will generate a .csv file/report by calling .sql file inside a shell script. Can somebody help me on this. Thanks in advance! Regards, LK (7 Replies)
Discussion started by: lakshmanraok117
7 Replies

9. Shell Programming and Scripting

Shell scripting unable to send the sql query data in table in body of email

I have written a shell script that calls below sql file. It is not sending the query data in table in the body of email. spool table_update.html; SELECT * FROM PROCESS_LOG_STATS where process = 'ActivateSubscription'; spool off; exit; Please use code tags next time for your code and data.... (9 Replies)
Discussion started by: Sharanakumar
9 Replies

10. Shell Programming and Scripting

How to call SQL Loader in shell script?

HI Experts, I am pretty new to scripting and i need to create a perl or shell script which should fetch a file from local directory and insert the data into a table using sql loader. This will be later added to chron job to run daily and fetch all files and load them into the table. Also i... (1 Reply)
Discussion started by: sam1234
1 Replies
shp2pgsql(1)							      PostGIS							      shp2pgsql(1)

NAME
shp2pgsql - shapefile to postgis loader SYNTAX
shp2pgsql [options] shapefile [schema.]table DESCRIPTION
The shp2pgsql data loader converts ESRI Shape files into SQL suitable for insertion into a PostGIS/PostgreSQL database. Version: 1.1.5 (2006/10/06) USAGE
The <shapefile> is the name of the shape file, without any extension information. For example, 'roads' would be the name of the shapefile comprising the 'roads.shp', 'roads.shx', and 'roads.dbf' files. The <tablename> is the (optionally schema-qualified) name of the database table you want the data stored in in the database. Within that table, the geometry will be placed in the 'geo_value' column by default. OPTIONS
The loader has several operating modes distinguished by command line flags: (Note that -a, -c, -d and -p are mutually exclusive.) -d Drops the database table before creating a new table with the data in the Shape file. -a Appends data from the Shape file into the database table. Note that to use this option to load multiple files, the files must have the same attributes and same data types. -c Creates a new table and populates it from the Shape file. This is the default mode. -p Only produces the table creation SQL code, without adding any actual data. This can be used if you need to completely separate the table creation and data loading steps. -D Use the PostgreSQL "dump" format for the output data. This can be combined with -a, -c and -d. It is much faster to load than the default "insert" SQL format. Use this for very large data sets. -s <SRID> Creates and populates the geometry tables with the specified SRID. -g <geometry_column> Specify the name of the geometry column (mostly useful in append mode). -k Keep idendifiers case (column, schema and attributes). Note that attributes in Shapefile are usually all UPPERCASE. -i Coerce all integers to standard 32-bit integers, do not create 64-bit bigints, even if the DBF header signature appears to warrant it. -S Generate simple Geometries instead of MULTIgeometries. Shape files don't differ between LINESTRINGs and MULTILINESTRINGs, so shp2pgsql generates MULTILINESTRINGs by default. This switch will produce LINESTRINGs instead, but shp2pgsql will fail when it hits a real MULTILINESTRING. The same works for POLYGONs vs. MULTIPOLYGONs. -w Output WKT format, for use with older (0.x) versions of PostGIS. Note that this will introduce coordinate drifts and will drop M values from shapefiles. -W <encoding> Specify the character encoding of Shapefile's attributes. If this option is used the output will be encoded in UTF-8. -I Create a GiST index on the geometry column. -N <policy> Specify NULL geometries handling policy (insert,skip,abort). -? Display version and usage information. INSTALLATION
To compile the program from source, simply run "make" in the source directory. Then copy the binary in your shell search path (or wherever you like). This text is also available as a man page in the ../doc/man/ directory, ready for copying it into the manual search path on unixoid systems. EXAMPLES
An example session using the loader to create an input file and uploading it might look like this: # shp2pgsql shaperoads roadstable roadsdb > roads.sql # psql -d roadsdb -f roads.sql A conversion and upload can be done all in one step using UNIX pipes: # shp2pgsql shaperoads roadstable roadsdb | psql -d roadsdb AUTHORS
Originally written by Jeff Lounsbury <jeffloun@refractions.net>. Improved and maintained by Sandro Santilli <strk@refractions.net>. Includes small contributions and improvements by others. This application uses functionality from shapelib 1.2.9 by Frank Warmerdam <warmerda@gdal.velocet.ca> to read from ESRI Shape files. SEE ALSO
pgsql2shp(1) More information is available at http://postgis.refractions.net shp2pgsql(1)
All times are GMT -4. The time now is 07:30 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy