1
vote
2answers
41 views
Why am I only seeing the date portion of a timestamp value?
(the question says it all)
5
votes
2answers
58 views
How can I use INSERT…ON EXISTING when I can’t use the primary key as match?
I have a "results" base table where I have stored data from different source tables.
It's the situation where
a simple view would be better suited but the select is way to compl …
2
votes
1answer
117 views
Are there “SQL Design Patterns”?
I have just searched through StackOverflow but couldn't find much...
To all the SQL experts,
is there anything comparable to the "design patterns movement" which has taken place …
3
votes
3answers
76 views
How to output a decimal column as string ?
I have an issue only when the value is less than 1.
Table decimal column value = 0.5, Required output format = '0.5'
I am getting it as '.5' , i need it as '0.5'
select 0.5, str …
4
votes
6answers
144 views
How can I improve this stored function performance?
create function bludata.onlyNumber(in val long varchar)
returns long varchar
begin
declare sTemp long varchar;
declare iCount integer;
set iCount=1;
set sTemp='';
while i …
8
votes
2answers
31 views
Within a select are calculated columns allowed to use other calculated columns?
Someone sent me a query that contained the following:
/* Gets the reading_id of the last reading 30 days
ago - this is for quick lookups of other data 30 days ago */ …
4
votes
1answer
27 views
Does having values in an index improve performance?
If a query is only pulling back one value from a table using 3 columns in an index, does adding it to the index improve performance by not pulling back data rows?
SELECT read …
2
votes
2answers
45 views
Change SQL decimal delimiter
Hello! I am trying to import data into my table using
INPUT INTO
The problem is my decimals is using , as a delimiter, and it expects .. So it won't work!
How can i change thi …
3
votes
2answers
55 views
How to download a file from internet using sql anywhere?
I need to download UN Blacklist XML file periodically. Is there any way to automate this using sql ONLY?
2
votes
1answer
28 views
How do I rotate a table?
This question and answer is copied from the SQL Anywhere newsgroup AND a post to be published later this morning: http://sqlanywhere.blogspot.com/2010/01/crosstab-rotate-pivot.html …
1
vote
2answers
69 views
How to crash a SA11 engine with a simple SQL statement
While testing High Availability I want to simulate a failing primary server. Killing the process via task manager would work, but I just wanted a more elegant solution using plain …
2
votes
1answer
26 views
Should I cast expressions for IN search conditions to the matching type?
I just tried a simple exclusion query of the form
select * from T1 where C1 not in (select C2 from T2)
where C1 is a varchar column.
That works very fast if C1 and C2 are bo …
1
vote
1answer
34 views
Have there ever been thoughts on a DRI action that is directed from the child to the parent table?
(Beware, that might be one of the first academical questions on SQLA.)
In a longer comment dialogue between Breck and me on the following question, I raised the following question …