Open a Dynamic URL from a Table column link

Hi,
Jdev Version (11.1.1.6.0)
I have requirement to open a dynamic URL from table column. Any time I click on link, it should generate dynamic URL based on column attribute and open in popup or browser. Can someone pls suggest how to achieve this.
Thanks
Ank

1)If you have any parameters that needs to be passed to build that dynamicURL, just set a propertyListener on the column attribute and get the value.
2)Then on the af:commandLink action, build your dynamicURL with the required parameters.
3) If you URL is all together a different application which doesn't share your transaction, you can open it as below
In the below code, urlWithParams will be your dynamicURL.
ExtendedRenderKitService erks =
Service.getRenderKitService(facesContext, ExtendedRenderKitService.class);
StringBuilder sbURL = new StringBuilder();
sbURL.append("window.open(\"" + urlWithParams + "\");");
erks.addScript(facesContext, sbURL.toString());
You can also try the above response by user 948181.
Hope it helps.

Similar Messages

  • To open an external URL from your application

    Hello All,
    Please guide me in below scenario as I am new to SAP UI5.
    I have created a SHELL application with 5 tabs.
    We have a requirement where on clicking of a tab in the application it should open an external url. I am using "link" element of sap.ui.commons library. On press of link to action function I am using below code to open external url content.
    location.href = "http://google.com";  
    It is opening in the same tab but I have been navigated away from my application.
    As per the requirement external url content should be opened  without navigating away from my application.
    I am attaching the screenshot.
    Thanks
    Ansuman

    Hi Jagadeesh,
    See this code for reference.
    This is my view.
    sap.ui.jsview("demo.view1", {
           /** Specifies the Controller belonging to this View.
           * In the case that it is not implemented, or that "null" is returned, this View does not have a Controller.
           * @memberOf demo.view1
           getControllerName : function() {
                  return "demo.view1";
           /** Is initially called once after the Controller has been instantiated. It is the place where the UI is constructed.
           * Since the Controller is given to this method, its event handlers can be attached right away.
           * @memberOf demo.view1
           createContent : function(oController) {        
                         var btn1 = new sap.ui.commons.Button({
                               text: "This Is View One."
                         var link = new sap.ui.commons.Link({
                               text: "view3",
                          press : function() {                          
                                $("#frameId").slideDown();                                 
                         var iframe = new sap.ui.core.HTML("frameId",{
                          content : "<iframe src=" + 'http://www.jnvbuxaralumni.com' +" width='100%' height='700px'></iframe>",
                         var ele = [btn1, link, iframe];
                         return ele;         
    This is my controller.
    sap.ui.controller("demo.view1", {
           onAfterRendering: function() {
                  $("#frameId").hide();
    This is my index.html.
    <!DOCTYPE HTML>
    <html>
           <head>
                  <meta http-equiv="X-UA-Compatible" content="IE=edge">
                  <meta http-equiv='Content-Type' content='text/html;charset=UTF-8'/>
                  <script src="resources/sap-ui-core.js"
                               id="sap-ui-bootstrap"
                               data-sap-ui-libs="sap.ui.commons,sap.ui.ux3"
                               data-sap-ui-theme="sap_bluecrystal">
                  </script>
                  <!-- add sap.ui.table,sap.ui.ux3 and/or other libraries to 'data-sap-ui-libs' if required -->
                  <script>
                               sap.ui.localResources("demo");
                               //jQuery.sap.require("sap.ui.core.routing.Router");
                               //jQuery.sap.require("sap.ui.core.routing.HashChanger");
                               var oShell = sap.ui.ux3.Shell("shellId",{
                                      appTitle: "Shell Demo Program",
                                      showLogoutButton: false,
                                      showSearchTool: false,
                                      worksetItems: [
                                             new sap.ui.ux3.NavigationItem("homeId", {
                                                    key: "view1",
                                                    text: "Home"
                                             new sap.ui.ux3.NavigationItem("contactUsId", {
                                                    key: "view2",
                                                    text: "Contact Us"
                                      worksetItemSelected: function(e){
                                             this.removeAllContent();
                                             var selected = e.getParameter("key");
                                             var view = sap.ui.getCore().byId(selected);
                                             //console.log(selected);
                                             if( view == undefined){
                                                    view = new sap.ui.view({
                                                           id: selected,
                                                           viewName: "demo." + selected,
                                                           type: sap.ui.core.mvc.ViewType.JS
                                             this.addContent(view);
                                      content: [
                                                    new sap.ui.view({
                                                           id: "viewId1",
                                                           viewName: "demo.view1",
                                                           type: sap.ui.core.mvc.ViewType.JS
                               oShell.placeAt("content");
                  </script>
           </head>
           <body class="sapUiBody" role="application">
                  <div id="content"></div>
           </body>
    </html>
    Here you can see that on click of the link button i am able to display frame in same tab of shell.
    Let me know if it's helpful.
    Regards
    Dhananjay

  • Displaying data from multiple table/column

    hello ..
    anybody can help me how to diplaying data from multiple table/ column in PHP. TQ

    Follow the "How do I SELECT, INSERT, UPDATE and DELETE data from PHP?" example from http://wiki.oracle.com/page/PHP+Oracle+FAQ and change the "select ..." query to your favourite join, e.g.
    select country_name, region_name from countries, regions where countries.region_id = regions.region_id;

  • Opening an external URL from the Web UI

    Hello,
    I want to use the Web UI in order to open an external URL.
    I know it can be done easily using JavaScript, but the URL is generated from one of the page controller methods, and I want to open it directly from there.
    I know that there's the Window Manager in the Component Controller, that can open popup windows, but none of it's methods receive an external URL.
    So how can I open an external URL from the Web UI methods?
    Thanks,
    Udi.

    Hi,
    you can use the Trnsaction launcher with OP.
    in the window you create an OP_X
    with the code
      data: lv_navigation type ref to     if_crm_ui_navigation_service.
      lv_navigation = cl_crm_ui_navigation_service=>get_instance( me ).
      lv_navigation->navigate( iv_link_id = 'ZTO_X' ). "runtime you create the TO_X nevigation"
    in your implamentation class of the view you add a preotected method OP_TO_X with the code
       data:
        lr_window type ref to cl_bsp_wd_window.
      lr_window = me->view_manager->get_window_controller( ).
      lr_window->call_outbound_plug( iv_outbound_plug = 'TO_X'
                                     iv_data_collection = iv_data_collection ).
    and you call to that method from the EVENT_HANDLER you want.
    Amit.

  • Firefox 3.6 does not open onto my desktop from the dock when links in email or other files are opened. I have eMac with system 10.4.11 in English

    Firefox 3.6 does not open onto my desktop from the dock when links in email or other files are opened, use to. I have eMac with system 10.4.11 in English
    Thanks, Claude Combs
    [email protected]

    Firefox 3.6 does not open onto my desktop from the dock when links in email or other files are opened, use to. I have eMac with system 10.4.11 in English
    Thanks, Claude Combs
    [email protected]

  • Dynamic forms from 2 tables

    Hi, (Sorry for the long post)
    DB Table one contains 4 fields:
    EventName
    Venue
    Price
    Date
    Form one is used by the owner to enter the data for an event into the DB Table One - there are several different events.
    DB Table two contains 7 fields (4 of the fields to retrieve data from table one)
    Name
    contact
    email
    Event Name
    Venue
    Price
    Date
    Form two is for a person registering for one of the events entered into DB table one.
    I set up a recordset called rsListEvents and then used the "Insert Record Form Wizard" to create form two with the following fields:
    EventName
    Venue
    Price
    eDate
    which I set to defaults
    {rsListEvents.EventName}
    {rsListEvents.Venue}
    {rsListEvents.Price}
    {rsListEvents.eDate}
    I have a page listing the events and when register for this event is clicked I was hoping the data from table one would be entered into form two and the user then fills in the rest manually where all the data is entered into DB table two.
    Unfortunately even though the URL indicates that the correct information from table one should be entered into form two .php?id_event=2
    The data from DB table one row id_event=1 is always displayed no matter what the record number is.
    Can anyone tell me where I have gone wrong
    Thanks
    laurence

    I am simplyfing this so I can get help on a basic level ( Mr basic)
    Why does this not work?
    I set up a Dynamic List using DB Table 1 and set the detailed page.
    I set up a record set on the detailed page using the same table.
    SELECT *
    FROM addEvents
    When I test I get the results from ID 1 no matter which one I choose. But when I test the RS I get both dummy entries 1 and 2
    So I am missing something that needs to be appended to the URL.
    L

  • Query to read XML from CLOB table column

    Hi
    I want an SQL to get the following information extract from a CLOB table column.
    MasterReport/sg:RptDef/sg:RptCell@RealDesc MasterReport/sg:RptDef/sg:RptCell@RealNum
    credits                              100
    debits                              100
    Sample XML data from table column is:
    <?xml version="1.0" encoding="UTF-8" ?>
    <MasterReport xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:sg="http://www.oracle.com/fsg/2002-03-20/" xsi:schemaLocation="http://www.oracle.com/2002-03-20/fsg.xsd">
    <sg:LDGName>Vision Portugal</sg:LDGName>
    <sg:SOBName>Vision Portugal</sg:SOBName>
    <sg:DataAccessSetName>Vision Portugal</sg:DataAccessSetName>
    <sg:InternalReportName>Model 30 Report</sg:InternalReportName>
    <sg:CustomParam10 />
    <sg:RowContext RowId="r100001">
    <sg:RowName />
    <sg:RowLineItem>Litigation Credits- Total amount from previous period</sg:RowLineItem>
    <sg:RowDispUnit>1</sg:RowDispUnit>
    <sg:RowDispFormat />
    <sg:RowUnitOfMeasure>EUR</sg:RowUnitOfMeasure>
    <sg:RowLedgerCurrency>ANY</sg:RowLedgerCurrency>
    <sg:RowCurrencyType>T</sg:RowCurrencyType>
    <sg:RowChangeSign>0</sg:RowChangeSign>
    <sg:RowSeq>1.0000000000000</sg:RowSeq>
    </sg:RowContext>
    <sg:RowContext RowId="r100002">
    <sg:RowName />
    <sg:RowLineItem>Litigation credits- Taxed amounts from column2 for Previous period</sg:RowLineItem>
    <sg:RowDispUnit>1</sg:RowDispUnit>
    <sg:RowDispFormat />
    <sg:RowUnitOfMeasure>EUR</sg:RowUnitOfMeasure>
    <sg:RowLedgerCurrency>ANY</sg:RowLedgerCurrency>
    <sg:RowCurrencyType>T</sg:RowCurrencyType>
    <sg:RowChangeSign>0</sg:RowChangeSign>
    <sg:RowSeq>2.0000000000000</sg:RowSeq>
    </sg:RowContext>
    <sg:ColContext ColId="c1000">
    <sg:ColAmountType />
    <sg:ColPeriod />
    <sg:ColPerOffset />
    <sg:ColChangeSign />
    <sg:ColPosition />
    <sg:ColSeq />
    <sg:ColWidth>100</sg:ColWidth>
    </sg:ColContext>
    <sg:ColContext ColId="c1001">
    <sg:ColName>Total</sg:ColName>
    <sg:ColDescr />
    <sg:ColDispUnit>1</sg:ColDispUnit>
    <sg:ColUnitOfMeasure>EUR</sg:ColUnitOfMeasure>
    <sg:ColLedgerCurrency>ANY</sg:ColLedgerCurrency>
    <sg:ColCurrencyType>T</sg:ColCurrencyType>
    <sg:ColDispFormat>999999999.99</sg:ColDispFormat>
    <sg:ColAmountType>YTD-Actual</sg:ColAmountType>
    <sg:ColPerOffset>0</sg:ColPerOffset>
    <sg:ColAmntId>14</sg:ColAmntId>
    <sg:ColParamId>-1</sg:ColParamId>
    <sg:ColType>A</sg:ColType>
    <sg:ColStyle>B</sg:ColStyle>
    <sg:ColPeriod>10-08</sg:ColPeriod>
    <sg:ColPeriodYear>2008</sg:ColPeriodYear>
    <sg:ColPeriodNum>11</sg:ColPeriodNum>
    <sg:ColPeriodStart>2008-10-01T00:00:00</sg:ColPeriodStart>
    <sg:ColPeriodEnd>2008-10-31T00:00:00</sg:ColPeriodEnd>
    <sg:ColChangeSign>0</sg:ColChangeSign>
    <sg:ColHeadLine1>Totals</sg:ColHeadLine1>
    <sg:ColHeadLine2 />
    <sg:ColHeadLine3 />
    <sg:ColHeadLine4 />
    <sg:ColHeadLine5 />
    <sg:ColHeadLine6 />
    <sg:ColHeadLine7 />
    <sg:ColHeadLine8 />
    <sg:ColHeadLine9 />
    <sg:ColPosition>99</sg:ColPosition>
    <sg:ColSeq>1.0000000000000</sg:ColSeq>
    <sg:ColWidth>14</sg:ColWidth>
    </sg:ColContext>
    <sg:RptDef RptId="p1001" RptDetName="Ledger=Vision PT (Vision Portugal)" RptPESegm="" RptPEVal="" RptTabLabel="Output 1 (Vision PT)">
    <sg:RptLine RptCnt="p1001" RowCnt="r100001" LineRowSeq="1.0000000000000" LinCnt="l100001">
    <sg:RptCell ColCnt="c1000" RealDesc="debits">debits</sg:RptCell>
    <sg:RptCell ColCnt="c1001" RealNum="100.000000">100.00</sg:RptCell>
    </sg:RptLine>
    <sg:RptLine RptCnt="p1001" RowCnt="r100002" LineRowSeq="2.0000000000000" LinCnt="l100002">
    <sg:RptCell ColCnt="c1000" RealDesc="creditsd">credits</sg:RptCell>
    <sg:RptCell ColCnt="c1001" RealNum="100.000000">100.00</sg:RptCell>
    </sg:RptLine>
    </sg:RptDef>
    <sg:TabCount>1</sg:TabCount>
    </MasterReport>
    Please help me.
    Regards
    Giri
    Edited by: user576087 on Mar 18, 2012 11:54 PM

    I'm not sure if you want the values from the attribute or the element, but this should give you a good start :
    SQL> alter session set nls_numeric_characters = ".,";
    Session altered
    SQL>
    SQL> select x.*
      2  from my_table t
      3     , xmltable(
      4         xmlnamespaces('http://www.oracle.com/fsg/2002-03-20/' as "sg")
      5       , '/MasterReport/sg:RptDef/sg:RptLine'
      6         passing xmltype(t.xmldoc)
      7         columns type    varchar2(30) path 'sg:RptCell[1]'
      8               , amount  number       path 'sg:RptCell[2]'
      9       ) x
    10  ;
    TYPE                               AMOUNT
    debits                                100
    credits                               100

  • Error while opening PDF file downloaded  from database Blob column

    Hi All,
    I am working on jdev 11.1.1.4.0.
    In my use-case I am using filedownload Actionlistner on a link to get the PDF file stored in the database in blob field. These files are being uploaded from other use-case in adf only.
    After getting the dialog box to open/save/cancel for the PDF file when i click on open then i am getting an error *'Adobe Reader could not open 'abc.pdf' because it is either not a supported file type*
    or because the file has been damaged (for example, it was sent as an email attachment and wasn't correctly docoded)' for some files , and to my surprise I am able to open some files.
    When I open these PDF files separately from desktop I am able to view the content of each and every file in adobe reader.
    I dont know where the problem exactly lies , while uploading/downloading the file . Any ideas/thoughts to resolve this issue?
    Thanks
    Kanika

    Thanks a lot Timo...!!!
    I checked the PDF file downloaded directly from the blob column in DB, there only it is corrupted so must be the problem in uploading the file. I am checking the code line by line,, but no problem in setting the file content type,size etc.
    Here is the code snippet ..
    byte[] buff;
    buff = new byte[(int)length]; -- Length is the file size
    int bytesRead = is.read(buff);
    for (int i = 0; bytesRead < buff.length; i++) {
    // int b = is.read();
    int b = is.read();
    if (b == -1)
    break;
    buff[i] = (byte)b;
    BlobDomain blobDomian = new BlobDomain((buff));
    TestVORow = (TestVORow Impl)TestVO.createRow();
    if(blobDomian != null) {
    TestVORow.setAttachment(blobDomian);
    am.getTransaction().commit();
    This seems to be Ok to me..the same issue, file is still corrupting.
    Any thoughts from your side ???
    Thanks
    Kanika
    The problem is resolved.
    Changes made are instead of
    InputStream is;
    used ... BufferedInputStream bis ;
    and after
    for (int i = 0; bytesRead < buff.length; i++) {
    // int b = bis.read();
    int b = bis.read();
    if (b == -1)
    break;
    buff[i] = (byte)b;
    bis.close(); // use this close bufferedInput Stream.
    Able to open each and every file now..Thanks for your suggestions Timo and Frank.
    Edited by: Kanika on Mar 6, 2012 3:15 AM

  • I need to make a spreadsheet based on info from specific table columns and headlines above those tab

    Hi all,
    A client of mine is requesting that I create a spreadsheet from a huge catalog that I am doing for him (this will also be done for all similar huge catalogs). The spreadsheet needs to pull information from some of the table columns, as well as the headline for each table. (This spreadsheet will then go out to some other people who will be putting this information into an online database/website for the client.) Let me be more specific and show you an example below.
    Information from InDesign Catalog:
    Tea Set
    Part #
    MFG #
    Description
    123-456
    654321
    Tea Cup
    789-010
    010987
    Saucer
    Here is how the Excel Spreadsheet needs to look:
    Part #
    MFG #
    Product Name
    Description
    Page #
    123-456
    654321
    Tea Set
    Tea Cup
    2
    789-010
    010987
    Tea Set
    Saucer
    2
    You have no idea how I have been pulling my hair out over this. Doing this manually will be a nightmare each time. My first thought was that I could assign specific cell styles to the columns (cells) and then create a TOC and then finangle with that - well, that didn't quite work, especially because of the headline I needed to pull into the spreadsheet as well. Is there ANY way I can get this information onto a spreadsheet? Knowing how wonderful InDesign is and all the tremendous capability it has, I am sure there IS a way and I just dont know how. Please PLEASE can someone point me in the right direction?
    Thank you very much in advance for your assistance:) Any help would be greatly appreciated.
    Christine

    Sorry for the delay.
    I am sure that this can somehow be done by making use of the styles. For example, when creating the TOC InDesign does a GREAT job of pulling in the styles (that are of course associated with the headlines and whatever needs to be included in the TOC) and associating them with the correct page numbers. I had experimented a little with creating specific paragraph styles and working these into the table and cell styles...then applying the Table Style to the table. I was halfway getting to where I wanted to be by creating a TOC that pulled in all of these styles and applied the corresponding page numbers (that I could somehow work into converting back into a table to then flow onto an Excel spreadsheet) but the wrench in the works was of course the Product Name. That said, I am VERY confident that this CAN be done somehow, by making use of the styles, using the same (or similar) methodology that is used to create the TOC. If only I were a pro at scripting...
    Well, it's great that you're certain and confident, but I think your confidence is misplaced.
    I had sort of hoped that running headers could be convinced to support this, but that doesn't seem to be true.
    I think you need to postprocess the data somehow. If I was doing this for real I'd probably export the document to IDML and have a seperate program read the IDML XML, find the product names and page numbers, and insert them in tables. Though...that might mess up the page numbers. And it'd be a lot of work.
    An much-faster-to-rapid-prototype solution is to have an indesign script go through the document and add in page numbers and the product names. Here's a rough prototype:
    var d,s,story,table,product,page,c2,c3,c5,i,j.k;
    d=app.activeDocument;
    s=d.stories;
    for (i=0; i<s.length; i++) {
        story = s[i];
        for (j=0; j<story.tables.length; j++) {
            table = story.tables[j];
            product = story.chara
    cters[table.storyOffset.index-2].paragraphs[0].contents;
            page = table.parent.parentPage.name;
            // $.writeln("This is table "+j+". Product name: "+product+" page "+page);
            c2=table.columns[1];
            c3=table.rows[0].columns.add(LocationOptions.AFTER, c2);
            c3.contents=product;
            c5=table.rows[0].columns.add();
            c5.contents=page;
    This doesn't handle the header rows in tables, but hopefully that's ok.
    It may get page numbers wrong on multipage tables. Probably it would be better to just use
    SpecialCharacters.AUTO_PAGE_NUMBER on the last full line (c5.contents=).
    It should also probably not just look back 2 characters from the start of the table to find the paragraph, but it's probably good enough.

  • Dynamically changing the Advance table column Header.

    Dear All,
    I want to change dynamically the Advance table column header.
    I tried the below code and its working process request,not in process form request when button pressing.
    Please suggest me.
             OAAdvancedTableBean tableBean =
                               (OAAdvancedTableBean)webBean.findIndexedChildRecursive("advanceTableRN");
                           if (tableBean != null) {
                           System.out.println("tableBean");
                               OAColumnBean columnBean =
                                   (OAColumnBean)tableBean.findIndexedChildRecursive("column3");
                               if (columnBean != null) {
                                   System.out.println("columnBean");
                                   OASortableHeaderBean colHeaderBean =
                                       (OASortableHeaderBean)columnBean.getColumnHeader();
                                   if (colHeaderBean != null) {
                                       System.out.println("colHeaderBean");
                                       colHeaderBean.setText("Segment3");

    You can try 2 options:
    1. Try to call pageContext.forwardImmediatlytoCurrentPage();
    2. Try yo set a vo attribute to the columnbean text property and set the vo attribute programmatically. (I have not tried this but I think it should work)
    Cheers
    AJ

  • ADF Image from BLOB Table Column

    Does anybody know how to show an image on a JSP page based on a Blob Column through ADF Binding ?
    I've seen a post which reference the use of <adf:render model="Row.image"/>. However this doesn't seem to work.
    Thanx

    Is there a way to put images based on BLOB table columns on a JSP Page using ADF/Struts/JSP, or not ?
    Does anybody have a clue ?
    Thanks

  • How to Open a New window from a List region Link, Please help

    I am trying to get a new full window( Not popup window) open from a list region link. The list region entry is an Image. I get the new page open, but it is not in new window, it is in the same window.
    I know I have to give the target = "_blank" somewhere. But In List region, I dont know where to add this.
    Please help
    George

    Yes, you are right Arun. That is more elegant way of
    doing it. Keep it up. thankx..
    Btw, why do you hate javascripts? Can you imagine the
    internet world without javascript (or ant scripting
    language)?yep i agree... but i try my best to avoid scripts.. as i had been workin around some japanese technologies... and there are three major mobile market players there... who has their own content type and all those devices never support javascript..
    more over i donno that... in all 3 yrs i have never used that ;-))

  • Call Javascript function to pass a id  from APEX report column link

    Hi,
    Can anyone help me, in a report column link i'm calling a function to pass an id and i want to onclick change a icon on that column based on the value on the column status of this table.
    Is this possible?

    Hi Ron,
    I am doing exaclty what you have suggested me but no luck. I started changing the DEMO_CUSTOMERS application to my requirements.The report is working fine and on the report I have created a page attribute to the Hyper linked column and linked that to the page 2 and assign that attribute with #JOBNUM#.
    I am able to pass that value on to form when I click on the JOBNUM. But the problem is I am not able to pass that value into the SQL query so that my query pulls 20+ columns on to the Form ( which is second page ).
    Small clarification... On the form region it is said FORM NAME and type is HTML is that is the way the APEX was designed or does it need to say region type as FORM.
    Thanks for your help in advance.
    Cheers,
    Krishna.

  • Passing parameter from interactive report column link to new page

    I'm very simply trying to pass the value of the column link to the where clause on the next page.
    Interactive Report on P2 has column link fid alias in sql query.
    I read somewhere to refer prefix the interactive report column with IR ??
    So I have item name P2_FID, value #FID#. Anyway, I've tried a kazillion things.
    Created a hidden item with same source value... sigh.
    Is there a syntax to refer to a report column link, rather than an item_id in a region where clause?
    Is there a simple direct way to do this?
    Thanks,
    Pamela
    -----pls/apex/f?p=163:1:2746459963336955::NO::P2_FID:119

    Thank you Varad...
    Unfortunately, I am still getting no data found. (and there IS data).
    a) Do you mean in the link column section of the report attributes? that is done: item 1 name= IR_P2_FID, value = #FID#
    b) Do you mean my changing my hidden page item to ir_p2_fid with its source value as #FID# ? also done.
    Do I need this hidden item?, and if not how do I refer to link in the where clause of the called page's sql region?
    3) Where Fishery_id = :IR_P2_FID
    Where Fishery_id = &IR_P2_FID
    Thanks again!
    Pamela

  • How to dynamically get default value from a table column

    Hi all,
    Here's my problem: Our front end application sends insert and update queries to a pl/sql package. I've got a procedure that gets a PL/SQL table with all the column names an values, a table-name and a primary key name and value. That procedure creates an insert or update statement. So far, so good.
    Now the problem: our front end doesn't know what the default value for a column is. So when a number field doesn't get a value in the front-end, it's inserted with a value '0' though is should ben NULL. My sollution for this is to know the default value of a column: when there's a default of '0', then the value that will be inserted is '0'. When there's no default value and the column can ben NULL, it'll be inserted as NULL. if the column has a not null constraint, a '0' will be inserted.
    Ofcourse I can get the default value from the system-views all_tab_columns or user_tab_columns, but our application is installed at some 100 clients, and has various database installations. Most of the times, the tables are in the same schema as our procedure that performs the insert or update, but sometimes some of the tables are in another schema (in the same database) and also sometimes some tables are stored in another database. In all these situations, a synonym for that table exists in the schema.
    Is there a api function or procedure that I can call to get the default value of a column? I looked at dbms_sql and dbms_metadata, but those packages don't give me that perticular information. if not, I'll stuck with the 'does table exists in schema' yes->use table, no query user_synonyms to look for the owner of the table (and database link) and query all_tab_columns to get the default value. Only this seems a bit overkill to me.
    I hope I'm clear enough? And please don't reply with "don't do inserts this way"! I know, this is not the most optimal sollution, but it does gives us a couple of advantages in our application...

    there is no way that I can think of, apart from what you have already discovered (i.e. views), where you can determine if a column has a defuault value defined against it.
    The other option is triggers, but I guess doing that across 600 tables would not be an option, and besides I stay clear of triggers.
    A different approach therefore, if you cannot pre-determine the data, is to consider a post problem handler, hence I suggested the use of an exception handler.
    The exception handler works regardless of whether the statement is dynamic or not.
    SQL> truncate table abc;
    Table truncated.
    SQL>
    SQL> declare
      2    NULLVAL exception;
      3    pragma exception_init(NULLVAL, -01400);
      4 
      5  begin
      6 
      7    begin
      8 
      9      execute immediate 'insert into abc (y) values (1)';
    10 
    11      exception
    12        when NULLVAL then
    13          -- handle the error
    14          execute immediate 'insert into abc (x,y) values (0,1)';
    15 
    16    end;
    17 
    18    commit;
    19   
    20  end;
    21  /
    PL/SQL procedure successfully completed.
    SQL>
    SQL> select * from abc;
             X          Y
             0          1

Maybe you are looking for

  • Batch Split in BAPI_PO_CREATE1

    Hi Experts, I have a requirement to create Purchase order from DESADV - DELVRY03 basic type idoc.Now in the file at line item the material will be batch splitted. ex: POSNR    MATNR      QTY 10             NC3337     0 900001     NC3337     50 900002

  • [svn] 1013: Bug: LCDS-180 - [WebLogic 10.1 on Suse9] MxUnit Dynamic destination "SecurityEmployeeUser" test fails with a NullPointerException

    Revision: 1013 Author: [email protected] Date: 2008-03-28 17:24:25 -0700 (Fri, 28 Mar 2008) Log Message: Bug: LCDS-180 - [WebLogic 10.1 on Suse9] MxUnit Dynamic destination "SecurityEmployeeUser" test fails with a NullPointerException QA: Yes Doc: No

  • Contact names not displaying during calls, but only in logs

    Many names in the address book not showing up Hence, when i get a call or make one, the name doesnt come up with the number after the call, the number with the name is visible in call log as outgoing or incoming or missed in the database details it s

  • Billing Invoice post diffferent account configuration

    Dear All, I'm new on SAP, i have to configure billing invoice so that when release to accouting it is post to account that depend on valuation class. let say it is material with vluation class A i want it is post to A revenue if MAterial with valuati

  • IPhoto 4.0.3 Strange problem

    Been running iphoto 4.0.3 problem free since mid 2005. Now it seems to have a bug of some sort. A number of my Albums are not showing the correct photo when in 'Organize' mode. The photo's are from other albums and a few don't show the full image-bot