Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2003

    Unanswered: help with copy command

    hi, got a problem with the following code, wonder if u can help me spot where i went wrong

    create or replace function updateLoc(text) return text
    as '
        declare newLoc text;
        newLoc = $1;
        create table udtable (
            -- fields
        -- This is the problem area
        -- cannot get it to work using variable newLoc
        -- but it works perfectly if i specify filepath
        -- comes up with a parser error
        copy udtable (fields) from newLoc;
        -- copy udtable (fields) from ''filepath'
        return newLoc;
    ' language 'plpgsql';
    i'm just not too sure what i did wrong, but i'm sure it's that line, coz when i swap those 2 lines it works.
    any help is much appreciated

  2. #2
    Join Date
    Oct 2003
    also, another thing, if i want to read that file periodically (say, every 5 secs), what do i need to do? is there a sleep function like in c?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts