8 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
Can anyone offer any advice on how to modify the script below to work on a new system we have, that has no graphics capability? We admin the system through a serial RAS device. I've tried running the below script through the RAS and through an ssh -X session. It failed with something like "GTK... (3 Replies)
Discussion started by: yelirt5
3 Replies
2. Shell Programming and Scripting
Hi All,
Suppose I want to take a screenshot of a website say Google and save that image. How should I do it?
I tried wget with this but of no help. It just makes a particular file in jpeg format but on opening the same it says corrupted. Although I can edit the jpeg as an HTML file.
wget... (15 Replies)
Discussion started by: ankur328
15 Replies
3. What is on Your Mind?
Ten movies have been nominated as best motion picture by the International Press Academy, presentation of the 2012 Satellite Awards will be held on 16th December at Los Angeles, CA.
Place your bits here on one of the below nominated movie of your choice:-
Argo
... (0 Replies)
Discussion started by: Yoda
0 Replies
4. Shell Programming and Scripting
I am trying to capture screenshots from a huge list of URLs. I am able to manually capture images of individual pages; that is, I simply run the following command to get a screenshot of Foo.com
$ python /path/to/screencapture.sh http://www.foo.com
I want to modify the script so that instead of... (2 Replies)
Discussion started by: chipperuga
2 Replies
5. UNIX for Dummies Questions & Answers
people i have a problem i have a 32 bits sparc processor, and solaris 64 bits processor, i install a oracle data base 64 bits, but my oracle will not run because my processor is from 32 bits this is ok??, i know if i have x86 i cannot install a 64 bits operatin system in a 32 bits processor.
... (0 Replies)
Discussion started by: enkei17
0 Replies
6. Programming
Hey guys,
I'm for C code that can do screen capture for me.
Any help.
Thanks. (8 Replies)
Discussion started by: rakesh_01
8 Replies
7. AIX
Hello:
NOOB here. I attempted to use smit mkcd. Failed on first attempt, not enough space. 2nd attempt tried to place iso on /usr, not enough space there. Cleanup ran for about 5 minutes after aborting. Now AIX won't boot. LCD display on 7029-6E3 says: 0517 MOUNT /USR. Attempted to boot from CD... (11 Replies)
Discussion started by: bbird
11 Replies
8. UNIX for Dummies Questions & Answers
Hello all,
I was wondering if anyone can tell me how to change 24 bits depth display to 8 bits depth display for Sun Ultra1, running Solaris 8? THANKS in advance. I think that the command is ffbconfig, but it has nothing about depth. (4 Replies)
Discussion started by: larry
4 Replies
DBIx::DBStag::SQLTemplate(3pm) User Contributed Perl Documentation DBIx::DBStag::SQLTemplate(3pm)
NAME
DBIx::DBStag::SQLTemplate - A Template for an SQL query
SYNOPSIS
# find template by name
$template = $dbh->find_template("mydb-personq");
# execute this template, filling in the 'name' attribute
$xml = $dbh->selectall_xml(-template=>$template,
-bind=>{name => "fred"});
DESCRIPTION
A template represents a canned query that can be parameterized.
Templates are collected in directories (in future it will be possible to store them in files or in the db itself).
To tell DBStag where your templates are, you should set:
setenv DBSTAG_TEMPLATE_DIRS "$HOME/mytemplates:/data/bioconf/templates"
Your templates should end with the suffix .stg, otherwise they will not be picked up
You can name templates any way you like, but the standard way is to use 2 or 3 fields
SCHEMA-OBJECT
or
SCHEMA-OBJECT-QUALIFIERS
(with underscores used within fields)
A template file should contain at minimum some SQL; for example:
Example template 1
SELECT
studio.*,
movie.*,
star.*
FROM
studio NATURAL JOIN
movie NATURAL JOIN
movie_to_star NATURAL JOIN
star
WHERE
[movie.genre = &genre&] [star.lastname = &lastname&]
USE NESTING (set(studio(movie(star))))
Thats all! However, there are ways to make your template more useful
Example template 2
:SELECT
studio.*,
movie.*,
star.*
:FROM
studio NATURAL JOIN
movie NATURAL JOIN
movie_to_star NATURAL JOIN
star
:WHERE
[movie.genre = &genre&] [star.lastname = &lastname&]
:USE NESTING (set(studio(movie(star))))
//
schema: movie
desc: query for fetching movies
By including : at the beginning it makes it easier for parsers to assemble SQL (this is not necessary for DBStag however)
After the // you can add tag: value data.
You should set schema: if you want the template to be available to users of a db that conforms to that schema
GETTING A TEMPLATE
The DBIx::DBStag object gives various methods for fetching templates by name, by database or by schema
VARIABLES
WHERE clause variables in the template look like this
&foo&
variables are bound at query time
my $set = $dbh->selectall_stag(-template=>$t,
-bind=>["bar"]);
or
my $set = $dbh->selectall_stag(-template=>$t,
-bind=>{foo=>"bar"});
If the former is chosen, variables are bound from the bind list as they are found
OPTIONAL BLOCKS
WHERE [ foo = &foo& ]
If foo is not bound then the part between the square brackets is left out
Multiple option blocks are ANDed together
An option block need not contain a variable - if it contains no &variable& name it is automatically ANDed
BINDING OPERATORS
The operator can be bound at query time too
WHERE [ foo => &foo& ]
Will become either
WHERE foo = ?
or
WHERE foo LIKE ?
or
WHERE foo IN (f0, f1, ..., fn)
Depending on whether foo contains the % character, or if foo is bound to an ARRAY
METHODS
name
Usage - $name = $template->name
Returns - str
Args -
every template has a name that (should) uniquely identify it
desc
Usage - $desc = $template->desc
Returns - str
Args -
templates have optional descriptions
get_varnames
Usage - $varnames = $template->get_varnames
Returns - listref of strs
Args -
Returns the names of all variable used in this template
WEBSITE
<http://stag.sourceforge.net>
AUTHOR
Chris Mungall <cjm@fruitfly.org>
COPYRIGHT
Copyright (c) 2003 Chris Mungall
This module is free software. You may distribute this module under the same terms as perl itself
perl v5.12.4 2010-02-01 DBIx::DBStag::SQLTemplate(3pm)