Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
ensembl-gh-mirror
ensembl
Commits
37e1ec4a
Commit
37e1ec4a
authored
Feb 16, 2004
by
Web Admin
Browse files
js5 tidy query
parent
35f33923
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
7 deletions
+9
-7
modules/Bio/EnsEMBL/DBSQL/BaseFeatureAdaptor.pm
modules/Bio/EnsEMBL/DBSQL/BaseFeatureAdaptor.pm
+8
-6
modules/Bio/EnsEMBL/DBSQL/MiscFeatureAdaptor.pm
modules/Bio/EnsEMBL/DBSQL/MiscFeatureAdaptor.pm
+1
-1
No files found.
modules/Bio/EnsEMBL/DBSQL/BaseFeatureAdaptor.pm
View file @
37e1ec4a
...
...
@@ -113,7 +113,7 @@ sub generic_fetch {
if
(
exists
$left_join_hash
{
$t
->
[
0
]
}
)
{
my
$condition
=
$left_join_hash
{
$t
->
[
0
]
};
my
$syn
=
$t
->
[
1
];
$left_join
.=
"
LEFT JOIN
"
.
$t
->
[
0
]
.
"
$syn
ON
$condition
";
$left_join
.=
"
LEFT JOIN
\n
"
.
$t
->
[
0
]
.
"
$syn
ON
$condition
";
}
else
{
push
@tables
,
$t
;
}
...
...
@@ -125,26 +125,28 @@ sub generic_fetch {
#construct a nice table string like 'table1 t1, table2 t2'
my
$tablenames
=
join
('
,
',
map
({
join
('
',
@
$_
)
}
@tables
));
my
$sql
=
"
SELECT
$columns
FROM
$tablenames
$left_join
";
my
$sql
=
"
SELECT
$columns
\n
FROM
$tablenames
$left_join
";
my
$default_where
=
$self
->
_default_where_clause
;
my
$final_clause
=
$self
->
_final_clause
;
#append a where clause if it was defined
if
(
$constraint
)
{
$sql
.=
"
where
$constraint
";
$sql
.=
"
\n
WHERE
$constraint
";
if
(
$default_where
)
{
$sql
.=
"
and
$default_where
";
$sql
.=
"
AND
\n
$default_where
";
}
}
elsif
(
$default_where
)
{
$sql
.=
"
where
$default_where
";
$sql
.=
"
\n
WHERE
$default_where
";
}
#append additional clauses which may have been defined
$sql
.=
"
$final_clause
";
$sql
.=
"
\n
$final_clause
";
###print STDERR "\n\n$sql\n\n";
warn
"
JS5 misc set queries======================
\n
$sql
\n
";
my
$sth
=
$db
->
prepare
(
$sql
);
$sth
->
execute
;
...
...
modules/Bio/EnsEMBL/DBSQL/MiscFeatureAdaptor.pm
View file @
37e1ec4a
...
...
@@ -250,7 +250,7 @@ sub _left_join {
sub
_final_clause
{
my
$self
=
shift
;
return
"
order by
mf.misc_feature_id
";
return
"
ORDER BY
mf.misc_feature_id
";
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment