I have created the following __new function:
create function na_subscription__new (
integer, -- subscription_id
integer, -- owner_id
varchar, -- feed_url
varchar, -- host_url
varchar, -- title
varchar, -- description
integer, -- updates
timestamp, -- last_scanned
varchar, -- object_type
timestamp, -- creation_date
integer, -- creation_user
varchar, -- creation_ip
integer -- context_id
) returns integer as '
declare
p_subscription_id alias for $1; -- default null
p_owner_id alias for $2; -- default null
p_feed_url alias for $3;
p_host_url alias for $4;
p_title alias for $5;
p_description alias for $6;
p_updates alias for $7;
p_last_scanned alias for $8;
p_object_type alias for $9; -- default ''na_subscription''
p_creation_date alias for $10; -- default now()
p_creation_user alias for $11; -- default null
p_creation_ip alias for $12; -- default null
p_context_id alias for $9; -- default null
v_subscription_id integer;
begin
v_subscription_id := acs_object__new (
p_subscription_id,
p_object_type,
current_timestamp,
p_creation_user,
p_creation_ip,
p_context_id
);
insert into na_subscriptions
(subscription_id, owner_id, feed_url, host_url, title, description, updates, last_scanned)
values
(v_subscription_id, p_owner_id, p_feed_url, p_host_url, p_title, p_description, p_updates, p_lastsca\
nned);
PERFORM acs_permission__grant_permission(
v_subscription_id,
p_owner_id,
''admin''
);
return v_subscription_id;
end;' language 'plpgsql';
I am now building subscription-add.tcl, which creates a new subscription with:
db_exec_plsql new_subscription {}
Here's the corresponding query in subscription-add-postgresql.xql:
select na_subscription__new(
:subscription_id,
:user_id,
:feed_url,
:host_url,
:title,
:description,
'0',
current_timestamp,
'na_subscription',
current_timestamp,
:user_id,
:peeraddr,
:package_id
);
But I get the following error upon visting the page:
[11/Jan/2003:19:42:02][23272.4101][-conn0-] Error: dbinit: error(localhost::bcuni,ERROR: Function 'na_subscri\
ption__new(unknown, unknown, unknown, unknown, unknown, unknown, unknown, timestamptz, unknown, timestamptz, u\
nknown, unknown, unknown)' does not exist
Unable to identify a function that satisfies the given argument types
You may need to add explicit typecasts
): '
select na_subscription__new(
'4597',
'2604',
'http://scriptingnews.com/rss.xml',
'http://scriptingnews.com',
'Scripting News',
'A weblog about scripting and stuff like that.',
'0',
current_timestamp,
'na_subscription',
current_timestamp,
'2604',
'62.107.42.240',
'4353'
);
'
The problem seems rather basic, but my searching the forums unfortunately didn't give me anything.
Can anyone help me out and let me know what I am doing wrong?
/Simon