Results 1 to 6 of 6
  1. #1
    Join Date
    Feb 2004
    Posts
    6

    Unanswered: PL/PgSQL-question

    Hello,
    I'm new to PL/PgSQL. Although I'm more or less familiar with other programing languages, including general-purpose SQL, I feel like the first man here.

    I want to load a table into an array to arrange the fields new (like a pivot table) and perform some calculations in dependence of a specific field value. But I don't manage to get over the probably very simple basic stuff. I also fail getting a clue from the docs.

    Could anyone please provide a _very_simple_ example which way this is usually done?

    Lets say I have a table:
    table_name with columns of different datatypes:
    t_id(integer), parameter(varchar(50)), value(number(n,m))

    Now I want to read all datasets into an array and give just all datasets from the array back to the screen.

    Appreciating your help,
    Torsten

  2. #2
    Join Date
    Sep 2001
    Location
    Vienna
    Posts
    400

    Table functions

    Maybe you look further into the topic table functions

    this may solve your problem
    http://www.postgresql.org
    --Postgresql is the only kind of thing--

  3. #3
    Join Date
    Feb 2004
    Posts
    6
    Thank you, I try a shy look,

    Torsten

  4. #4
    Join Date
    Mar 2004
    Posts
    110
    Personally i wouldnt do such an operation on the db.

    I'd create an api in (for example php) that fetches the rows and then let the php engine do the work so there is less stress on the db.

  5. #5
    Join Date
    Feb 2004
    Posts
    6
    Yes, I thought about it too, because I query the database from php - thats why... But nobody around me saying I would do it that way because... So I thought the database engine could handle this much faster, since the web-server is under stress anyway, and there is only a very limited group of people having access to these tables. They also access the db only occasionally.

    Torsten

  6. #6
    Join Date
    Mar 2004
    Posts
    3

    db has to do its part of job

    purpose of dbms is to store get and manage data!

    why should i let php do the job, when db server can
    retrive, sort and give back to my php script data?

    HTML/XHTML <-----------------> PHP/JSP <------------------> DBMS

    Everyone has its own part of job .... Let them do that .....

    best regards,
    [m]

Posting Permissions

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