PL/SQL TOOLKIT + STORED PROC / APEX VAR

Hi guys,
i can't find a good example on how to use pl/sql toolkit with var taken from the page or stored proc:
An example. I want to build a thumbnails of img:
Let's say i use this to build my image grid:
for x in 1..5 loop
htp.p('<table border=1><tr>');
for x in 1..5
loop
htp.p('<td>a</td>');
end loop;
htp.p('</tr></table>');
Now how i would like to use a code as follows to
<img src="#OWNER#.display_thumb?p_photo_id=' (PHOTO_CATALOG_ID,80) || ' "/ WIDTH=100 HEIGHT=100>'
Assuming that all my code is working how should i rewrite the <td>a</td> tag with an img src tag
a)htp.p
b)htp.img
Other question: is apex developed using pl/sql toolkit?
Thanx a lot for this
Message was edited by:
Marcello Nocito
Message was edited by:
Marcello Nocito

Hello,
The following is the best place to start if you are interesting in creating new pages using the web toolkit. Pay special attention to the initialization and ending statements Scott is using - http://spendolini.blogspot.com/2006/04/custom-export-to-csv.html
Hope this can help,
Arie.

Similar Messages

  • SQL Server Stored Proc/Database Permissions

    First of all, I'm not sure that I'm posting this in the correct place.  I'm a Windows/Active Directory Engineer, looking for some guidance on how other companies are managing/maintaining what I'm about to describe.
    We have a rather complex SQL Server environment with multiple two node clusters running multiple databases on each.  On their own, rather simple.  On each database there are different stored procedures that are being accessed by different service
    accounts for different (mainly) web services.
    Up until recently, we were running into issues deploying proper accounts and groups for this process.  We've got a multi-domain environment with trusts between them.  We follow IGDLA (AGDLP) to grant permissions... That is..
    Account -------- Global Group --------- Domain Local Group
    WebSvcAcct --- WebSvcAcct_Group ------ MyService_Group
    The Global group is granted the permissions cross-domain, following AD Group Scoping.  We currently track this, per service, in a Database access Spreadsheet, where we list the following in each successive column:
    Service, Account, Global Group, Domain Local, Database Server, Database Name, Database Role, Stored Procs
    Is there a tool/utility that can maintain this and allow Role-Based Access to it?  How do other companies maintain database permissions?
    Thanks in advance!!

    Hello,
    Are you asking if there is something that can maintain your list or something that can help you with security?
    Most companies use groups, much like you have there and either give access to the group or use it in combination with database roles. This simplifies many different aspects of reporting and auditing.
    If you're asking about a utility, I don't know of any specifically for this but it shouldn't be too hard to make a powershell utility script to do this for you, interrogating AD, SQL, etc.
    -Sean
    The views, opinions, and posts do not reflect those of my company and are solely my own. No warranty, service, or results are expressed or implied.

  • Sql server stored procs migration to oracle

    Can't I migrate only the stored procedures alone of sql server db to Oracle using sql developer? How to load the .ocp files with the stored procs I have?

    Hi,
    I don't know how to manually update the generated captured files (bat, ocp) with other information or even if it is possible, as the bat files extract data from the SQL*Server data dictionary information to populate the files for the load. If the stored procedures have already been created in the SQL*Server database then they will added to the generated OCP information. If you want to manually change the files then you'll have to work it out for yourself, I'm afraid.
    If they are not in the SQL*Server database and exist only as the create statements in text files then you have 2 options, as far as I can see -
    - either run the scripts to create the stored procedures in the database before running the migration
    - use the translation scratch editor and put the procedure create SQL into that to convert to Oracle format -
    Tools > Migration >Translation Scratch Editor
    You need to be aware that translation of stored procedures isn't always automatically 100% completed and manual intervention is sometimes needed, depending on the complexity of the procedure and how it is written.
    Regards,
    Mike

  • Winsock error when running SQL Server Stored Proc

    I have a SQL Server stored procedure that is trying to read emails from an IMAP server (I am using mail.dll from www.limilabs.com).
    The SP works fine on my local computer/db, and the code also runs fine when run from a console application on my remote server. When I try to run it from SQL Server however I get this error message:
    Msg 6522, Level 16, State 1, Procedure GetEmails, Line 0A .NET Framework error occurred during execution of user-defined routine or aggregate "GetEmails": Limilabs.Client.ServerException: The requested name is valid, but no data of the requested type was found ---> System.Net.Sockets.SocketException: The requested name is valid, but no data of the requested type was foundSystem.Net.Sockets.SocketException:    at System.Net.Dns.InternalGetHostByName(String hostName, Boolean includeIPv6)   at System.Net.Dns.GetHostAddresses(String hostNameOrAddress)   at System.Net.Sockets.Socket.Connect(String host, Int32 port)   at Limilabs.Client.ClientBase.Connect(String host, Int32 port, Boolean useSSL)Limilabs.Client.ServerException:    at Limilabs.Client.ClientBase.Connect(String host, Int32 port, Boolean useSSL)   at StoredProcedures.GetEmails()
    I suspect it is something to do with permissions (??) but it is beyond my knowledge of SQL Server. Anyone have some pointers? I am using the IP for the IMAP server, I have switched off the firewall.
    Thanks

    Reading emails in a stored procedure? Hm...
    Unless you are impersonating the actual user in your CLR procedure, the access will be under the service account for SQL Server. If this is Local Servic or similar and may not have the permission or configuration to access whatever System.Net.Dns.InternalGetHostByName
    is trying to access.
    Try running SQL Server under a domain account to see what happens.
    Erland Sommarskog, SQL Server MVP, [email protected]

  • Converting MS Sql server stored proc to Oracle stored procedure

    I need to convert this MS SQL Server 200 stored procedure to Oracle stored procedure. Any help great appreciated.
    Thank you,
    set nocount on
    declare @sp varchar(100)
    set @sp = '<< stored procedure name goes here >>'
    declare @oid int
    select @oid = o.id from sysobjects o where o.name = @sp
    declare @last int
    -- function signature
    select @last = max(c.colid)
    from dbo.syscolumns c
    where c.id = @oid
    select case c.colid
    when 1 then '[ SqlCommandMethod(CommandType.StoredProcedure) ]'
    + char(13) +
    'public static SqlCommand ' + @sp + '(' + char(13) +
    ' [ NonCommandParameter ] SqlConnection
    ' connection '
    + char(13) +
    else ''
    end
    + ' ' +
    case t.name
    when 'char' then
    '[ SqlParameter(' + convert(nvarchar(10), c.length) + ')  '
    when 'varchar' then
    '[ SqlParameter(' + convert(nvarchar(10), c.length) + ') ] '
    when 'nchar' then
    '[ SqlParameter(' + convert(nvarchar(10), c.length / 2) + ') ] '
    when 'nvarchar' then
    '[ SqlParameter(' + convert(nvarchar(10), c.length / 2) + ') ] '
    else ''
    end
    +
    case t.name
    when 'char' then 'string'
    when 'nchar' then 'string'
    when 'varchar' then 'string'
    when 'nvarchar' then 'string'
    when 'bit' then 'bool'
    when 'datetime' then 'DateTime'
    when 'float' then 'double'
    when 'real' then 'float'
    when 'int' then 'int'
    else 'object /* ' + t.name + ' */'
    end
    + ' ' + lower(substring(c.name, 2, 1)) + substring(c.name, 3, 100)
    +
    case c.colid
    when @last then ')' + char(13) + '{'
    else ','
    end
    from dbo.syscolumns c
    left outer join dbo.systypes t on c.xusertype = t.xusertype
    where c.id = @oid
    order by c.colid
    -- call to generator
    select case c.colid
    when 1 then
    ' return SqlCommandGenerator.GenerateCommand(connection,' +
    char(13)
    else ''
    end
    + ' ' + lower(substring(c.name, 2, 1)) + substring(c.name,
    3, 100)
    +
    case c.colid
    when @last then ');' + char(13) + '}'
    else ','
    end
    from dbo.syscolumns c
    where c.id = @oid
    order by c.colid

    It would have helped if you had posted your code.
    To create tables in procedures, you can use EXECUTE IMMEDIATE. For example, if within a procedure, you want to:
    CREATE TABLE table_name
    (column1 NUMBER,
    column2 VARCHAR2 (30),
    column3 DATE);
    Then, from within a procedure you can:
    CREATE OR REPLACE PROCEDURE procedure_name
    AS
    BEGIN
    EXECUTE IMMEDIATE 'CREATE TABLE table_name
    (column1 NUMBER,
    column2 VARCHAR2 (30),
    column3 DATE)';
    END procedure_name;
    EXEC procedure_name
    For the procedure to count the number of business days between two input dates, see the following link:
    http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:91212348059

  • Use 'default' keyword in call string while calling stored proc?

    I am calling following sql server stored procedure from java code using my jdbc driver for sql server: CREATE PROCEDURE test_findTbInfo (
    @paramIn_Str varchar(10),
    @paramOut_Int int OUT,
    @paramIn_Int int = 20
    AS
    begin
    set @paramOut_Int = @paramIn_Int * 100
    end
    If I make a call like this:
    CallableStatement cs = conn.prepareCall(" { call test_findTbInfo(? , , ? ) }");
    cs.setString(1, "test_tab");
    cs.setInt(2, 4);
    cs.execute();
    It works without any error. But this is not a right behavior. !! The second parameter as you see is passed like an optional parameter. But in stored proc it is NOT an optional param and so if the value not passed it should fail...
    Now if I change the code to
    CallableStatement cs = conn.prepareCall(" { call test_findTbInfo(? , default, ? ) }");
    it works correctly. Gives error that "Procedure 'test_findTbInfo' expects parameter '@paramOut_Int', which was not supplied." which is correct.
    So is it a normal practice to use 'default' keyword while calling sql server stored procedures having optional parameters in jdbc ????
    Anyone knows ??? As far as I know "call test_findTbInfo(? , , ? )" works fine except in some cases and also it forces users to put all optional parameters at the end of parameter list in stored proc.
    Please let me know whether I should go with 'default' throuout for sql server stored proc while calling using my jdbc driver.
    Amit

    {?= call <procedure-name>[<arg1>,<arg2>, ...]}The question mark in the above is the result parameter
    that must be registered.
    That is not the same as an OUT argument.Yes that is true. The result value and OUT parameters are different but they both MUST be registered as per jdbc API
    "The type of all OUT parameters must be registered prior to executing the stored procedure; their values are retrieved after execution via the get methods provided here."
    Anyway, my original question still stays as it was. If there are some optional IN parameters in stored procedure
    e.g.
    PROCEDURE test_findTbInfo (
    @paramIn_Int int = 20,
    @paramOut_Int int OUT
    how do you call this?
    CallableStatement cs = conn.prepareCall(" { call test_findTbInfo( , ? ) }");
    cs.registerOutParameter(1, Types.INTEGER);
    cs.execute();
    or
    CallableStatement cs = conn.prepareCall(" { call test_findTbInfo(default, ? ) }");
    Also note that I am intending to use ONLY sql server driver for this.
    The first as well second seem to work. Except that second way is seems reliable. I just wanted a second opinion on that...
    Amit

  • SQL Server 2005 64-bit & SQL CLR Stored Procedures using DI API. COM Error.

    Hi,
    We've created a set of SQL CLR Stored Procs in C# .NET which use the DI API to import data into SAP (DEV was carried out on 32-bit environment).
    The DLLs and Interop.SAPbobsCOM have been successfully deployed as assemblies on SQL Server with their permission set to UNSAFE on the following environment:
    Microsoft Windows Server 2003 R2 Standard Edition 64-bit, Service Pack 2
    Microsoft SQL Server 2005 - 9.00.3073.00 (X64)
    SAP Business One 2007 A (8.00.180) SP:00 PL:45
    When executing the SQL CLR Stored Procs from SQL Server Management Studio, the following error is returned:
    "Retrieving the COM class factory for component with CLSID {632F4591-AA62-4219-8FB6-22BCF5F62007} failed due to the following error: 80040154."
    From our understanding, this occurs because SQL Server loads the assemblies into it's 64-bit process space, whereas the SAPbobsCOM is 32-bit. Are we assuming correctly?
    What can be done to solve this problem?

    Hi Jeremy,
    I'd agree with your assumption that it's to do with your DLL running in a 64 bit process. When you build your project, try setting the build properties to use a X86 instruction set (ie 32 bit).
    More details here:
    Re: Addon Develeped on 32bit Install on 64bit
    I've never tried for a CLR stored procedure but this is how you get around the issue when running a DI API addon on a 64 bit machine so hopefully it will work if the dll is executed by SQL Server. Let us know how you get on.
    Kind Regards,
    Owen

  • Perl and stored proc question

    Hello,
    I have used ASP w/ many SQL Server stored procs before and many Oracle stored procs with Java before, but I have yet to embark on calling stored procs from Perl.
    My current insert has been like this:
    my $dbh = DBIConnect->connect;     
    my $query1;
    $query1 = "INSERT into DEFAULT_PROJECT (NAME, EMAIL, LOCATION,PHONE,MGRNAME,MGREMAIL,"
        ."PROJNAME,PROJ_LOC,SPON_DEPT,SPON_BUS,PROJ_TYPE)
    ."values (?,?,?,?,?,?,?,?,?,?,?);"But am looking to replicate an equivalent call to an SP. ok, I've created my multi-table insert in SQL Plus, in PL/SQL, and it's just fine, no errors.
    Now I need to make the call.
    I've seen a few different things, including the use of DBIx like
    DBIx::ProcedureCall qw(sysdate);
    I've also seen something like
      $csr =  $dbh->prepare(q{
        BEGIN
          DEFPROJ_FORM_INSERTION;
        END;
       $csr->execute;I'm a bit confused having tried to shake down the CPAN board for a while with little luck.
    Anyone out there know how that call might look or go, given the supplied parameters and stored proc. name?
    I'd assume I'd be assigning the parameterized values much like I am now.
    Can any Perl/Oracle users out there shed any light on this?
    Thanks!

    alright, so I could not get that to work, but just to validate the insert statement I tried to alter it from an SP to a normal dynamic insert SQL statement.
    I get an Oracle error citing
    errERROR: Could not execute SQL! Error: ORA-00911: invalid character (DBD ERROR: OCIStmtExecute)
    DBI ERROR: ORA-00911: invalid character (DBD ERROR: OCIStmtExecute),Maybe I'm overlooking something simple. Anyone see anything out of place that pertains to the SQL statement?
    I think I have input it in a rather manageable, and easy to read block below:
    INSERT ALL
    INTO DEFAULT_PROJECT_USER
    (DEFPROJ_ID,DEFPROJ_ID_LTR,NAME,EMAIL,LOCATION,PHONE,MGRNAME,MGREMAIL,PROJNAME,PROJ_LOC, SPON_DEPT,SPON_BUS,PROJ_TYPE,REG_LEGAL,NETCRED_LOSS, EXPENSE_REDUC_CKB, STRAT_GOALS,AUDIT_COMPL,REV_GEN,CACS,CUSTOMIT,CUST_IMPACT,CALL_MGT,CALL_TRACK,
    CITILINK,DESKTOP,DIALER,DRI,ENGINEER,IMAGING,IPDT,MAINFR,MISC_OTHER,MORTSERV,MORTWEB,NON_MORTSERV,ORIG_PLAT,QUAL_MAP,DATAWARE_REPTS,SERV_APP_VDR,SOUTHBEND,WEB_SVCG,PROBLEM_RESOLVE,EXIST_PROC,BUS_OBJECTIVE,
    PENDING_PROJ,IMPACT_AREAS,REGULATORY_COMPLY,COMPLY_DEADLINE,SUB_DATE,EXPENSE_REDUCTION_TEXT,PRIORITY_RATING,ADDL_COMMENTS,PROJ_TYPE_OTHER,OTHER_EXPL_IT)
    values (defproj_user_seq.nextval,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,to_date(?,'YYYY-MM-DD HH:MI:SS'),SYSDATE,?,?,?,?,?)
    INTO DEFAULT_PROJECT_PROJMGR
    (DEFPROJ_ID,PROJ_MGR,STATUS,IT_PROJ_TYPE,IT_PROJNUMBER,FUNC_SPECS,FUNC_SPECS_DT,FUNC_SPECS_APPR_DT,BRD_APPROVED,BRD_APPROVED_DT,UAT_STARTDT,UAT_ENDDT,TESTER,RELEASE_DT, TARGETED_RELEASE_DT,BENEFIT_AMT,BENEFIT_CMTS,IT_LEVEL,IT_HOURS,FTES_SAVED,NUM_FTES,PROJQUE1,PROJQUE2,ACTUALCBA)
    VALUES (defproj_user_seq.nextval,NULL, NULL, NULL, NULL,NULL, NULL, NULL, NULL,NULL, NULL, NULL,NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,NULL, NULL,NULL,NULL)
    INTO DEFAULT_PROJECT_QA
    (DEFPROJ_ID,TERM,DEFINITION,BUS_NEED,CUST_IMPACT,CONTACT_NAME,IMPACT,IMPACT_PROCESS,IMPACT_DESC,PROCESS_LOC,PROJ_SCHED,PROJ_JUSTIF,IMPL_DATE,PROJ_EXPL,
    PROJ_TYPE,PROJ_JUST_MIT,PROJ_OWNER,PROJ_DATE_STATUS)
    VALUES (defproj_user_seq.nextval,NULL, NULL, NULL, NULL,NULL, NULL, NULL, NULL,NULL, NULL, NULL, NULL, NULL,NULL, NULL,NULL,NULL)
    SELECT object_name AS DEFPROJ_ID_LTR FROM all_objects where rownum <= 1;what could be leading to an invalid character? The error doesn't show which line.
    Thanks, but NEVER MIND...I found it - it's stupid perl! As opposed to a good language (Java).
    It balks at the extra semicolon, unlike Java would.
    Oh, and why am I using Perl you ask? Other than the "yeah, good question response", it's a long story, but suffice to say they don't allow for our UNIX server to be used with Java, just Perl. : (
    I do use Java a good amount here, but sometimes we're bound to crap on another planet where it just isn't an option for the server on which we use Java!
    Maybe someday! : )
    Message was edited by:
    user515689

  • Calling stored proc (with 2 IN and 3 OUT) - from SQL Plus

    This is the signature of my stored proc:
    CREATE OR REPLACE PROCEDURE myschema.myproc
       p_usr_name     IN  VARCHAR2,    
       p_send_tmstmp  IN  DATE,    
       p_ret_value    OUT NUMBER,
       p_err_code     OUT VARCHAR2
    )If I need to call it from sql plus, how do I need to pass the arg?
    This is what I am doing
    execute myschema.myproc('abc123','02-MAY-2008');
    What is wrong here? If someone could help. Thx!

    Try something like this
    var usr_name    varchar2(30)  
    var send_tmstmp varchar2(11)  
    var ret_value   number
    var err_code    varchar2(10)
    begin
    :usr_name    := 'abc123';
    :usr_name := '02-MAY-2008';
    myschema.myproc ( p_usr_name           => :usr_name,
                      p_send_tmstmp        => TO_DATE( :usr_name, 'DD-MON-YYYY' ),
                      p_ret_value          => :ret_value,
                      p_err_code           => :err_code);
    end;
    print ret_value;
    print err_code;                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Parsing Column Value. SQL / Stored Proc/ Function ?

    Hi,
    I just started writing SQL. Need your valuable input for the following query,
    Need to query a table and parse a column to produce a desired output.
    like suppose my column value is
    #ADFA
    /SDFGAS
    {ABC}: 123
    {BCA}: 456
    {DEF}: 789
    and i need to get an out put as follows
    {ABC} {BCA} {DEF}
    123 456 789
    so the patterns are defined.
    I some how tried and reached through SQL, but there should be better way than this. So posted this question.
    I tried using SQL itself (using substr, instr & decode functions in the select statement)... with out using stored proc/ function as i have not created one earlier.. I am just learning the syntax and trying it.
    The psuedo code i have planned is
    function substring(column_value, search_string)
    var start_index NUMBER;
    var end_index NUMBER;
    var result VARCHAR2;
    result = 'N/A';
    start_index = instr(column_value, search_string) + 4
    if start_index >= 4
    end_index = instr(substr(column_value, 0, start_index), CHR(13)-1)
    if start_index >= 4 && end_index >=0
    result = substr(column_value, start_index, end_index);
    return result;
    I just wrote it like writing in a programming language. Need to implement this through Stored Proc/ Function. Please let me know your comment on this

    Oops, I think regular expressions are not available in my current oracle version :-(
    I am having Oracle 9i.
    Got it.. Yes it is available from 10G onwards.. :-(
    Message was edited by:
    Thiru.Thiru

  • How to trigger a report based on a event/stored proc or sql dts completion

    Post Author: Crystaldev
    CA Forum: Publishing
    I want to run/trigger a crystal report based on file existence or based on a stored proc/sql dts/a value present in a sql table. The way I want to do is schedule a crystal report in crystal enterprise and then run the report based on a event like file existence or based on a sql dts completion or a value existence in a sql table. We are using crystal reports v10.
    I am not sure how we can do this, any help is appreciated. Thanks.

    Hi
    When you click on View Data, at bottom click on Edit button
    It will prompt a connection details tab wherein you can view and modify the connections
    Nik

  • Migrate/Import/[etc.] PL/SQL Web-Toolkit Application to APEX

    Hello all,
    I've only recently learned about APEX and have dabbled with it for a little while, and I'm quite impressed with how amazingly quick it is to develop applications with it.
    A few co-workers and myself are trying to convince "The Management" that we should pursue using APEX to develop our Enterprise Applications. Currently we write our web apps using the PL/SQL WebToolkit, accessing our applications at URL's like: http://host/dad/[package.]procedure .
    Recently (within the past month) there was a convention in the Southern California region where I believe some people from TUSC presented on APEX. As I understand it, they said it was possible to migrate existing applications (written in packages and procedures) to APEX. I'm also told that it is possible to view the PL/SQL that is rendered by APEX to display the application.
    We've practically sold our Director, however he has a few outstanding issues he's asked me to research, as he feels his boss would be most concerned with:
    * How much effort will it take to migrate/import/etc the PL/SQL WebToolkit Application to APEX
    * Should the need arise, how much effort would it take to move from APEX back to PL/SQL WebToolkit
    I've tried researching these topics over the past few days and I haven't really come up with much. I realize that you can call PL/SQL packages/procedures/etc from within a region, but as I read on a thread in these forums ( How to jump from mod_plsql to APEX! ), you still won't be able to take advantage of the Items, Computations, Processes, etc. Is there, in fact, a way of importing a PL/SQL-developed Web Application into APEX to take advantage of all its tools? I would imagine it would be quite a feat to be able to create the items for the form fields, maintain the layout and such, but I need to provide my Director with as much information on these topics as possible.
    Many of us developers are really excited at the prospect of developing with this tool; it would be a shame to lose the opportunity over not being able to provide any information on the topics above.
    Thanks in advance for your assistance,
    -Luis

    Hi Luis,
    I had a client a couple of years back who had an existing PL/SQL Web Toolkit application who used the htp.p etc calls to generate the HTML (and in some cases CSS) for their site. They were interested in using Application Express and asked me to design a new administration module for their site (which I did). The development went extremely smoothly so they then asked about re-writing their existing site in APEX (since maintaining the old site was not a straight-forward task).
    Fortunately for me, the original designer had the foresight to put lots of the application logic into packages (which I could reuse), but I quickly (about 2 or 3 days from memory) created a custom theme and templates in APEX which gave the same look and feel as the existing site.
    Personally, I think if you tried to re-use the existing htp.p calls (by using PL/SQL regions etc), then you would be missing out on some of the major advantages of using APEX (such as the ability to easily change the look and feel of your application).
    I always think that migrating to a new tool/platform etc is a great opportunity to re-examine your existing code to perhaps see if you can do things differently (speed up those queries, perhaps make the navigation more logical etc).
    So, yes you can certainly re-use lots of your existing packaged logic, but I would also take the leap and use the features that Application Express provides to make future maintenance of your application easier.
    Just my thoughts.
    John.

  • Can we call a Java Stored Proc from a PL/SQL stored Proc?

    Hello!
    Do you know how to call a Java Stored Proc from a PL/SQL stored Proc? is it possible? Could you give me an exemple?
    If yes, in that java stored proc, can we do a call to an EJB running in a remote iAS ?
    Thank you!

    For the java stored proc called from pl/sql, the example above that uses dynamic sql should word :
    CREATE OR REPLACE PACKAGE MyPackage AS
    TYPE Ref_Cursor_t IS REF CURSOR;
    FUNCTION get_good_ids RETURN VARCHAR2 ;
    FUNCTION get_plsql_table_A RETURN Ref_Cursor_t;
    END MyPackage;
    CREATE OR REPLACE PACKAGE BODY MyPackage AS
    FUNCTION get_good_ids RETURN VARCHAR2
    AS LANGUAGE JAVA
    NAME 'MyServer.getGoodIds() return java.lang.String';
    FUNCTION get_plsql_table_A RETURN Ref_Cursor_t
    IS table_cursor Ref_Cursor_t;
    good_ids VARCHAR2(100);
    BEGIN
    good_ids := get_good_ids();
    OPEN table_cursor FOR 'SELECT id, name FROM TableA WHERE id IN ( ' &#0124; &#0124; good_ids &#0124; &#0124; ')';
    RETURN table_cursor;
    END;
    END MyPackage;
    public class MyServer{
    public static String getGoodIds() throws SQLException {
    return "1, 3, 6 ";
    null

  • BPEL process to Insert XML into DB using pl/sql stored proc

    Hi,
    We have created a BPEL process in which we are taking input request and store it into Oracle Database using PL/SQL proc.
    We have been unsuccessful in doing so because the data stored in table has root element missing.
    Has any body done this (insert xml into DB using pl/sql stored proc) successfully ?
    We can so this successfully if we do not use stored procedure and store data directly in table.
    Regards

    I have done this, stored it as a CLOB.
    Also I received the payload as an opaque schema, so I had to convert the message from binary into string.
    This way the root element doesn't get removed.
    cheers
    James

  • Item Type Based on PL/SQL stored proc causing errors

    I am getting the following error when I add this item type based on a pl/sql stored proc that generates html based on the stored proc... the stored proc returns find but the other porlets get Error Message in there headers and in the porlet content I get:
    Error: The listener returned the following Message: 503 Service Unavailable....
    I also get the same error if I click on a link that is generated from my stored proc for the entire page I get the error:
    Error: The listener returned the following Message: 503 Service Unavailable
    and get nothing else returned...

    Greetings
    I suggest you take a look at the following page and have a look on how to create portlets. Since the PL/SQL PDK allows you to create your own portlets inside the Oracle Database there should be no problem for creating the content inside a portlet the way you want it.
    http://www.oracle.com/technology/products/ias/portal/pdk.html
    Best regards
    Johan

Maybe you are looking for

  • How to Create a PDF Document and apply Digital Signature in C# using the Adobe SDK?

    Hi Everybody! I have to do two distinct tasks here: 1) How can I create a PDF document using the Adobe SDK in my .NET Applications(C# - 2.0)? I just need a basic sample to create a document with a simple text, for example. I did not find any useful i

  • Summation of column in Bex Report

    Hi All, I have a requirement where user wants to see that no. of Materials belongs to each vendor. And at the end of query user wants to see the over all count of material. I am able to get  no. of Materials belongs to each vendor but I am not able t

  • How to add a suffix to a number

    Hi everyone. I have a simple formula that sums the total ammount of cells. I would like the result to have a suffix, as for example the word "ITEMS" if the result of a formula is for example 25, I'd like it to show 25 ITEMS or whatever the word I wan

  • Apple TV works in colombia ?

    I am going there and i want a take with me

  • Switching Tabs in Safari

    Hello all, this is my first post. I'm sure you all can help me. I find that SHIFT + COMMAND + (L or R) BRACKET is a very uncomfortable and troublesome shortcut to switch tabs in Safari. I use the shortcut every day, and was wondering if it's possible