I know htis isnt exactly unix.... but hopefully someone can help me or direct me someplace to get help.
I can run sql queries in scripts against my informix db using:
dbaccess mydb myquery.sql >> sql.output
I need to write my script to select based on todays date. Its very... (5 Replies)
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)
I created a script to read a csv file with four columns. The script also saved values of each col in a arry.
In the script, i connected to db try to run a query to pull out data baisc on the values from the csv file.
select Num from tableName
where Sec_Num in ('${isin}') /*isin is an arry... (1 Reply)
Unix prompt
=========
echo "Enter the query"
read q
==========
User has entered :
SELECT * FROM employee
=====================
Now the problem starts..
echo $q
Output: SELECT "all files names in the PWD" FROM employee
================================================
... (5 Replies)
I have a script (say script1.sh ) and I am calling a script (say script2.sh) within the script1.sh. Here in script1.sh I have a hash ( say %hash1) and i have to pass this hash to script2.sh. Basically i have to do some processing in Scirpt2.sh based on the hash(key,values). I wanted to know how can... (2 Replies)
I heard this was possible but from my research I haven't been able to figure it out yet. Seems it should be simple enough. Basically from a high level view I'm trying to accomplish...
. $X='grep foo blah.log'
then 'mysql command SELECT foo FROM bar WHERE ' . $X
or something like that.
... (2 Replies)
hi there
I have the following script in which i have created a PrintHash() function.
I want to pass to this function the reference to a hash (in the final code i will be passing different hashes to this print function hence the need for a function). I am getting an error
Type of arg 1 to... (1 Reply)
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)
I have a script in which i connect to database to run a query and get the result of the query to a temp file. This works fine , now what i want is there is flat file which contains the value to be used in the query. I want to read this file line by line and then run the query for each value in that... (7 Replies)
Hi,
I have created a shell script that reads line from text file and insert into DB table. I have used IFS to separate the line text. Looks IFS is splitting text properly but while passing one of the values that has special characters in it to query, it is giving weird issue. Below is my... (2 Replies)
Discussion started by: yuvi
2 Replies
LEARN ABOUT DEBIAN
tangram::type::hash::scalar
Tangram::Type::Hash::Scalar(3pm) User Contributed Perl Documentation Tangram::Type::Hash::Scalar(3pm)NAME
Tangram::Type/Hash/Scalar - map Perl hash of scalar keys and values
SYNOPSIS
use Tangram::Core;
use Tangram::Type/Hash/Scalar; # always
$schema = Tangram::Schema->new(
classes => { NaturalPerson => { fields => {
flat_hash =>
{
opinions =>
{
table => 'NP_ops',
key_sql => 'VARCHAR(10)',
type => 'int',
sql => 'NUMERIC(1)',
},
lucky_numbers => 'int', # use defaults
}
DESCRIPTION
Maps references to a Perl hash. The persistent fields are grouped in a hash under the "flat_hash" key in the field hash.
The hash may contain as keys and values only 'simple' scalars like integers, strings or real numbers. It may not contain references. For
hashs of objects, see Tangram::Type::Hash::FromMany and Tangram::Type::Hash::FromOne.
Tangram uses a table to save the state of the collection. The table has three columns, which contain
* the id of the container object
* the key of the element in the hash
* the value of the element
The field names are passed in a hash that associates a field name with a field descriptor. The field descriptor may be either a hash or a
string. The hash uses the following fields:
* key_type
* key_sql
* type
* sql
* table
The optional fields "key_type" and "type" specify the key and value types of the hash. If the type is "string" Tangram quotes the values as
they are passed to the database. Not specifying a "type" is exactly equivalent to specifying "string".
Optional field "table" sets the name of the table that contains the elements. This defaults to 'C_F', where C is the class of the contain-
ing object and F is the field name.
The optional fields "key_sql" and "sql" specify the type that deploy() (see Tangram::Deploy) should use for the column containing the key
and value of the hash. If this field is not present, the SQL type is derived from the "type" field: if "type" is "string" (or is absent)
VARCHAR(255) is used; otherwise, the "type" field is interpreted as a SQL type.
If the descriptor is a string, it is interpreted as the value of the "type" field and all the other fields take the default value.
AUTHOR
This mapping was contributed by Gabor Herr <herr@iti.informatik.tu-darmstadt.de>
perl v5.8.8 2006-03-29 Tangram::Type::Hash::Scalar(3pm)