Sponsored Content
Top Forums Shell Programming and Scripting Passing variable from file to sql from script Post 302923579 by RudiC on Monday 3rd of November 2014 04:10:41 PM
Old 11-03-2014
Quote:
Originally Posted by pallvi_mahajan
. . .
what does this command do
ln_input number := nvl('&1',0);
nvl provides a "default" value for missing i.e. NULL variables, so if &1has not been assigned to, number will become 0.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Passing PL/SQL variable value to Shell Varible

Hi my UNIX Friends, Im calling some SQL scripts through Unix Shell scripting. How do I export the value of PL/SQL variable value into a Unix shell script variable? Also could any one inform me about the 'search' and 'cut' utility of PL/SQL (like 'grep' and 'cut' in Shell scripting). ... (10 Replies)
Discussion started by: ganapati
10 Replies

2. UNIX for Advanced & Expert Users

passing value to a variable in a SQL

Hi Folks, This is a small chunk of the bigger problem which i am facing and some help here will help me resolve the rest of the issue. Problem is that i need to pass the value of a variable from a shell script to a SQL query (infact a lot of SQL's) i have the following solution but somehow... (4 Replies)
Discussion started by: kamitsin
4 Replies

3. Shell Programming and Scripting

Passing argumnets from shell script to sql

hi I all , I have sql statment in my shell script , I pass two argument to the script I need to pass the this two arguments to the sql statment example : runsql.sh "1" "2" sql : updat tables_x set y=0 where A=:x should subsituted by "1" and B=:y shuold subsituted bt "2"... (1 Reply)
Discussion started by: habuzahra
1 Replies

4. Shell Programming and Scripting

passing arguments to sql script

Hi Gurus, i have one requirement in unix script, i have a file called abc.txt in that few lines are there with the empid, i need to read each line and pass to .sql script. ex: abc.txt 2345 2346 1243 1234 i need to pass these arguments to .sql script rom unix ex: select * from... (1 Reply)
Discussion started by: Devendar
1 Replies

5. UNIX for Advanced & Expert Users

Passing Hash variable in to sql query in perl

Hi Everyone, Can anyone help me how do i call hash variable in to sql query in perl. Please see the script below i have defined two Hash %lc and %tab as below $lc{'REFF'}='V_RES_CLASS'; $lc{'CALE'}='V_CAP_CLASS'; $lc{'XRPD'}='V_XFMR_CLASS'; $tab{'V_RES_CLASS'}='V_MFR_SERS';... (6 Replies)
Discussion started by: jam_prasanna
6 Replies

6. Shell Programming and Scripting

Replace a var in sql file with shell script variable

I have a requirement where i have a sql file (filetext.sql). This file contains a variable ss_code. Now in a shell script im trying to replace the variable ss_code with a value contained in the shell script variable MTK_DC..tried the below in the script MTK_DC="mit,cit,bit" OUT=`awk -v... (4 Replies)
Discussion started by: michaelrozar17
4 Replies

7. UNIX for Dummies Questions & Answers

SQL Script to use variable value from input file

Here is the requirement, When I run the "run file KSH (sql)", it should substitute '${pCW_Bgn_DT}' with 201120 and '${pCW_End_DT}' with 201124 Input File ---------- $ cat prevwk.dat 201124 20110711 run file KSH (sql) ------------------ In this file, I want to use the variables... (1 Reply)
Discussion started by: shanrice
1 Replies

8. Shell Programming and Scripting

Passing a string variable from Unix to Sql Plus

Hi Guys, I am trying to pass a string variable from Unix shell script to sqlplus as a parameter. I have tried using single quotes with the variable name but it does not work. Please help me with it. I am using BASH. My code: Your help is much appreciated. Thanks, shil (2 Replies)
Discussion started by: infintenumbers
2 Replies

9. Shell Programming and Scripting

Passing variable to sql

How to pass variable to sql file. Im tryin in two ways, Method 1: my.sql select * from table where col1 = '$1' and col2 = 'text'; Method 1execute: dbaccess database my.sql $var Method2: select * from table col1 in (`cat inputfile`) and col2 = 'text'; method... (2 Replies)
Discussion started by: Roozo
2 Replies

10. Shell Programming and Scripting

Passing string from SQL to a BASH script

OS Solaris 10, DB oracle 10g Hello, We currently have a BASH script that runs and moves image files from a remote server to the local db server. A snippet of the code shows that we are picking up all Images that are 'mtime -1' some code... for file in `ssh user@10.200.200.10 'find... (3 Replies)
Discussion started by: JonP
3 Replies
nvlist_add_boolean(3NVPAIR)				 Name-value Pair Library Functions			       nvlist_add_boolean(3NVPAIR)

NAME
nvlist_add_boolean, nvlist_add_boolean_value, nvlist_add_byte, nvlist_add_int8, nvlist_add_uint8, nvlist_add_int16, nvlist_add_uint16, nvlist_add_int32, nvlist_add_uint32, nvlist_add_int64, nvlist_add_uint64, nvlist_add_string, nvlist_add_nvlist, nvlist_add_nvpair, nvlist_add_boolean_array, nvlist_add_byte_array, nvlist_add_int8_array, nvlist_add_uint8_array, nvlist_add_int16_array, nvlist_add_uint16_array, nvlist_add_int32_array, nvlist_add_uint32_array, nvlist_add_int64_array, nvlist_add_uint64_array, nvlist_add_string_array, nvlist_add_nvlist_array - add new name-value pair to nvlist_t SYNOPSIS
cc [ flag... ] file... -lnvpair [ library... ] #include <libnvpair.h> int nvlist_add_boolean(nvlist_t *nvl, const char *name); int nvlist_add_boolean_value(nvlist_t *nvl, const char *name, boolean_t val); int nvlist_add_byte(nvlist_t *nvl, const char *name, uchar_t val); int nvlist_add_int8(nvlist_t *nvl, const char *name, int8_t val); int nvlist_add_uint8(nvlist_t *nvl, const char *name, uint8_t val); int nvlist_add_int16(nvlist_t *nvl, const char *name, int16_t val); int nvlist_add_uint16(nvlist_t *nvl, const char *name, uint16_t val); int nvlist_add_int32(nvlist_t *nvl, const char *name, int32_t val); int nvlist_add_uint32(nvlist_t *nvl, const char *name, uint32_t val); int nvlist_add_int64(nvlist_t *nvl, const char *name, int64_t val); int nvlist_add_uint64(nvlist_t *nvl, const char *name, uint64_t val); int nvlist_add_string(nvlist_t *nvl, const char *name, const char *val); int nvlist_add_nvlist(nvlist_t *nvl, const char *name, nvlist_t *val); int nvlist_add_nvpair(nvlist_t *nvl, nvpair_t *nvp); int nvlist_add_boolean_array(nvlist_t *nvl, const char *name, boolean_t *val, uint_t nelem); int nvlist_add_byte_array(nvlist_t *nvl, const char *name, uchar_t *val, uint_t nelem); int nvlist_add_int8_array(nvlist_t *nvl, const char *name, int8_t *val, uint_t nelem); int nvlist_add_uint8_array(nvlist_t *nvl, const char *name, uint8_t *val, uint_t nelem); int nvlist_add_int16_array(nvlist_t *nvl, const char *name, int16_t *val, uint_t nelem); int nvlist_add_uint16_array(nvlist_t *nvl, const char *name, uint16_t *val, uint_t nelem); int nvlist_add_int32_array(nvlist_t *nvl, const char *name, int32_t *val, uint_t nelem); int nvlist_add_uint32_array(nvlist_t *nvl, const char *name, uint32_t *val, uint_t nelem); int nvlist_add_int64_array(nvlist_t *nvl, const char *name, int64_t *val, uint_t nelem); int nvlist_add_uint64_array(nvlist_t *nvl, const char *name, uint64_t *val, uint_t nelem); int nvlist_add_string_array(nvlist_t *nvl, const char *name, char *const *val, uint_t nelem); int nvlist_add_nvlist_array(nvlist_t *nvl, const char *name, nvlist_t **val, uint_t nelem); PARAMETERS
nvl The nvlist_t (name-value pair list) to be processed. nvp The nvpair_t (name-value pair) to be processed. name Name of the nvpair (name-value pair). nelem Number of elements in value (that is, array size). val Value or starting address of the array value. DESCRIPTION
These functions add a new name-value pair to an nvlist_t. The uniqueness of nvpair name and data types follows the nvflag argument speci- fied for nvlist_alloc(). See nvlist_alloc(3NVPAIR). If NV_UNIQUE_NAME was specified for nvflag, existing nvpairs with matching names are removed before the new nvpair is added. If NV_UNIQUE_NAME_TYPE was specified for nvflag, existing nvpairs with matching names and data types are removed before the new nvpair is added. If neither was specified for nvflag, the new nvpair is unconditionally added at the end of the list. The library preserves the order of the name-value pairs across packing, unpacking, and duplication. Multiple threads can simultaneously read the same nvlist_t, but only one thread can actively change a given nvlist_t at a time. The caller is responsible for the synchronization. The nvlist_add_boolean() function is deprecated. The nvlist_add_boolean_value() function should be used instead. RETURN VALUES
These functions return 0 on success and an error value on failure. ERRORS
These functions will fail if: EINVAL There is an invalid argument. ENOMEM There is insufficient memory. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +----------------------------+------------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +----------------------------+------------------------------+ |Interface Stability | Evolving | +----------------------------+------------------------------+ |MT-Level | MT-Safe | +----------------------------+------------------------------+ SEE ALSO
libnvpair(3LIB), attributes(5) SunOS 5.10 2 Feb 2004 nvlist_add_boolean(3NVPAIR)
All times are GMT -4. The time now is 11:14 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy