Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. get the record identity from PostgreSQ/

get the record identity from PostgreSQ/

Scheduled Pinned Locked Moved Database
csharphelpcareer
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    Jassim Rahma
    wrote on last edited by
    #1

    Hi, I tried this code to get the record Identity with C# Windows Form application bu tit's not working.. can any one help please...

    CREATE OR REPLACE FUNCTION fn_create_resume(resume_name character)
    RETURNS int AS
    $$
    DECLARE
    record_identity int;
    BEGIN
    insert into resume_details (resume_id, resume_name) values (default, resume_name);
    return resume_id;
    END;
    $$ LANGUAGE plpgsql;

    C D 2 Replies Last reply
    0
    • J Jassim Rahma

      Hi, I tried this code to get the record Identity with C# Windows Form application bu tit's not working.. can any one help please...

      CREATE OR REPLACE FUNCTION fn_create_resume(resume_name character)
      RETURNS int AS
      $$
      DECLARE
      record_identity int;
      BEGIN
      insert into resume_details (resume_id, resume_name) values (default, resume_name);
      return resume_id;
      END;
      $$ LANGUAGE plpgsql;

      C Offline
      C Offline
      Chris Meech
      wrote on last edited by
      #2

      Try the following

      BEGIN
      insert into resume_details (resume_id, resume_name) values (default, resume_name);
      select resume_id into record_identity from resume_details where resume_name = resume_name;
      return record_identity;
      END;

      :)

      Chris Meech I am Canadian. [heard in a local bar] In theory there is no difference between theory and practice. In practice there is. [Yogi Berra]

      1 Reply Last reply
      0
      • J Jassim Rahma

        Hi, I tried this code to get the record Identity with C# Windows Form application bu tit's not working.. can any one help please...

        CREATE OR REPLACE FUNCTION fn_create_resume(resume_name character)
        RETURNS int AS
        $$
        DECLARE
        record_identity int;
        BEGIN
        insert into resume_details (resume_id, resume_name) values (default, resume_name);
        return resume_id;
        END;
        $$ LANGUAGE plpgsql;

        D Offline
        D Offline
        David Skelly
        wrote on last edited by
        #3

        Do either of these help? http://efreedom.com/Question/1-2944297/Postgresql-Function-Last-Inserted[^] http://bytes.com/topic/postgresql/answers/173510-get-last-id-insert[^]

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups