Sponsored Content
Top Forums Shell Programming and Scripting Linux Script to copy and rename files through SQL statement Post 303007183 by usman_oracle on Monday 13th of November 2017 06:24:38 AM
Old 11-13-2017
Hi,
for your queries blow is the response.
Is this homework/assignment? There are specific forums for these.
This is assignment
What have you tried in your script so far?
Well, i am new to linux, if have tried to copy cp and rename files.
What output/errors do you get?
currently unable to initialize output of SQL Query in script
What OS and version are you using?
Linux Red Hat 5.8
What are your preferred tools? (C, shell, perl, awk, etc.)
shell
What logical process have you considered? (to help steer us to follow what you are trying to achieve)

How do you get the report names? I don't see it in your SQL.
in SQL (pt.user_concurrent_program_name ) is the report name. system generate the report and saves its name and output path in a table
Can I presume that the headings in bold do not actually appear in your output? If they do, i don't see where your SQL generates them.
actually bold heading are the column name of the table

Regards,

---------- Post updated at 06:24 AM ---------- Previous update was at 06:13 AM ----------

Code:
Select 
pt.user_concurrent_program_name report_name , 
OUTFILE_NAME output_path
FROm 
apps.fnd_concurrent_programs_tl pt, 
apps.fnd_concurrent_requests f 
where 
pt.concurrent_program_id = f.concurrent_program_id 
and pt.application_id = f.program_application_id 
and f.RESPONSIBILITY_ID = 52431 
and trunc(f.request_date) = trunc(sysdate)

 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

copy and rename list of files

Hi all, I am a newbie in writng unix..I am using ksh shell..Does anyone know how to copy a list o files from directory A to directory B with differnt names? i.e in Dir A, I have RPT101.555.TXT RPT102.666.TXT and I want to copy those files to dir B with new naming convention.. in Dir B,... (7 Replies)
Discussion started by: kinmak
7 Replies

2. UNIX for Dummies Questions & Answers

script to rename files with current date and copy it.

I have few webservers logs like access.log. which would be growing everyday. what i do everyday is, take the backup of access.log as access.log_(currentdate) and nullify the access.log. So thought of writing a script... but stuck up in middle. My requirement: to take the backup and nullify... (6 Replies)
Discussion started by: logic0
6 Replies

3. Shell Programming and Scripting

Copy files from folder and rename them

hello, I need to build a shell script that receives the folder to copy by parameter and copy all files except thumb.db to another folder and rename them like, file.jpg renamed to file_bb1.jpg. can someone help me Thanks (4 Replies)
Discussion started by: zeker
4 Replies

4. Shell Programming and Scripting

Files rename and copy

hello, I am write a Script and i would listing all Files from Path1 out with DSR*.txt and give a new name an copy to the Path2. I have problems with that to rename. Someone can help me? Sorry, for my english. My english is not gut. I hope you understand my. That is my Script. ... (2 Replies)
Discussion started by: efeijoo
2 Replies

5. Shell Programming and Scripting

Help with script to copy/rename files, then delete by date

Hi All, I am new to scripting and am looking for some assistance setting up a script. Basically I need the script to scan a folder for the newest files and make a copy of those files, adding a month to the date stamp. I also need this script to delete the previously copied files to save space.... (4 Replies)
Discussion started by: Lucid13
4 Replies

6. Shell Programming and Scripting

Linux Script to compare two folders and copy missing files

Hi, I need help in shell scripting. If someone can help me, that would be great! Problem. I want Linux Script to compare two folders and copy missing files. Description. I have two directories /dir1 /dir2 I need to copy all distinct/new/unique/missing files from /dir1 and that... (1 Reply)
Discussion started by: S.Praveen Kumar
1 Replies

7. Shell Programming and Scripting

Copy down remote files and rename them to include the server name with full path

I need to pull down a good bit of files for another support team for an upgrade project. I have a server.list with all of the server names. I need to do two parts: FIRST: I have this example, but it does not list the server name in front of each line. #! /bin/bash for server in $(<... (10 Replies)
Discussion started by: asnatlas
10 Replies

8. Shell Programming and Scripting

Is better way copy list of multiple files, rename and gzip

Is better way to write the script loop through one by one "Old_File_1: & New_File_1:" to copy 100 files to /staging/test folder then re-name & gzip all those files? I wrote this code below and don't like that much. Thanks I have a control_file under /tmp/test folder like below 100 files and... (10 Replies)
Discussion started by: dotran
10 Replies

9. Shell Programming and Scripting

Oop to copy and rename files through SQL Statement in shell Script

#!/bin/sh sqlplus -s "/ as sysdba" << EOF SET HEADING OFF SET FEEDBACK OFF Select pt.user_concurrent_program_name , OUTFILE_NAME FROm apps.fnd_concurrent_programs_tl pt, apps.fnd_concurrent_requests f where pt.concurrent_program_id = f.concurrent_program_id and pt.application_id =... (1 Reply)
Discussion started by: usman_oracle
1 Replies
Class::DBI::Query(3pm)					User Contributed Perl Documentation				    Class::DBI::Query(3pm)

NAME
Class::DBI::Query - Deprecated SQL manager for Class::DBI SYNOPSIS
my $sth = Class::DBI::Query ->new({ owner => $class, sqlname => $type, essential => @columns, where_columns => @where_cols, }) ->run($val); DESCRIPTION
This abstracts away many of the details of the Class::DBI underlying SQL mechanism. For the most part you probably don't want to be interfacing directly with this. The underlying mechanisms are not yet stable, and are subject to change at any time. OPTIONS
A Query can have many options set before executing. Most can either be passed as an option to new(), or set later if you are building the query up dynamically: owner The Class::DBI subclass that 'owns' this query. In the vast majority of cases a query will return objects - the owner is the class of which instances will be returned. sqlname This should be the name of a query set up using set_sql. where_clause This is the raw SQL that will substituted into the 'WHERE %s' in your query. If you have multiple %s's in your query then you should supply a listref of where_clauses. This SQL can include placeholders, which will be used when you call run(). essential When retrieving rows from the database that match the WHERE clause of the query, these are the columns that we fetch back and pre-load the resulting objects with. By default this is the Essential column group of the owner class. METHODS
where() $query->where($match, @columns); This will extend your 'WHERE' clause by adding a 'AND $column = ?' (or whatever $match is, isntead of "=") for each column passed. If you have multiple WHERE clauses this will extend the last one. perl v5.12.4 2004-04-25 Class::DBI::Query(3pm)
All times are GMT -4. The time now is 07:23 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy