Write to the database from a BI Publisher report

I have a requirement to setup a BI Publisher report that writes a snapshot of data to a database table whenever the report is run.
Putting aside whether doing this is a good idea or not (I'd prefer not to do it for security reasons) if I were to do it in SQL server (that i'm more familiar with) I'd write a stored procedure that does this and enter "exec storedprocedurename" as the report query.
From searching through this board I see that I'm supposed to use a pipelined function instead of a stored procedure but I'm unclear if once I have setup the pipelined function that I'll be able to achieve my objective of both returning the data to the report as well as writing it to a snapshot table, is this possible? If so then I have some questions as I don't really understand the syntax with my limited pl/sql knowledge.
create type numset_t as table of number; --where does this go, it doesn't appear to be part of the function?
create function f1(x number) return numset_t pipelined is
begin
for i in 1..x loop
pipe row(i);
end loop; -- do I need to do a looP? i just want to do select *...
return;
end;
select * from table(f1(3)); -- again this appears to be outside the function, where does it go?
Thanks
Bruce

Jorge:
I was looking into something similar some time ago. The suggested solution may or may not work for you, depending on what it is you want to write to the tables. I was trying to write audit information - who ran what report when. Through BI Publisher template variables I could get the who and the when, but not what report was being run, so the report trigger option wasn't of any use to me.
In the end, I opted to change the attributes of the report so that the "show controls" checkbox is unchecked and make users run all reports through BI Publisher Scheduler. It turns out that reports run via the scheduler have all of that data saved off and you can see it from the Schedules/History display.
Good luck,
Gaff

Similar Messages

  • Can multiple threads write to the database?

    I am a little confused from the statement in the documentation: "Berkeley DB Data Store does not support locking, and hence does not guarantee correct behavior if more than one thread of control is updating the database at a time."
    1. Can multiple threads write to the "Simple Data Store"?
    2. Considering the sample code below which writes to the DB using 5 threads - is there a possibility of data loss?
    3. If the code will cause data loss, will adding DB_INIT_LOCK and/or DB_INIT_TXN in DBENV->open make any difference?
    #include "stdafx.h"
    #include <stdio.h>
    #include <windows.h>
    #include <db.h>
    static DB *db = NULL;
    static DB_ENV *dbEnv = NULL;
    DWORD WINAPI th_write(LPVOID lpParam)
    DBT key, data;
    char key_buff[32], data_buff[32];
    DWORD i;
    printf("thread(%s) - start\n", lpParam);
    for (i = 0; i < 200; ++i)
    memset(&key, 0, sizeof(key));
    memset(&data, 0, sizeof(data));
    sprintf(key_buff, "K:%s", lpParam);
    sprintf(data_buff, "D:%s:%8d", lpParam, i);
    key.data = key_buff;
    key.size = strlen(key_buff);
    data.data = data_buff;
    data.size = strlen(data_buff);
    db->put(db, NULL, &key, &data, 0);
    Sleep(5);
    printf("thread(%s) - End\n", lpParam);
    return 0;
    int main()
    db_env_create(&dbEnv, 0);
    dbEnv->open(dbEnv, NULL, DB_CREATE | DB_INIT_MPOOL | DB_THREAD, 0);
    db_create(&db, dbEnv, 0);
    db->open(db, NULL, "test.db", NULL, DB_BTREE, DB_CREATE, 0);
    CreateThread(NULL, 0, th_write, "A", 0, 0);
    CreateThread(NULL, 0, th_write, "B", 0, 0);
    CreateThread(NULL, 0, th_write, "B", 0, 0);
    CreateThread(NULL, 0, th_write, "C", 0, 0);
    th_write("C");
    Sleep(2000);
    }

    Here some clarification about BDB Lock and Multi threads behavior
    Question 1. Can multiple threads write to the "Simple Data Store"?
    Answer 1.
    Please Refer to http://docs.oracle.com/cd/E17076_02/html/programmer_reference/intro_products.html
    A Data Store (DS) set up
    (so not using an environment or using one, but without any of the DB_INIT_LOCK, DB_INIT_TXN, DB_INIT_LOG environment regions related flags specified
    each corresponding to the appropriate subsystem, locking, transaction, logging)
    will not guard against data corruption due to accessing the same database page and overwriting the same records, corrupting the internal structure of the database etc.
    (note that in the case of the Btree, Hash and Recno access methods we lock at the database page level, only for the Queue access method we lock at record level)
    So,
    if You want to have multiple threads in the application writing concurrently or in parallel to the same database You need to use locking (and properly handle any potential deadlocks),
    otherwise You risk corrupting the data itself or the database (its internal structure).
    Of course , If You serialize at the application level the access to the database, so that no more one threads writes to the database at a time, there will be no need for locking.
    But obviously this is likely not the behavior You want.
    Hence, You need to use either a CDS (Concurrent Data Store) or TDS (Transactional Data Store) set up.
    See the table comparing the various set ups, here: http://docs.oracle.com/cd/E17076_02/html/programmer_reference/intro_products.html
    Berkeley DB Data Store
    The Berkeley DB Data Store product is an embeddable, high-performance data store. This product supports multiple concurrent threads of control, including multiple processes and multiple threads of control within a process. However, Berkeley DB Data Store does not support locking, and hence does not guarantee correct behavior if more than one thread of control is updating the database at a time. The Berkeley DB Data Store is intended for use in read-only applications or applications which can guarantee no more than one thread of control updates the database at a time.
    Berkeley DB Concurrent Data Store
    The Berkeley DB Concurrent Data Store product adds multiple-reader, single writer capabilities to the Berkeley DB Data Store product. This product provides built-in concurrency and locking feature. Berkeley DB Concurrent Data Store is intended for applications that need support for concurrent updates to a database that is largely used for reading.
    Berkeley DB Transactional Data Store
    The Berkeley DB Transactional Data Store product adds support for transactions and database recovery. Berkeley DB Transactional Data Store is intended for applications that require industrial-strength database services, including excellent performance under high-concurrency workloads of read and write operations, the ability to commit or roll back multiple changes to the database at a single instant, and the guarantee that in the event of a catastrophic system or hardware failure, all committed database changes are preserved.
    So, clearly DS is not a solution for this case, where multiple threads need to write simultaneously to the database.
    CDS (Concurrent Data Store) provides locking features, but only for multiple-reader/single-writer scenarios. You use CDS when you specify the DB_INIT_CDB flag when opening the BDB environment: http://docs.oracle.com/cd/E17076_02/html/api_reference/C/envopen.html#envopen_DB_INIT_CDB
    TDS (Transactional Data Store) provides locking features, adds complete ACID support for transactions and offers recoverability guarantees. You use TDS when you specify the DB_INIT_TXN and DB_INIT_LOG flags when opening the environment. To have locking support, you would need to also specify the DB_INIT_LOCK flag.
    Now, since the requirement is to have multiple writers (multi-threaded writes to the database),
    then TDS would be the way to go (CDS is useful only in single-writer scenarios, when there are no needs for recoverability).
    To Summarize
    The best way to have an understanding of what set up is needed, it is to answer the following questions:
    - What is the data access scenario? Is it multiple writer threads? Will the writers access the database simultaneously?
    - Are recoverability/data durability, atomicity of operations and data isolation important for the application? http://docs.oracle.com/cd/E17076_02/html/programmer_reference/transapp_why.html
    If the answers are yes, then TDS should be used, and the environment should be opened like this:
    dbEnv->open(dbEnv, ENV_HOME, DB_CREATE | DB_INIT_MPOOL | DB_INIT_LOCK | DB_INIT_TXN | DB_INIT_LOG | DB_RECOVER | DB_THREAD, 0);
    (where ENV_HOME is the filesystem directory where the BDB environment will be created)
    Question 2. Considering the sample code below which writes to the DB using 5 threads - is there a possibility of data loss?
    Answer 2.
    Definitely yes, You can see data loss and/or data corruption.
    You can check the behavior of your testcase in the following way
    1. Run your testcase
    2.After the program exits
    run db_verify to verify the database (db_verify -o test.db).
    You will likely see db_verify complaining, unless the thread scheduler on Windows weirdly starts each thread one after the other,
    IOW no two or ore threads write to the database at the same time -- kind of serializing the writes
    Question 3. If the code will cause data loss, will adding DB_INIT_LOCK and/or DB_INIT_TXN in DBENV->open make any difference?
    Answer 3.
    In Your case the TDS should be used, and the environment should be opened like this:
    dbEnv->open(dbEnv, ENV_HOME, DB_CREATE | DB_INIT_MPOOL | DB_INIT_LOCK | DB_INIT_TXN | DB_INIT_LOG | DB_RECOVER | DB_THREAD, 0);
    (where ENV_HOME is the filesystem directory where the BDB environment will be created)
    doing this You have proper deadlock handling in place and proper transaction usage
    so
    You are protected against potential data corruption/data loss.
    see http://docs.oracle.com/cd/E17076_02/html/gsg_txn/C/BerkeleyDB-Core-C-Txn.pdf
    Multi-threaded and Multi-process Applications
    DB is designed to support multi-threaded and multi-process applications, but their usage
    means you must pay careful attention to issues of concurrency. Transactions help your
    application's concurrency by providing various levels of isolation for your threads of control. In
    addition, DB provides mechanisms that allow you to detect and respond to deadlocks.
    Isolation means that database modifications made by one transaction will not normally be
    seen by readers from another transaction until the first commits its changes. Different threads
    use different transaction handles, so this mechanism is normally used to provide isolation
    between database operations performed by different threads.
    Note that DB supports different isolation levels. For example, you can configure your
    application to see uncommitted reads, which means that one transaction can see data that
    has been modified but not yet committed by another transaction. Doing this might mean
    your transaction reads data "dirtied" by another transaction, but which subsequently might
    change before that other transaction commits its changes. On the other hand, lowering your
    isolation requirements means that your application can experience improved throughput due
    to reduced lock contention.
    For more information on concurrency, on managing isolation levels, and on deadlock
    detection, see Concurrency (page 32).

  • How to reinstall the database components of BI Publisher (11.1.1.5)

    Hi,
    We're using BI Publisher 11.1.1.5 installed within an existing Weblogic 10.3.6 instance running on Oracle Linux 5.6.
    We installed it against an existing 10g test database.
    We decided to refresh the database from the production system and we had to rebuild the test db from scratch, meaning we lost all BIP components installed in it.
    We re-ran the BIP RCU to create the schemas but we can't see how we can reinstall the other required BIP database components without doing a full deinstall and then install of everything.
    The other required db components are such things as the bipcatalog java classes. These are not installed by the RCU from what it seems.
    We have another test database with the BIP components in it and I can see them there so we could export/import them if necessary, but I thought there must be a way to use an assistant or something to do it.
    Any ideas how to go about reinstalling just the db objects?
    Thanks,
    Dave

    I have found out what it was that needed loading into the database, it wasn't BI Publisher specific after all. It is the database callout utility and JPublisher classes, which are used when calling out to invoke web services. They're loaded using loadjava command into the database.

  • ORA-03113: Error while upgrading the Database from 11.1.0.6 to 11.1.0.7

    Hi,
    I am trying to upgrade the database from 11.1.0.6 to 11.1.0.7 on OEL operating system.
    After applying the patch "6890831" when trying to start the database using "Startup Upgrade" command I am getting the below error.
    ORA-03113: end-of-file on communication channel
    Process ID: 20826
    Session ID: 170 Serial number: 3
    I am getting the same error when trying to create the new database using "DBCA".
    Please provide me the probable outcomes.
    Thanks
    Amith

    Below entries found in alert_orcl.log file
    MMNL started with pid=15, OS id=20571
    starting up 1 shared server(s) ...
    ORACLE_BASE from environment = /u01/app/oracle
    Thu Dec 03 20:11:11 2009
    ALTER DATABASE MOUNT
    Errors in file /u01/app/oracle/diag/rdbms/orcl/orcl/trace/orcl_mman_20557.trc:
    ORA-27103: internal error
    Linux-x86_64 Error: 11: Resource temporarily unavailable
    Additional information: -1
    Additional information: 1
    MMAN (ospid: 20557): terminating the instance due to error 27103
    Instance terminated by MMAN, pid = 20557
    Below entries found in the Trace file generated
    error 27103 detected in background process
    ORA-27103: internal error
    Linux-x86_64 Error: 11: Resource temporarily unavailable
    Additional information: -1
    Additional information: 1
    *** 2009-12-03 20:11:14.727
    MMAN (ospid: 20557): terminating the instance due to error 27103

  • Upgrading the database from Oracle 8.0.6 to Oracle 9.2.0

    Dear SDN,
    We are in the process of upgrading SAP 4.6b to 4.7 R/3 Enterprise.
    Source Release:Windows 2000/Oracle 8.0.6/SAP 4.6b
    Target Release:Windows 2000/Oracle 9.2.0/SAP R/3 4.7
    Can anyone help us in explaining the procedure for upgrading the database from Oracle 8.0.6 to Oracle 9.2.0.
    Thanks n Regards ,
    Anantha Raman E.

    Thanks Mr.Mohan
        We tried to upgrade from 8.0.6 to 8.1.7 with the help of Inst Guides from service market place..the thing is we created another oracle home with new DBSID ither than the old DBSID...when we started the migration using 8.1.7 Data migration tool its not responding after the first phase CHECKING THE OLD DATABASE...
    Pls help us in this regard
    Whether we have to migrate or what...

  • How to upload files/images to the database from a form.

    I'm making a custom user profile form.
    The users can update their profile in this form.
    I cannot use the standard profile form, because the customer got very specific
    demands about the context of the profile form.
    In this custom profile form the user must be able to upload an image
    from their hard disk(just like in the standard profile form).
    I've got the following questions about uploading pictures:
    - How do I make a button to show the explorer window.
    - how do I get the chooses file-name in a field.
    - how do I get the new file in the database.
    - how do I get rid of an old file in the database.
    - how do I get the image on the form.
    Or is there a special portal way to upload images/files in a form.
    Does anyone have a clue?
    regards
    arny

    Hi,
    Regular Portal forms will support upload of images/documents to the database. Just identify your column as a blob, and the 'Browse' button will automatically show up in the form and the users will get to choose the file they want to upload from their desktop.
    The thing is, I haven't been able to figure out how to get that document/image back out of the database (e.g. in a report), once it's put in. Maybe someone else can answer that.

  • Migration of the database from Microsoft SQL 2014 Express to Microsoft SQL 2012 Server

    I posted a similar thread yesterday, and I realized that there was a serious typo.
    Link: https://social.msdn.microsoft.com/Forums/sqlserver/en-US/b3e201ea-6c7c-43a4-8908-842b714ea451/migration-of-the-database-from-microsoft-sql-2014-express-to-microsoft-sql-2012-server?forum=sqlservermigration
    Therefore, I made a decision to post another thread right now.
    I am
    writing to ask if there are any known issues when migration from MS SQL 2014 Express to MS SQL 2012 Server version. Are there any step-by-step instruction on how I can go about doing this?
    Looking forward to your response. Thank you for your time.
    Regards,
    Jeff Yoo 

    Hello,
    SQL Server 2012 setup program won’t allow you to perform a downgrade from SQL Server 2014 Express Edition. Backup/Restore
    and Detach/Attach won’t help you either.
    One option you have left is using SQL Server Import/Export Wizard as explained on the following article.
    http://www.mytechmantra.com/LearnSQLServer/Downgrade_SQL_Server_Database_P1.html
    Hope this helps.
    Regards,
    Alberto Morillo
    SQLCoffee.com

  • Resore the database from Tape to a new directory

    Hi
    can i use rman to resore the database from Tape to a new directory (not the database directories)
    is that will work
    run{
    allocate channel.....
    restore database to 'path';}
    Thanks for any contribution

    This will not work.
    You need to code
    set newname
    commands in your rman script.
    The syntax is
    set newname <filenumber> to '<filename>'
    As far as I recall this is a scenario which is documented in the RMAN documentation for your unknown version of the database.
    Sybrand Bakker
    Senior Oracle DBA

  • How to startup the database from pfile?

    Hi guys.
    hope all of you fine.
    how to startup the database from pfile?
    Thanks.

    You can create pfile from spfile
    SQL>create pfile='/tmp/pfile.ora' from spfile;
    then
    SQL>startup pfile='/tmp/pfile.ora';
    You can edit pfile.ora file and startup your database with this newly changed database parameter using pfile
    And you can define you're using pfile or spfile by issuing:
    SQL> show parameter spfile;

  • When connect the Database from Toad , Sqlplus giving the error

    when connect the Database from Toad , Sqlplus giving the error
    recent changes 12.1.1 installatiojn
    Oracle SQL plus encountered a problem and needs to close we are sorry for convenienvce
    Oracle Forms Designner has encountered a probloem and needs to close we are sorry for the convenience
    Thanks & Regards,
    sree

    when connect the Database from Toad , Sqlplus giving the error recent changes 12.1.1 installatiojnHave you tried using the same user via simple sqlplus on the database server or apps tier server itself? Please try the same database user/login on the database server using the sqlplus available on the server itself. See what message do you get. If the the login happens, then try with the tns entry e.g. sqlplus username/password@prod and see if that works on the db server. If both of these conditions work the check where is Toad picking up the tns entry from on the client pc/laptop. If first test fails, then check if the account is locked.
    Hope this helps.

  • Can i insert data in my database from a web intelligence report?

    if that's not possible,can I do it from a stored procedure based Universe or with a derived table? Does BusinessObjects in general allow me to execute statements to insert data in my database?

    Hi Erika,
    afaik it is not possible write back to database from web intelligence .
    from dashboards with web services you can achieve this.

  • The database logon information for this report is either incomplete or inco

    getting below error while opening a report from infoview
    The database logon information for this report is either incomplete or incorrect.
    Unable to retrieve Object.
    The database logon information for this report is either incomplete or incorrect.
    They can open the same report from crystal designer.We have checked the database and it is pointing to correct one in process->database of CMC.
    They have created the report with windows NT credentials.
    Can any one help in this regard.
    Thanks,
    Gokul.

    How did you set up NT auth on the report? With CR Designer I'd assume you are using a trusted connection? Which option did you choose in the CMC for DB credentials? Prompt, same login, or SSO (I don't have the CMC screen in front of me right now so I'm abbreviating the options)?
    Regards,
    Tim

  • The database logon information for this report is either incomplete

    Hello All
    I have installed a full licensed version of crystal reports server 2008 onto a windows server 2003 virtual server.
    I am getting the following error message when trying to run some reports when i am logged in as the adminstrator
    'The database logon information for this report is either incomplete or incorrect.'
    Some reports work and some dont, I use the same login information for all reports, same username and same password, same machine datasource and all the reports  run fine in crystal designer 2008
    The only difference i can see is that the error mainly occurs with reports that use stored procedures, the ones that dont work fine.
    I not sure how to resolve this problem as i have tested the login and the datasoure and it works fine, just not through crystal reports server

    Further to this i've realized that this only happens with reports which have been updated to use a stored procedure from a query file. And the reports dont use any repository objects

  • The database logon information for this report is either incomplete or incorrect

    Post Author: mchishty
    CA Forum: Authentication
    We have published a crystal report (XI) to InfoView (XI R2 SP2) and we are getting the following error for the database login.
    "The database logon information for this report is either incomplete or incorrect."
    The report is working fine in Crystal Reports XI.
    The report is using the OLE DB connection to ORACLE.
    The same server is running WebI reports against the same ORACLE DB. Thanks

    Hi,
    We configure DSN with windows authentication and report in CMC has the configuration information like this
    Server Name: Populated
    Database: populated
    User: Empty
    Password: Empty
    For the report to run, do we have 6400 to 6490 ports open?
    we have port 1433 open between database and CR server but not the 6400 - 6490 ports open?
    Thanks in advance

  • The migrated Crystal Report throws "The database logon information for this report is either incomplete or incorrect" error

    [ENVIRONMENT]
    Product version - BI4.1 SP03
    OS - Windows 2008 R2
    CMS Database - Oracle 11g
    Java Application Server - Tomcat7
    [ISSUE]
    Using the Upgrade Management Tool to completely migrate a BOXI3.1 SP3+FP3.6 to BI4.1 SP03.  The reporting database from both BOXI3.1 and BI4.1 are the same and so is the database logon credential.
    When viewing and refresh a migrated Crystal Report, it throws "The viewer could not process an event. The database logon information for this report is either incomplete or incorrect. [] ---- Error code:0 [CRWEB00000119]" error in both BI Launchpad and "The database logon information for this report is either incomplete or incorrect" in scheduled job.
    [STEPS TAKEN]
    - Update the Database Configuration with the SAME Oracle database password in CMC and "The database logon information for this report is either incomplete or incorrect" issue goes away.
    I search the SAP SMP and SCN forum and found no reference on this UMT and Crystal Report database logon problem.  Hope any of you have seen this problem and share if there is an ADAPT for it.
    Thank you in advance,
    Jin-Chong

    Hi,
    The BI4.1 SP03 server and client and Crystal Report 2013 SP03 developer and Crystal Report for Enterprise 4.1 SP03 are all installed onto this Windows 2008 R2 server.
    I am able to open the migrated report from CMS repository in Crystal Report 2013 SP03 developer and am able to refresh it with database logon password provided.  After save it back to the Enterprise, the database logon password field for this report in CMC becomes empty so that I have to enter the database password and choose "Use same database logon as when report is run" when viewing and scheduling report.
    What is interesting to me is that the UMT seems to migrate the report along the database logon password because I can see the encrypted password in the report database logon property in CMC.  The workaround is to reenter the database logon password in the report database logon property in CMC.
    With this said, there are hundreds of the Crystal reports and the workaround would consume lots of manual work by update each report's database logon password in CMC.
    For other customers who have more crystal reports, I wonder if there is an automated way to update the crystal report's database logon password on BI4.1 or if this is an isolated incident on my new BI4.1 SP03 environment.
    I run UMT in command line to perform livetolive migration, and my steps are listed below
    cd "E:\Program Files (x86)\SAP BusinessObjects\SAP BusinessObjects Enterprise XI 4.0\java\apps\upgradeManagementTool\jars\"
    "E:\Program Files (x86)\SAP BusinessObjects\SAP BusinessObjects Enterprise XI 4.0\win64_x64\sapjvm\bin\javaw.exe" -Xmx56g -Djava.library.path="..\..\..\..\win64_x64" -jar upgrademanagementtool.jar -internal_use_only_noversioncheck -responsefile LIVETOLIVEResponseFile.txt
    LIVETOLIVEResponseFile.txt:
    mode=livetolive
    source=edhc01nwapp65:6400
    sourceusername=Administrator
    sourcepassword=xxxxxxxxxx
    destination=WAPP246N:6400
    destinationusername=Administrator
    destinationpassword=xxxxxxxxxx
    logfile=E:\temp\livetolive.csv
    configparam:base_url=https://boprod.bsc.bscal.com/dswsbobje
    locale=en_US
    Regards,
    Jin-Chong

Maybe you are looking for

  • Palm Desktop Calendar Crash

    Moving in the Month view from one month to the next the desktop 6.2.2 crashes with the message:  "The instruction at '0x6740d95e' referenced memory at '0x00000009' The memory could not be read"  The choice then to cancel or debug with both just closi

  • How do I sync all my icloud accounts onto one, more specifically I'm trying to access all my music from all my devices

    I have multiple Apple devices, Desktops, laptops, iPad, iPhones, etc.  I somehow was able to sync the desktop at my vacation home with iColoud where I stored not only all the music I purchased through iTunes, but my entire CD collection.  I have sinc

  • Why do I have to update Keynote,Numbers,and Pages on a daily basis?

    For the past week I've had to update Keynote, Numbers, and Pages on a daily basis?If I update the apps today, tomorrow I will be asked to update them again.Something is wrong with picture. Is anyone else having this issue?

  • Photos- Slideshow

    I want to use the ipad as a digital picture frame- I currently have 40 pictures loaded in an album in my slideshow using the photo app. However, once the 40 pictures cycle once, the slideshow stops, it there a way to make this continuously run until

  • Query on Integration process

    I want to know the functions of each steps we using while creating an Integration Process in IR.