Forum OpenACS Q&A: Porting PL/SQL that returns a value

Collapse
Posted by Roberto Mello on
I need a quick hint on porting PL/SQL functions that return a value to Tcl. I have this in the Oracle.sql file:
   begin
      :revision_id := content_revision.new(
           title         => :title,
           description   => :description,
           mime_type     => :mime_type,
           text          => ' ',
           item_id       => content_symlink.resolve(:item_id),
           creation_ip   => '[ns_conn peeraddr]',
           creation_user => [User::getID]
      );

How should the Postgres version look like so that revision_id ends up with the result of the function? I think I know the answer but wanted to check here to make sure.

Collapse
Posted by Roberto Mello on
I meant "-oracle.xql", not "Oracle.sql".
Collapse
Posted by Don Baccus on
Try "select content_revision__new(...) as revision_id" ...
Collapse
Posted by Roberto Mello on
Ok, that's what I had. Thanks Don.