Sponsored Content
Top Forums UNIX for Dummies Questions & Answers problem to run sql startment in script Post 302133089 by happyv on Wednesday 22nd of August 2007 02:21:25 AM
Old 08-22-2007
problem to run sql startment in script

Hello,
I have a script to run a list of customer information, but it not work. can anyone help below:

echo "Please input list to check customer detail:"
read list
for file in 'cat $list.txt'
do
echo "select cuname as "FROM CUNAME", invo_num as "RECS", total_amount as "AMOUNT", tax_amount as "TAX", CUSTOMERNAME as "INTO CUSTOMER", status, original_amount from cuname_2 where CUNAMEin '$file' ;"|sqlplus4 >> output.txt
done

The list look like:
John
Marry
peter
tom

The script cannot read the list correctly.....Smilie

Thank you.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

can nested SQl be run in Unix Script?

can nested SQl be run in Unix Script? I tried some and found only simply sql(one select) can work well in unix script. (21 Replies)
Discussion started by: YoYo
21 Replies

2. Shell Programming and Scripting

How to run an SQL script inside a shell

How do I create a K Shell which would silently (without user input) logon to Oracle and run an SQL script? Any help will be greatly appreciated. Steve (1 Reply)
Discussion started by: stevefox
1 Replies

3. Shell Programming and Scripting

shell script to run .sql files

hi Friends, Please help me in writing shell script to run list of sql files. database is Oracle 9i, unix os is solaris Requirement is 1. sql file must take two inputs a)feed id and b)business date 2.shell script must out put .xls or .csvfile as out put without trimming any column name and... (1 Reply)
Discussion started by: balireddy_77
1 Replies

4. Shell Programming and Scripting

run sql query via perl script

Hello, If I run this command on the server it works. # dbc "update config set radio_enabled = 0;" how can I execute the same command in perl. I have defined the dbc path. Can any one please correct the last line. #!/usr/bin/perl #database path $dbc='/opt/bin/psql -Userver... (0 Replies)
Discussion started by: sureshcisco
0 Replies

5. Shell Programming and Scripting

Run Sql plus in shell script

Hello, I want to connect to ssh, run a query, and store that into a variable in the shell script. Also I need to pass the variable back to php to display the query results. I have created a public/private key pair for ssh connection and that is working fine. Also I am able to run query in the... (8 Replies)
Discussion started by: shekhar2010us
8 Replies

6. Shell Programming and Scripting

Run SQL thru shell script: how to get a new line when run sql query?

Hi, this's Pom. I'm quite a new one for shell script but I have to do sql on shell script to query some information from database. I found a concern to get a new line...When I run my script, it retrieves all data as wondering but it's shown in one line :( What should I do? I'm not sure that... (2 Replies)
Discussion started by: Kapom
2 Replies

7. Shell Programming and Scripting

Time taken to run a SQL script

Hello I am asked to run around 5-6 SQL queries in a shell script and take a note of the time taken to execute each query to a file. How do I get the time taken to run the individual SQL queries (2 Replies)
Discussion started by: vat1kor
2 Replies

8. Shell Programming and Scripting

Run sql script and send to mail if not empty?

Thanks again for helping me out. I was wondering if anyone else has encountered this issue. I have a SQL script that produces a list -however we are only interested in that list if the length is not zero Here is the sql file named dailyBalance.sql select * from Balance where... (1 Reply)
Discussion started by: Astrocloud
1 Replies

9. UNIX for Dummies Questions & Answers

Script to run sql query.

Please read How To Ask Questions The Smart Way (1 Reply)
Discussion started by: balu_279013
1 Replies

10. Shell Programming and Scripting

run sql queries from UNIX shell script.

How can i run sql queries from UNIX shell script and retrieve data into text docs of UNIX? :confused: (1 Reply)
Discussion started by: 24ajay
1 Replies
cmmigratepkg(1m)														  cmmigratepkg(1m)

NAME
cmmigratepkg - Migrate Serviceguard legacy Package to a Module Package. SYNOPSIS
cmmigratepkg -p package_name [-x extern_script] [-e] [-s] -o output_filename DESCRIPTION
cmmigratepkg is used to generate a modular package configuration file from a configured legacy package. cmmigratepkg expects the package to be a configured legacy package. The package can be up or down and the cluster can be on-line or off-line. The utility reads the control script of the package, so the package's control script must be located on the node where the command is run. cmmigratepkg can migrate packages created by Serviceguard version A.11.09 through A.11.18. The control script's customer-defined area is any code between "#START CUSTOMER DEFINED FUNCTIONS" and "#END CUSTOMER DEFINED FUNCTION. If the customer-defined area has code that needs to be migrated to the modular package then cmmigratepkg can create an external script by inserting the shell code from the control script into the external_script file. The external script is generated from the external template found in $SGCONF/examples/external_script.template. (See chapter 4 of the Managing Serviceguard manual for more information about the tem- plate.) The external_script_name is the full pathname and file name of the file. The extexternal scriptfile must be copied to each node where the package can run and make sure that the permissions are set to 744, and owned by root. Non-Serviceguard variables defined in the legacy package control script can be converted to user defined parameters called PEV, parameter environment variable. The PEV is defined in the package configuration file and has a prefix of "PEV_". See description under the -e option. The cmmigratepkg displays informational message about the variables which it cannot convert because they are non-Serviceguard variables. If these non-Serviceguard variables are used and defined in the customer defined area then there is no need to convert them to PEV. If they are defined in another location in the control script, and the values should be part of the package, they can be converted to PEV using the -e option. The PEV are defined in the new package configuration file. If non-Serviceguard functions are defined in the legacy package control script, cmmigratepkg lists the non-Serviceguard functions to STD- OUT. These functions are not converted. You must determine if the functions are called and how you want to migrate them to the modular package. You can put them into the new external script file. cmmigratepkg converts legacy failover packages that are configured with: Services, File Systems, Volume groups, Dependencies, EMS Resources, and User Defined Roles to modular packages. cmmigratepkg generates the modular package configuration file in lowercase. The package configuration file has no comments about the pack- age attributes. If the user wants to see comments regarding the package attributes, they can generate a temporary package configuration file using cmmakepkg -v. The following control script parameters are obsolete and the cmmigratepkg gives a warning about them not be able to convert: RAIDSTART, RAIDSTOP, RAIDTAB, MD, GFS, DATA_REP, and DTC_NAME. Note: that cmmigratepkg will not convert CVM3.5 packages or CFS packages. If you are converting packages please see the White paper for more details aboutconverting legacy packages. Options cmmigratepkg supports the following options: -p package_name Name of an existing configured legacy package to convert. -x external_script Name of the external script file to create. -e Generate PEV's from non Serviceguard parameters. All non Serviceguard parameters found in the package control script are con- verted to PEVs. "PEV_" is prepended to the original name. For example, package_root="/srv/colossus", is written as PEV_pack- age_root="/srv/colossus" in the output_file. -s This option comments out service attributes in the output_file. A warning is displayed when the option is used and the package has services defined. When using this option the user should review the output file. -o output_file Name of the output file for the converted package configuration. RETURN VALUE
cmmigratepkg returns the following values: 0 Successful completed. >0 Command failed. EXAMPLES
Converts pkgA writing out new package configuration file. cmmigratepkg -p pkgA -o /etc/cmcluster/pkg/pkgA/pkgA.conf Converts pkgA and also generates an external script. cmmigratepkg -p pkgA -x /etc/cmcluster/pkg/pkgA/external.sh -o /etc/cmcluster/pkg/pkgA/pkgA.conf" AUTHOR
cmmigratepkg was developed by HP. SEE ALSO
cmmakepkg(1m), cmgetconf(1m) Migration White Paper. Requires Optional Serviceguard Software cmmigratepkg(1m)
All times are GMT -4. The time now is 08:37 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy