473,387 Members | 1,365 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Pass parameters to a TCL function

Hello list,

I have a tcl trigger function called audit_log(varchar, bpchar), if I
write a trigger in a table

CREATE TRIGGER tg_test
AFTER INSERT OR UPDATE OR DELETE
ON xtable
FOR EACH ROW
EXECUTE PROCEDURE audit_log('xtable','internal');

it gives this error:

ERROR: CreateTrigger: function audit_log() does not exist

I also tried to make a kinda wrapper plpgsql trigger to call the
audit_log function but didn't work, any idea what's wrong?, how do I
pass parameters to a trigger function?

Thanks in advance,

Josue Maldonado.

Nov 11 '05 #1
2 6070

I'm sorry, found my mistake, the way I'm calling the function is wrong
it should be "audit_log" ('xtable','internal'), it works.

Thanks
Josué Maldonado wrote:
Hello list,

I have a tcl trigger function called audit_log(varchar, bpchar), if I
write a trigger in a table

CREATE TRIGGER tg_test
AFTER INSERT OR UPDATE OR DELETE
ON xtable
FOR EACH ROW
EXECUTE PROCEDURE audit_log('xtable','internal');

it gives this error:

ERROR: CreateTrigger: function audit_log() does not exist

I also tried to make a kinda wrapper plpgsql trigger to call the
audit_log function but didn't work, any idea what's wrong?, how do I
pass parameters to a trigger function?

Thanks in advance,

Josue Maldonado.


Nov 11 '05 #2


Josué Maldonado wrote:
I'm sorry, found my mistake, the way I'm calling the function is wrong
it should be "audit_log" ('xtable','internal'), it works.
Hmmm, that should not work. The function should be declared taking no
arguments and you yet find the arguments from the CREATE TRIGGER in the
Tcl list $args and $1-$n.
Jan

Thanks
Josué Maldonado wrote:
Hello list,

I have a tcl trigger function called audit_log(varchar, bpchar), if I
write a trigger in a table

CREATE TRIGGER tg_test
AFTER INSERT OR UPDATE OR DELETE
ON xtable
FOR EACH ROW
EXECUTE PROCEDURE audit_log('xtable','internal');

it gives this error:

ERROR: CreateTrigger: function audit_log() does not exist

I also tried to make a kinda wrapper plpgsql trigger to call the
audit_log function but didn't work, any idea what's wrong?, how do I
pass parameters to a trigger function?

Thanks in advance,

Josue Maldonado.

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to ma*******@postgresql.org)


--
#================================================= =====================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me. #
#================================================= = Ja******@Yahoo.com #
---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match

Nov 11 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: Al Franz | last post by:
Anyone understand how to pass parameters to a JavaScript. If anyone finds this easy to do maybe they could take a look at my short script on this page and show me how it needs to be changed. ...
110
by: Mr A | last post by:
Hi! I've been thinking about passing parameteras using references instead of pointers in order to emphasize that the parameter must be an object. Exemple: void func(Objec& object); //object...
7
by: Zlatko Matiæ | last post by:
Let's assume that we have a database on some SQL server (let it be MS SQL Server) and that we want to execute some parameterized query as a pass.through query. How can we pass parameters to the...
0
by: Zlatko Matiæ | last post by:
Hi everybody! Recently I was struggling with client/server issues in MS Access/PostgreSQL combination. Although Access is intuitive and easy to use desktop database solution, many problems...
14
by: Abhi | last post by:
I wrote a function foo(int arr) and its prototype is declared as foo(int arr); I modify the values of the array in the function and the values are getting modified in the main array which is...
10
by: Robert Dailey | last post by:
Hi, I noticed in Python all function parameters seem to be passed by reference. This means that when I modify the value of a variable of a function, the value of the variable externally from the...
12
by: ArunDhaJ | last post by:
Hi Friends, Is it possible to pass a table as a parameter to a funtion. whos function declaration would look some thing like this.... ALTER FUNCTION TempFunction (@TempTable TABLE, @nPId INT) ...
2
by: =?Utf-8?B?dmlzaHJ1dGg=?= | last post by:
Hi, I have 2 applications running, one Windows application project and the other windows services project. I want to call my Windows application in my windows services. I want to run them as...
1
by: =?Utf-8?B?dmlzaHJ1dGg=?= | last post by:
Hi, I have 2 applications running, one Windows application project and the other windows services project. I want to call my Windows application in my windows services. I want to run them as...
12
by: raylopez99 | last post by:
Keywords: scope resolution, passing classes between parent and child forms, parameter constructor method, normal constructor, default constructor, forward reference, sharing classes between forms....
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.