User Profile

Collapse

Profile Sidebar

Collapse
olav78
olav78
Last Activity: Jan 5 '07, 03:25 PM
Joined: Dec 12 '06
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • olav78
    replied to Use xhtml inside XML based on XSL
    in XML
    Thanks, thats it. :)
    See more | Go to post

    Leave a comment:


  • olav78
    started a topic Use xhtml inside XML based on XSL
    in XML

    Use xhtml inside XML based on XSL

    I have a XSL-file who generate output to a browser through information in a XML-file. It works fine, but now I also want to use some xhtml-tags in this XML-file. I've tried to do it like this when i want to use xhtml-tags:
    Code:
    <strong xmlns="http://www.w3.org/1999/xhtml">strong text</strong>.
    But it does not seem to work. The browser shows the text, but not as «strong». Do I need to include...
    See more | Go to post

  • olav78
    replied to create database test if not exists
    well, i found a not very elegant solution. Set onerror="contin ue" in the ant sql-task. it still generates error when the database exists offcourse, but it works ok i guess...
    See more | Go to post

    Leave a comment:


  • olav78
    replied to create database test if not exists
    Sorry for not being very specific. We have a sql ant task, only used in development, where we set up the database. This task shall run both when the database does exist and when it does not. So we can’t do something like if(not exists){ create database}, because we call a “pure” sql script from the ant task. We have to do this in sql or pl/pgsql or something I guess. But it seems like I can’t create a database from inside a function, and...
    See more | Go to post

    Leave a comment:


  • olav78
    replied to create database test if not exists
    forget the last post. I almost found a solution using a pl/pgsql function. but i get this error: "ERROR: CREATE DATABASE
    cannot be executed from a function"...

    It works fine when i try to create a new role (only when it does not exists) though.

    here is the code:
    Code:
    CREATE OR REPLACE FUNCTION createusertest() RETURNS void AS '
    DECLARE user_rec RECORD;
    BEGIN
    select into
    ...
    See more | Go to post

    Leave a comment:


  • olav78
    replied to create database test if not exists
    Thank you. The problem is how to use "if" or "case" before create database... i've created a plpgsql function, but this seems to only work from the command prompt and not trough jdbc...

    Code:
    CREATE OR REPLACE FUNCTION createdbtest() RETURNS void AS $t$
    BEGIN
    	SELECT datname FROM pg_database WHERE datname='test'';
    	IF datname='test' 
    		THEN CREATE DATABASE test PASSWORD 'test';
    ...
    See more | Go to post

    Leave a comment:


  • olav78
    started a topic create database test if not exists

    create database test if not exists

    create database test if not exists. Someone know how to do this in postgreSQL?
    See more | Go to post

  • You are right. I figured it out myself actually, but thanks anyway.

    I did it this way, a bit longer, but in principal almost the same:

    Code:
    SELECT to_char(date, 'YYYY') to_char(date 'Month'), to_char(date, 'DD'), to_char (date, 'Day'), sum(price)
    FROM sales
    WHERE hotel_id = 1 and date > '2006-10-09'
    GROUP by to_char(date, 'YYYY') to_char(date 'Month'), to_char(date, 'DD'), to_char (date, 'Day')
    ...
    See more | Go to post

    Leave a comment:


  • Sum of “sales” for each date in a timestamp column

    Hi!

    I have a table named sales with the columns date (timestamp) and price (bigdecimal or something). I want to get the sale for each day (the sum of ‘price’ for all the rows with the same ‘date’). Like:
    2006-10-10, 17 sales, 1500.00 $
    2006-10-11, 15 sales, 1400.00$
    etc…

    This is how I try to do it:
    SELECT to_char(date, 'YYYY'), to_char(date, 'Month'), to_char(date, 'DD'), to_char(date,...
    See more | Go to post
No activity results to display
Show More
Working...