postgresql - ECPG invocation of stored procedure with an array argument -
I have an ECPG customer trying to get data, with a subcategory using this stored function "nullipid" Uses a prepared statement that has 4 arguments. I have done this work with the 4th argument, which has been declared as a simple varchar. I have tried to declare the fourth argument as an array, but the ECPG is not passing the first argument of the array only in 4th ARG, not all of them.
What is the trick to cross the full fear of the Recoverser (S)? This array size will usually be limited to only 5 disputes. I realize that I can add more logic to the function to overcome this issue. I was hoping that the solution would be more elegant.
Thank you for your comments
Dave
The initial part of the EXEC SQL; Const char * cid = connid; Const char * tgrp; // group key (trunk) const char * cca; // Call Control Agent Key (Truck) Conquest char * dhost; // Host key (trk) const four * regusr [MAX_USRS]; // Register Username (Linux) Excel SQL and Disclaimer Section; The PGC file prepares the host variable above and there is an invocation for the effect.
EXEC SQL AT: Select from cid ps_portdataviasip "SELECT * Adding rows to port (USDIDI) \ LEFT add transit user (id) \ left client is using (CID) \ Where port.id = (Secureipidipid (?,?,?,?)) Registration by ORDER .expression DESC "; EXEC SQL AT: CID DECLARE cur_portsip cursor for ps_portdataviasip; Exec Sql AT: CID Open CrashPointing Using: CCA ,: TGRP, Dehost,: Regular; Exec Sql AT: cur_opsip in Cursor Sqlda in front of CID FIT; stored function is declared
function is canceled or changes (CCA character changes, TGRP character changes , Different character changes, user character is different []) Returns as INTEGER
< P> The problem is usually that you need to process the array. PostgreSQL string representation usually means that it is in CSV Changing and surrounding it with proper brackets. So you are very typical in some environments, not only ecpg. A second approach may be to make the variadic function, and just like that: '{myuser2 "," myuser1 "," myuser2321 "}' Pass args from Then they come in the form of an array and you use them in this way, but you pass them as personal arguments.
Comments
Post a Comment