Sponsored Content
Top Forums UNIX for Advanced & Expert Users To pass one month range in sql script Post 302964570 by rohit_shinez on Friday 15th of January 2016 06:56:42 PM
Old 01-15-2016
i have achieved something like below
Code:
SELECT /*+ PARALLEL(t1,8) */ * FROM T1 t1 where date_col between ADD_MONTHS(TO_DATE('&start_date','DD-MON-YYYY'),(i-1)) and ADD_MONTHS(TO_DATE('&start_date','DD-MON-YYYY'),i);

But i wanted to achieve in scripting something like passing how month difference the range should be along with that after each insert i.e range it should prompt from the user that so on so range is completed should it proceed with next range displaying the range and start processing the ranges. Like this till it reaches the final date
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Pass multiple variables to SQL script

I am trying to close of multiple users in an Oracle database. Each users has records in multiple tables what I need to do is use a script that call each SQL seperately passing either CLI arguments or gathered arguments from the users during run time. ## Accept variable(s) from the command line... (1 Reply)
Discussion started by: jagannatha
1 Replies

2. Shell Programming and Scripting

pass input arguements to DB2 SQL script

Hi all, I have a shell script which invoke a sql script using command db2 -tf /home/me/db_housekeep.sql -z /home/me/db_housekeep.log however, this mentioned sql script requires several input arguments, I wonder if one can pass variables from shell script to sql script? thanks! (0 Replies)
Discussion started by: mpang_
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

Pass a variable to SQL script

Hi Guys, I like to pass a variable to a sql file in a unix script.. I tried a below code.. var=200903 db2 -vf test.sql 200903 test.sql is as below. select * from db2.users where quarter = $1; Please tell me where i go wrong.. Thanks in advance, Magesh (2 Replies)
Discussion started by: mac4rfree
2 Replies

5. UNIX for Advanced & Expert Users

How to use parameter in sql script pass from unix script?

Hi, I am unable to use parameter in sql script passed from unix script. my sql script CREATE_SBI_LIST_GROUP.sql is like this - ------------------------------- SELECT SDS.ID "SO_ID", SDS.SO a1, sgp.sga__code SGA_CODE, FROM sga sga,sales_genl_provision sgp , comm_product_condn cpc... (2 Replies)
Discussion started by: apskaushik
2 Replies

6. Shell Programming and Scripting

How to put date range from a perl & sql script

Hi Guys, Can someone please help me on adding/inserting a variable date to an sql scipt? Basically I want to assign a 7 days date range. As shown below.. #!/usr/bin/perl use strict; use Env qw(ORACLE_HOME); my $SQLPLUS='/opt/oracle/product/10.1.0/db_1/bin/sqlplus -S... (1 Reply)
Discussion started by: pinpe
1 Replies

7. Shell Programming and Scripting

pass null value to sql script from korn shell script

There are 4 parameters that I have to pass from korn shell to sql script. 1) I have to check if $1 , $2 , $3 and $4 are null values or not . How can I do that ? 2) Once its determined that these values are null (in the sense they are empty) how can I pass null values to sql script... (11 Replies)
Discussion started by: megha2525
11 Replies

8. Shell Programming and Scripting

How to add decimal month to some month in sql, php, perl, bash, sh?

Hello, i`m looking for some way to add to some date an partial number of months, for example to 2015y 02m 27d + 2,54m i need to write this script in php or bash or sh or mysql or perl in normal time o unix time i`m asking or there are any simple way to add partial number of month to some... (14 Replies)
Discussion started by: bacarrdy
14 Replies

9. Shell Programming and Scripting

How to pass Oracle sql script as argument to UNIX shell script?

Hi all, $ echo $SHELL /bin/bash Requirement - How to pass oracle sql script as argument to unix shell script? $ ./output.sh users.sql Below are the shell scripts and the oracle sql file in the same folder. Shell Script $ cat output.sh #!/bin/bash .... (7 Replies)
Discussion started by: a1_win
7 Replies

10. Shell Programming and Scripting

Unable to pass value from .Shell script to .SQL file

Hi All, I am new to shell script. I am trying to pass value from .sh file to .sql file . But I am able to run the .sql file from .sh file with values in sql file. But I am unable to pass the values from .sh file. can some one please help to resolve this. here is my .sh file s1.sh ... (4 Replies)
Discussion started by: reddy298599
4 Replies
EXCHANGE2ICAL(1)					     OpenChange Users' Manual						  EXCHANGE2ICAL(1)

NAME
exchange2ical - Convert Exchange calendar to ical file SYNOPSIS
exchange2ical [-?V] [-?|--help] [--usage] [-f|--database=STRING] [-p|--profile=STRING] [-P|--password=STRING] [-i|--icalsync=STRING] [-o|--filename=STRING] [-R|--range=STRING] [-d|--debuglevel=STRING] [--dump-data] [-V|--version] DESCRIPTION
exchange2ical provides a way to extract appointments from an Exchange calendar into the ical format. The ical is provided on stdout by default if the filename is not specified. OPTIONS
--database -f Set the path to the profile database to use --profile -p Set the profile to use. If no profile is specified, exchange2ical tries to retrieve the default profile in the database. If no default profile has been set, exchange2ical returns MAPI_E_NOT_FOUND . --password -P Specify the password for the profile to use. This can be omitted if the password is stored in the profile. --icalsync -i Specify an icalendar file to be used to sync back to exchange. --filename -o Specify the filename for the icalendar output. The specified file will be overwritten with the new icalendar. If this is omitted, stdout will be used by default. --range -r Specify the range of exchange appointments to be converted into an icalendar. If there are no events, whos start date is within the specified range, an icalendar with no vevents will be returned. Format: MM/DD/YYYY-MM/DD/YYYY --dump-data Dump the hex data. This is only required for debugging or educational purposes. --debuglevel -d Set the debug level. EXAMPLES
Extract appointments from the Exchange calendar: exchange2ical > appointments.ical Extract appointments from the Exchange calendar to a specified path exchange2ical --filename=/path/to/file.ics Extract only appointments which begin from June 25 2008 to July 26 2009 exchange2ical --range=06/25/2008-07/26/2009 REMARKS
If you are using the default profile database path and have set a default profile (using mapiprofile --profile=profile_name -S ) you do not need to specify these parameters on the command line. AUTHOR
exchange2ical was written by Julien Kerihuel <j.kerihuel at openchange dot org> This man page was written by Brad Hards <bradh at openchange dot org> OpenChange 2.0 QUADRANT 2013-01-24 EXCHANGE2ICAL(1)
All times are GMT -4. The time now is 10:35 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy