In Memory BCP from Bean to Sybase table

I am looking for an example of how to bcp data to a sybase table from within a bean. I know it is possible to do so from within a C++ program, so I'm hoping the same is true when using EJB's. Bear in mind that I am not a Java developer, I am a Sybase DBA, but need this info to provide an example to our developers for my recommended approach. We do not want to have to write the hundreds of rows to a file and then invoke the bcp binary, we want to do it directly from memory. We will accumulate the rows to be inserted, then we want to bcp directly.
Is there a function, method, or something that someone can show me, or if not a sample, then maybe just the correct syntax format?
Thanks in advance!

You probably can invoke bcp from an EJB, you can just put a method in the bean that executes bcp using Runtime.exec(...). However, this isn't really the sort of thing EJB's were invented for, I would probably write an RMI service to do it then bind that to JNDI so that I could access it in the same fashion as I would a bean.

Similar Messages

  • Importing table dump from oracle into sybase

    I was wondering if anyone has ever imported a table dump from oracle into sybase. I just tried it and it didn't work. I used TOAD to create my table dump file but when i imprted it into sybase using bcp in i got the following error
    cs_convert: cslib user api layer: common library error: The result is truncated because the conversion/operation resulted in overflow.
    CSLIB Message: - L0/O0/S0/N36/1/0:

    If you are looking for a basic/standard way to exchange data between Oracle and Sybase, use the CSV format.
    It is trivial to write a generic SQL*Plus script for Oracle to extract data from a table (or a SELECT) and spool this into a properly formatted CSV file.
    It is also just as easy to use Sybase Bulk Copy utility to load that CSV file into Sybase.
    There are also alternative methods. One would be to use Oracle's Heterogeneous Services. You can define a database link in Oracle that connects, via ODBC, to Sybase. And using this database link you can push (insert) data into Sybase.

  • Bcp txt file into Sybase

    I wonder how to bcp a txt file into sybase, what is the method I need and syntax. i know it is poss using dos commands but not sure what to do in java program. can anyone please help? many thanks

    Dave,thanks for the suggestion. I am having a lot of trouble , and if that code works for you, then it must be my connection string.
    I am trying
    import java.io.*;
    public class rabbit5{
    public static void main (String[] args) {
    String bcp_command ="bcp [maindatabase].[databaseowner].[table-to-populate] in [file - in] -I -Sserver -Uuser -Ppassword >stdout_ylogfile 2>std_error_file";
    try{
    String[]cmd = {"cmd.exe","/C",bcp_command };
    Process p = Runtime.getRuntime().exec(cmd);
    p.waitFor();
    catch(Exception i){   
    System.out.println("this has not bcp'd");
    But I get a variety of errors; from not being able to find my database, to not being able to find my server - in that order as well!! All to do with my bcp_command string
    You have been very helpful, but I think I need an example of a working string. please??
    many thanks
    Kevin

  • Htmlb:get the values from bean n display it in textView

    Hi,
    I am doing one PDK application using jspdyn page. In jsp page I am using htmlb to display the table. In that I am using one text view element. There I need to get the values from bean class.And display it in a table.
    Can anyone help me how can use the textView inside htmlb to retrieve the values from bean.
    Thanks & Regards
    Vineela

    hi vineela,
    For the textView, in the text value write the code  <%=myBean.getStr()%>
    where myBean will be your bean class and getStr() is the method in the bean class whcih returns value which needs to be displayed on the screen.
    Thanks
    Harsimran

  • Htmlb:Retrive values from bean n display it in textView

    Hi,
    I am doing one PDK application using jspdyn page. In jsp page I am using htmlb to display the table. In that I am using one text view element. There I need to get the values from bean class.And display it in a table.
    Can anyone help me how can use the textView inside htmlb to retrieve the values from bean.
    Thanks & Regards
    Vineela

    hi vineela,
    check this
    https://www.avispublics.com/irj/portalapps/com.sap.portal.pdk.htmlb.htmlbmanuals/docs/dynpage-01.html
    https://ww2.avispublicsduparisien.com/irj/portalapps/com.sap.portal.pdk.htmlb.htmlbmanuals/docs/tableview-01.html
    bvr
    Edited by: bvr on Mar 4, 2009 12:06 PM

  • How to select data from a PL/SQL table

    Hi,
    I am selecting data from database after doing some screening i want to store it in a PL/SQL table (temporary area) and pass it to oracle reports.
    Is there any way to select the data from a PL/SQL table as a cursor. Or is there any other way of holding the temporary data and then pass it back as a cursor.
    Regards
    Kamal

    A PL/SQL "table" is anything but a table. Whoever came up with this term in PL/SQL to describe what is known as dynamic arrays (the correct programming terminology that existed since the 70's if not earlier and what is used in all other programming languages I'm familiar with)... well, several descriptions come to mind and none of them are complimentary.
    You cannot "select" from a PL/SQL dynamic array as it is not a table within the Oracle context of tables.
    Thus you need to convert (cast) a PL/SQL dynamic array into a temporary Oracle data set/table in order to select from it. This is in general a Bad Idea (tm). Oracle tables and SQL and concurrency controls and all that are especially designed for processing data. PL/SQL arrays is a very simplistic data structure with very limited usage. Why would you want to use that in SQL via a SELECT statement when you can use Oracle tables (or proper temp tables) instead? Besides that, it is also slow to cast a dynamic PL/SQL array into an Oracle SQL data set structure (context switching, copying of memory, etc).
    The proper way to use PL/SQL to generate data sets for use via the SQL engine is pipelined table functions.
    This is not to say that you should never use PL/SQL arrays and casting in SQL.. simply that you need to make sure that this is the correct and scalable way to do it. And that will also always be an exception to the rule when you do.

  • How to use a Sybase table in Oracle SQL statement?

    How to use a Sybase table in Oracle SQL statement?
    Sybase version : 11.9.2.4
    Oracle version : 10.2.05
    Thanks.

    user12088323 wrote:
    How to use a Sybase table in Oracle SQL statement?
    Sybase version : 11.9.2.4
    Oracle version : 10.2.05
    Thanks.Any Oracle client connected to the Oracle database can access Sybase data through the <font style="background-color: #FFFFCC">Database Gateway for Sybase</font> (it requires an additional license) or the <font style="background-color: #FFFFCC">Database gateway for ODBC</font> (it's free).
    The Oracle client and the Oracle database can reside on different machines. The gateway accepts connections only from the Oracle database.
    A connection to the gateway is established through a database link when it is first used in an Oracle session. In this context, a connection refers to the connection between the Oracle database and the gateway. The connection remains established until the Oracle session ends. Another session or user can access the same database link and get a distinct connection to the gateway and Sybase database.
    Database links are active for the duration of a gateway session. If you want to close a database link during a session, you can do so with the ALTER SESSION statement.
    To access the Sybase server, you must create a <font style="background-color: #FFFFCC">database link</font>. A public database link is the most common of database links.
    SQL> CREATE PUBLIC DATABASE LINK dblink CONNECT TO
    2  "user" IDENTIFIED BY "password" USING 'tns_name_entry';
    --dblink is the complete database link name.
    --tns_name_entry specifies the Oracle Net connect descriptor specified in the tnsnames.ora file that identifies the gatewayAfter the database link is created you can verify the connection to the Sybase database, as follows:
    SQL> SELECT * FROM DUAL@dblink;
    Configuring Oracle Database Gateway for Sybase
    <font style="background-color: #FFFFCC">{message:id=10649126}</font>

  • BPM Workspace CSS error 'rowCssStyle' from bean of type fuego.workspace

    Hi,
    I'm consistently getting an error in BPM workspace when clicked on some of the custom views. The views are not loading and I get this error in the bottom part of the workspace. It’s related to workspace CSS , but we’ve not made any changes to CSS file.
    Have you encountered this problem?
    Unexpected Error
    javax.faces.el.EvaluationException: /jsf/view/viewPanelTemplate.xhtml @84,83 cssStyle="#{instance.rowCssStyle}": Error getting property 'rowCssStyle' from bean of type fuego.workspace.model.view.ViewTableInstanceBean: java.lang.NullPointerException
    at com.sun.facelets.el.LegacyValueBinding.getValue(LegacyValueBinding.java:60)
    at com.bea.opencontrols.XPControl.getPropertyValue(XPControl.java:312)
    at com.bea.opencontrols.XPControl.getPropertyValue(XPControl.java:285)
    at com.bea.opencontrols.XPControl.getPropertyValue(XPControl.java:273)
    at com.bea.opencontrols.table.Row.getCssStyle(Row.java:65)
    Any suggestions to clear this error is much appreciated.
    Cheers.

    In your weblogic console the application called -
    BPM Workspace would be in a Inactive or prepared state
    & worklist app wpuld be in an active state

  • Replicate the data from oracle to sybase

    Hi, I have to replicate the data of some of the tables from Oracle 10g to Sybase.
    Here the data from the table is live data (OLTP).
    Is there any process like materalized view so that data is refreshed from Oracle to Sybase periodically.
    Please let me know the Process for the same.

    Hello,
    as a starter you may want to read the following Metalink note:
    Note 283700.1: How to replicate Data between Oracle and a Foreign Datasource
    Please let me know whether this is helpful.
    Best regards
    Wolfgang Kobarg-Sachsse

  • TS1367 Will reinstalling the memory card from my MacBook pro erase my saved data?

    Will reinstalling the memory card from my MacBook pro erase my saved data?
    My MacBook pro that I purchased in mid 2010 has been having some issues lately.
    It's been running slow, which is very irregular since in 2010 I spent a lot of money to get the top of the line in every aspect. It's usually faster than fast and able to run multiple programs and browsers at a time.
    The other day it began to act up. I did the smc reset the pram reset and it still had been running vveerryy ssllooww. :(
    Now I was on it this morning and it was a bit unbalanced as I moved it to another table and it shut off completely. No sleep light, no response to the power button. It's just a dead hunk of junk. :( the only thing that gives me hope is that the battery life indicated is still working for some reason and it responds to the power adaptor when plugged in the light on the plug turns on as if the computer is acknowledging it.
    Please help me. For the first time ever I am about to take apart my precious MacBook pro, but I want to make sure I am aware of what I am doing before I do it. I have read the support guide instructions through a few times so far and I am curious if removing the memory and reinstalling it will erase anything?
    Is there hope?
    Also currently I am unable to get to an apple store/ genius bar any live person at a store until this weekend. I am trying to avoid taking it in for I, like everyone else, need my computer for school and work and don't have the time or gas money to drive to one since I'm not in a metro area. : S
    Please help!
    Thanks for your time.

    No, does not erase any data if you upgarede or reinstall RAM sticks.
    You'd better upgrade RAM to get better performance, I suppose.
    http://eshop.macsales.com/shop/memory/Apple_MacBook_MacBook_Pro/Upgrade/DDR3
    PS:Macbook Pro community is:
    https://discussions.apple.com/community/notebooks/macbook_pro

  • Can't load module: Out of memory or no room in system tables

    Hi,
    I had to install openSSH on Solaris 8. By default Solaris 8 doesn't have random devices. Moreover, that machine cannot be rebooted. Hence, I chose a patch which doesn't need a reboot if the random devices are created and the /kernel/drv/random module is force loaded.
    While force loading the module (modload /kernel/drv/random) I got the below error.
    " can't load module: Out of memory or no room in system tables "
    I have checked for the memory and there are no memory constraints. I need to force load the module.
    Could anyone help me out ?
    Thanx,
    Jaff

    I can see only 5 topics and all of them are very specific.
    Flash Install
    Live Upgrade
    Jumpstart
    Solaris Install from cd
    Solaris on x86
    Could you please suggest me the forum in which I need to post general help ?
    Thnx,
    Jaff

  • CMP Entity Beans and multiple tables

    Hi All,
    Is it possible to have a CMP Entity Bean retrieve attributes from multiple tables
    (using table join), and populate attributes from columns in both tables?
    If yes, how do we configure the same in configuration xml files.
    Is there any special handling required for this in the bean itself?
    Thanks,
    Prabh

    Hi All,
    Is it possible to have a CMP Entity Bean retrieve attributes from multiple tables
    (using table join), and populate attributes from columns in both tables?
    If yes, how do we configure the same in configuration xml files.
    Is there any special handling required for this in the bean itself?
    Thanks,
    Prabh

  • Accessing view object class (impl) method from bean (or vice versa)

    Halo everyone, I am using JDeveloper 11.1.2.1.0
    I have a UsersViewImpl class with a method which refresh the user table like below.
    public void resetEmployeeSearch() {
    removeApplyViewCriteriaName("viewCriteria");
    executeQuery();
    and I have a UserBean class with a method which reset the search fields values like below.
    public void resetInput(ActionEvent actionEvent) {
    ........RichInputText = input ...
    input.setValue("");
    AdfFacesContext.getCurrentInstance().addPartialTarget(searchForm);
    I would like to implement it in such a way that, once I press a button, both methods will be called.
    I have tried to call from bean method using UsersViewImpl vs = new UsersViewImpl ..... which is wrong and wont work.
    I have read about doing something like ViewObject vo = am.findViewObject("DeptView1") but I duno how to use it because I cant have a proper example.
    Any suggestion on accessing view object class (impl) method from bean (or vice versa)?
    Or is there any way to combine both method in the same class ?
    Thank you :(

    User, if you get class not found exceptions you need to tell us which classes you can't find. The JSFUtils and ADFUtils classes needing some other libraries which should already be part of your Fusion Web Application template (which your adf application should be based on). If you did not use this application template, you may have to add some libraries yourself.
    What is the diff of using the ADFUtils and OperationBinding way?
    The ADFUtils can get you access to the application module which you then use to call exposed methods on. The disadvantage of doing this is that you have to implement your own exception framework which then handles exceptions thrown by the application module. An other thing is that if you e.g. alter a VO which you use on the page this changes are not seen on the page until you refresh the page. The binding layer does not know about these changes so the iterators (which are used on the page to show the data) are not refreshed and so you don't see the changes.
    In general you should avoid using the application modul in a managed bean method and always use the binding layer (OperationBinding) to call methods. This ensures that exceptions are all handled the same way and that changes to the data model are reflected in the GUI.
    Timo

  • Migration of data from Oracle to Sybase ASIQ

    Hello !
    I want to know , if there is any way to migrate the database from oracle 8i to sybase ASIQ ( Adaptive Server IQ 12.4). The database has 14 tables in which some tables have more than 3 lakh records. I have tried to convert the tables into tab delimited text files ( by using ADO Explorer software) and then load data in ASIQ ( Adaptive Server IQ 12.4) from these flat files. The process is working fine with tables which have less data. But for large tables ( with 3 lakh records) the ADO explorer hangs in between conversion. Is there any tool in Oracle which can migrate data from tables to tab delimited text files ?
    or is there any tool which can directly migrate data from oracle 8i to Sybase ASIQ directly ?

    Can you use Sybase Component Integration Services (CIS). Can you create the Oracle database as a remote database and then do selects against the Oracle tables directly into the Sybase tables. I am not sure if this is available in IQ server. If not then if you have a regular Sybase server could you do it through there somehow and then move the database from Sybase to IQ.
    Frank...

  • Upload data from Excel to Internal table in ECC

    Hello SDN,
    Here I am facing a problem for uploading the data from excel sheet to internal table in ECC6.0
    Main problem is we don't have any FM ALSM_EXCEL_TO_INTERNAL_TABLE.
    Please provide me the solution how to upload the data from excel to internal table through class. If possible please provide me the sample code so that it will be very helpful for me.
    Waitingfor your valuable response.
    Thanks & Regards,
    Kumar.

    Hi,
    you can use OLE to acces (not only) excel, but this will only work in dialog processing.
    regards,
    Hans

Maybe you are looking for