Oracle-PHP PL/SQL Problem

Dear,
I have this situation:
Inside PHP I call this statement:
$usr_stmt = oci_parse($conn, "begin PKG_USERBEHEER_TEST.user_insert(PKG_USERBEHEER_TEST.user_create_type(:usr_id,:usr_naam,:usr_vnaam,:usr_email,:usr_pass,SYSDATE,NULL),:p_exusr_id); end;");
binding the variables
oci_bind_by_name($usr_stmt, ':usr_id', $USR_ID);
oci_bind_by_name($usr_stmt, ':usr_naam', $USR_NAAM);
oci_bind_by_name($usr_stmt, ':usr_vnaam', $USR_VNAAM);
oci_bind_by_name($usr_stmt, ':usr_pass', $USR_PASS);
oci_bind_by_name($usr_stmt, ':usr_email', $USR_EMAIL);
oci_bind_by_name($usr_stmt, ':p_exusr_id', $EXEC);
INSIDE MY PACKAGE:
FUNCTION user_create_type(usr_id users.usr_id%TYPE, usr_naam users.usr_naam%TYPE, usr_vnaam users.usr_vnaam%TYPE, usr_email users.usr_email%TYPE, usr_pass users.usr_pass%TYPE, usr_start_datum users.usr_pass%TYPE, usr_eind_datum users.usr_eind_datum%TYPE) return user_rec is
v_rec user_rec;
Begin
v_rec.usr_id := usr_id;
v_rec.usr_naam := usr_naam ;
v_rec.usr_vnaam:=usr_vnaam;
v_rec.usr_email:=usr_email;
v_rec.usr_pass :=usr_pass;
v_rec.usr_start_datum := usr_start_datum;
v_rec.usr_eind_datum := usr_eind_datum;
return v_rec;
end user_create_type;
PROCEDURE user_insert(r IN OUT user_rec, p_exusr_id IN users.usr_id%TYPE) IS
BEGIN
--check if allowed
IF(NOT checkallowedactions(p_exusr_id, 117)) THEN
raise_application_error(-20999, 'User is not allowed executing this action');
END IF;
--end check if allowed
SELECT seq_users.nextval
INTO r.usr_id
FROM dual;
SELECT sysdate
INTO r.usr_start_datum
FROM dual;
INSERT
INTO users(usr_id, usr_naam, usr_vnaam, usr_email, usr_pass, usr_start_datum)
VALUES(r.usr_id, r.usr_naam, r.usr_vnaam, r.usr_email, cryptit.encrypt(r.usr_pass), r.usr_start_datum);
END user_insert;
When I excecute my statement I get this error:
Warning: oci_execute() [function.oci-execute]: ORA-06550: line 1, column 39: PLS-00363: expression 'PKG_USERBEHEER_TEST.USER_CREATE_TYPE' cannot be used as an assignment target ORA-06550: line 1, column 7: PL/SQL: Statement ignored in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\add_user.php on line 22
But I need the out parameter, because I need my generated ID (Sequence) for futher use in my script.
I'm not able to edit the pl/sql script because an other application is using it.
Somebody can help me?
Thx
Davy

The call to PKG_USERBEHEER_TEST.user_insert needs to pass a single PL/SQL variable as the first argument so that user_insert can return an update record. The OUT declaration of 'r' in user_insert is throwing the error. To that point, the problem is not due to PHP. You would get the same error in SQL*Plus.
But, because you can't bind a record in PHP, you need to create a new PL/SQL function that calls PKG_USERBEHEER_TEST.user_create_type putting the returned record into a PL/SQL variable, and then calls user_insert. PHP would call the wrapper PL/SQL function.
-- cj

Similar Messages

  • Oracle 11gR2 to SQL Server 2008 R2 - Problem executing SP on SQL server

    Hi,
    I have this problem: Executing a sp in SQL server from oracle
    --------------------ORACLE SP--------------------
    create or replace
    PROCEDURE DRIVER_SP
    AP IN OUT appl_param%ROWTYPE
    as
    v_sp_name varchar2(50);
    v_control_id number;
    val VARCHAR2(100);
    cur INTEGER;
    nr INTEGER;
    BEGIN
    v_sp_name := ap.MESSAGE_MISC_TEXT;
    v_control_id := ap.control_id;
    cur := DBMS_HS_PASSTHROUGH.OPEN_CURSOR@dblink_sqlserver;
    DBMS_HS_PASSTHROUGH.PARSE@dblink_sqlserver(cur, 'execute ' || v_sp_name || ' ' || to_char(v_control_id));
    LOOP
    nr := DBMS_HS_PASSTHROUGH.FETCH_ROW@dblink_sqlserver(cur);
    EXIT WHEN nr = 0;
    DBMS_HS_PASSTHROUGH.GET_VALUE@dblink_sqlserver(cur, 1, val);
    END LOOP;
    DBMS_HS_PASSTHROUGH.CLOSE_CURSOR@dblink_sqlserver(cur);
    driver_ap01_log_msg('Procedure returned: ' || val);
    commit;
    exception
    when others then
    driver_ap01_log_msg(sqlerrm);
    END DRIVER_SP;
    --------------------SQL Server SP-----------------------
    ALTER PROCEDURE [dbo].[PA01_SP]
    @control_id integer
    AS
    begin
    --update PA01
    --set infile_control_id = @control_id
    --insert into dbo.PA01LOG(msg) values('test')
    select 0
    end
    THE PROBLEM: Oracle SP calls SQL Server SP and any time I try to INSERT/UPDATE/DELETE (DML) within SQLServer SP it throws an exception on Oracle's end. Once I comment all DML code the proc runs fine.
    +"ORA-28511: lost RPC connection to heterogeneous remote agent using SID=ORA-28511: lost RPC connection to heterogeneous remote agent using SID=(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=xxxxxxx)(PORT=1511))(CONNECT_DATA=(SID=dg4msql)))+
    +ORA-02063: preceding line from DBLINK_SQLSERVER"+
    Please help.
    Thanks

    Thanks for your response, it got me closer to my goal. I'm still facing one problem:
    Let me explain what I need to achieve
    Purpose
    Execute an Oracle stored procedure which in turn executes a stored procedure on remote SQLServer which updates local tables on that SQLServer.
    Observations
    The execution of both procedures completes successfully. However, an explicit COMMIT statement must be issued on the Oracle session which initiated the transaction before any data could be read from the SQLServer updated table.
    The following is test exercise for proof of concept.
    PL/SQL code
    declare
    out_arg integer;
    ret_val integer;
    begin
    out_arg := 0;
    ret_val := "dbo"."ZZZ_SP"@DBLINK_SQLSERVER(10, out_arg);
    dbms_output.put_line(to_char(out_arg));
    end;
    SQLServer code
    ALTER procedure [dbo].[ZZZ_SP] (@arg1 integer, @arg2 integer output)
    AS
    begin tran tran1
    insert into dbo.PA01LOG(msg) values('ddd')
    commit tran tran1
    set @arg2 = @arg1 * 100
    select -1
    GO
    I have put the Oracle gateway in Single_Site mode to avoid two phase commit. I want SQLServer to be able to run its own transaction management. I don't want Oracle to be responsible for completing the transactions which take place within SQLServer.
    I fear there might be a gap in my knowledge.
    Any ideas why I need to issue a COMMIT in Oracle session to release the lock from SQLServer table?
    Thanks

  • Insert data into oracle based on sql server data(here sql server acting as source to oracle and destination to oracle)

    Source is Oralce. Destination is SQL Server.
    Requirement - I have to fetch sql server server data (empid's) based emp table  and send this as input data to oracle to fetch and empid's are common.
    I cannot use merge or loopkup or for each as oracle have too many records.
    For example - In MS SQL - i have empid=1,2..Only these records, I have to fetch from oracle source into sql server destination. For this, I have adopted the below approaches...The major problem I face, when i build a empid's as a string, it is taking only
    4000 chars. My string lenght is 10000. How do I breakup this string lengh and send to data flow task till all broken strings length passed to DFT.
    Approach-1
    created two variables - oraquery string, empid string
    step1 - ms sql database - created sql task - declare @empid varchar(max)
    SELECT @empid=
    Stuff((SELECT ',' + empid
            FROM  
            (SELECT  DISTINCT  convert(varchar(10),empid ) empid FROM emp
             ) x
            For XML PATH ('')),1,1,'')
    select @empid =    '(' +  @empid + ')'
    select @empid
    resultset=singlerow
    resultset=resultname=0; variablename=User::empid (empid is declared as string)
    step2 - oracle database - created data flow task
    created oledb source
    I put  this statemnt in oraquery expression - "select * from dept where dept in  "
    +  @[User::empid] + "
    expression=true
    [OLE DB Source [1]] Error: SSIS Error Code DTS_E_OLEDBERROR.  An OLE DB error has occurred. Error code: 0x80040E14.
    An OLE DB record is available.  Source: "Microsoft OLE DB Provider for Oracle"  Hresult: 0x80040E14  Description: "ORA-00936: missing expression".
    Approach-2
    created three variables - oraquery string, empid  int, loop object--when I put int then it is automatically setting to 0
    step1 - ms sql database - created sql task - SELECT  DISTINCT  convert(varchar(10),empid ) empid FROM emp
    resultset=fullresult
    resultset=resultname=0; variablename=User::loop
    step2 - created a for each loop container
    for loop editor - for each ado ennumerator
    enumerator configuration - loop
    variablemapping - variable=empid;index=0
    step3 - oracle database - created data flow task (outside for each loop. If I put inside it is taking long time)
    created oledb source
    I put  this statemnt in oraquery expression - "select * from dept where dept in  "
    +  @[User::empid] + "
    expression=true
    Data inserting in a destination table but  empid=0.

    Sorry didnt understand if your step3 is outside loop how
    @[User::empid] will get values for the empids from User::loop. The iteration happens inside loop so you
    need to have a logic to form the delimited list inside using a script task or something and concatenating everything and storing to variable @[User::empid]
    . Then only it will have full value used to be used in step3 query
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • How do I migrate views from MS SQL 2008 to Oracle 11g through SQL Developer

    Is there any way to migrate the views from MS SQL 2008 to Oracle 11g through SQL Developer? Please give me some detail steps. Thanks for your help.
    Kevin

    Hi Kevin,
    user13531850 wrote:
    Hi Turloch,
    When I use migrate to oracle, I got a problem, the migrate tool create a new schema for me in my case (AZTECA_KSMMS), it migrates all the stuffs under that schema (AZTECA_KSMMS). However my application need the all the Oracle data under schema AZTECA instead of AZTECA_KSMMS. Is there any way to specify specific schema (AZTECA) for target oracle database? Schema remapping is available:
    First Capture (separately) then during right click convert on the captured model there is a Specify the conversion options with a Object Naming tab where the schema (and other) name changes are editable.
    I have not used this recently.
    Also during the migration process, when I choose repository, there is a check box for truncate to reset repository to empty state, Do I need to check that truncate Check Box so the repository will be cleared from last migration?The repository can hold multple migration attempts. Check truncate to get rid of previous attempts information. This cleans up the repository - not the destination database.
    There are also online database and offline database options during the migration process, what are the difference between these two choices? After I migrated to Oracle, all my views has a red cross icon next to it. Does that mean the view migration is failed or not? Please give me your comments. Thanks for your help.offline: for big (amount of data) databases with simple data types,
    uses bcp + files + scripts + sqlldr.
    online: for small (amount of data) databases (easier),
    uses (Java) jdbc.
    The view is likely to be broken - recompiling it may help.
    The Oracle schema is created using a .sql file - see under generated in the directory you gave originally in the wizard. There is a .out file that contains the result of running this script including any errors. During conversion there are also likely to be warnings displayed on the UI.
    There may be a single issue that is causing multiple issues - if viewa depends on functionb, and functionb is broken, viewa will also fail.
    >
    Kevin-Turloch
    SQLDeveloper Team

  • File Upload and Download in Oracle iAS PL/SQL Gateway

    i'm using the example 113471.1 to "File Upload and Download in
    Oracle iAS PL/SQL Gateway"
    when i press the submit button after i select a file to upload
    i get the next message in the browser "No se puede mostrar la
    pagina" HTTP 404 file not found.
    I think the problem is in ctnsample.upload_form in the line
    htp.formOpen(curl => 'cntsample.upload', cmethod => 'POST',
    cenctype => 'multipart/form-data');
    The ctnsample.remove work fine.
    Could you,help me...

    There is a document in the Oracle 9iAS 1.0.2.2 Library titled "Using the PL-SQL Gateway" Part Number A90099-01.pdf that explains file upload and download through modplsql. In particular there is a section there titled "Direct BLOB Download" which explains how one can easily download a blob utilising the wpg_docload package.
    I am still concerned that there exist duplicate copies of my blob content. One copy in the wwdoc_document$ table, and one in my custom table.
    Dmitry/Oracle can you confirm this?

  • Sql Problems, Same Field Names In Multiple Mysql Tables?

    I have a keyword search that searches multiple DB tables for thumbnail images using UNION ALL. I have two pages, results.php, and view.php.  My goal is to able to click a thumbnail image on results.php and be directed to a larger version of that same image on view.php. The problem is each image in all my tables uses the field name "id" so when I click a thumbnail on results.php I get two different images with the same id from different tables.  I tried changing the id's to different names, but when it was time to pass url parameters I can only choose 1 value. (if you can choose more than 1 I don't know how).  So my question is why are my id's from different tables being grouped together, and how can I change this?
    Image Results Page (which works perfect):
    SELECT *
    FROM table1
    WHERE keyword LIKE %colname% OR id  LIKE %colname% 
    UNION ALL
    SELECT *
    FROM table2
    WHERE keyword LIKE %colname% OR id  LIKE %colname% 
    View Image Page (having problems here):
    SELECT *
    FROM table1
    WHERE id = colname
    UNION ALL
    FROM table2
    WHERE id = colname

    Yes, that is going to be a problem - and it's just the beginning of your problems when you do not normalize your data. Your data model is not correct. You should not be storing similar data in 15 tables - it's a really big mistake.
    To solve your current problem you would need to include a table identifier in the query results in the Image results page, and pass that to the view page and then use PHP to dynamically create the SQL with the correct table....ugh!

  • PHP and SQL Server with DW

    Hi,
    I have a problem with DW. I´d like to develop a site
    using PHP and SQL Server. Anyone knows if is there a extension to
    do this kind connection inside DW?
    I´ve tried to use the string that DW generates to
    connect with MySql and change it to connect with SQL Server,
    however it doesn´t work.
    I´ve already found a extension that do this, but it
    doesn´t work with DW CS3.
    Anyone can help me?
    Thank you,
    Luciano Fernandes
    PS: I have a original DW CS3

    "lucianopopo" <[email protected]> wrote in
    message
    news:ff7k9h$euc$[email protected]..
    > Hi,
    >
    > I have a problem with DW. I?d like to develop a site
    using PHP and SQL
    > Server.
    > Anyone knows if is there a extension to do this kind
    connection inside DW?
    >
    > I?ve tried to use the string that DW generates to
    connect with MySql and
    > change it to connect with SQL Server, however it doesn?t
    work.
    > I?ve already found a extension that do this, but it
    doesn?t work with DW
    > CS3.
    >
    > Anyone can help me?
    >
    > Thank you,
    > Luciano Fernandes
    >
    >
    > PS: I have a original DW CS3
    There used to be the PHAkt servermodel supporting multiple
    databases in PHP
    with Dreamweaver,
    unfortunately Adobe dropped the product after acquiring the
    company that
    produced it before the release of CS3, so
    it's not compatible with Dreamweaver CS3.
    Previous versions are available at
    http://openphakt.sourceforge.net,
    you can
    help development of a CS3 compatible version by posting bug
    reports for the
    error messages you encounter.
    Joris van Lier

  • DB2 8.1 to Oracle 11g with SQL Developer 3.0

    Hi,
    I started migrating my DB2 8.1 to Oracle 11g, with SQL Developer 3.0
    Basically, I need to migrate TABLES.
    I followed these steps:
    1) I created a new Oracle database, tablespaces, users, etc.
    2) Then, I created both (DB2 and Oracle) connections into SQL Developer 3.0. All works fine.
    3) I start capturing one table with the "Copy to Oracle" feature. Done with no errors.
    But when I compare the table structure, I see the following problems in Oracle:
    a) All fields are NULLABLE = YES. SQL Developer show this field property correctly in DB2: NULLABLE = NO, but not migrated the same!
    SOLUTION: All I want is that SQL Developer simply migrating the same value who I have in the DB2. But how?
    b) In DB2 I have one field property called COLUM DEFAULT. In Oracle this property is called DATA_DEFAULT. The SQL Developer show this field property correctly for the DB2 tables (for example: 0.0, ' ', etc), but don't migrated the same value! All fields are configured to DATA_DEFAULT = NULL.
    SOLUTION: I think this occurs because NULLABLE is migrated with the value YES. Well, all I need is the same above...
    NOTE: I tested the SWISSQL DATA MIGRATION software, and it works fine. All tables, field properties and data are migrated sucessfull. But this program is trial version!
    Well, I think all of this are BUGS into SQL Developer.
    Please, anyone to help me?
    Regards,
    Ylram

    Welcome to the forum!
    >
    I just did right click in the procedure body and found [Debug, Compile for Debug, Compile, Run].
    >
    You listed a bunch of things but you didn't say what steps you actually performed and what the result was.
    Did you 'Compile'the procedure? until you compile the procedure you can't debug it.
    I just created a new procedure and when I select the body it displays in the 'Code' window on the right. But the 'Debug' icon is not enabled because the procedure was not compiled for debug.
    When I compile it for debug the 'Debug' icon is now enabled.

  • How to use PHP with SQL?

    how to use sql in php and output a new ERP table contains every order_number, every order_quantity and so on then ouput sum of company and then sum of area
    and so on.
    now i only know a little how to use sql in php and you can give some examples of this?

    This sounds like a nice little homework exercise.
    Check the PHP FAQs for Oracle/PHP help
    http://www.oracle.com/technology/tech/php/htdocs/php_faq.html
    http://www.oracle.com/technology/tech/php/htdocs/php_troubleshooting_faq.html
    For SQL help, check http://asktom.oracle.com/
    -- cj

  • Oracle .dmp to SQL Server 2005

    I am trying to import an Oracle .dmp database into SQL Server 2005, what would you suggest as the fastest and easiest way to do this?  DTS/SSIS doesn't have an instant solution and the script I tried to use gave me an error...
    Msg 3241, Level 16, State 0, Line 1
    The media family on device '<DATABASE>' is incorrectly formed. SQL Server cannot process this media family.
    Msg 3013, Level 16, State 1, Line 1
    RESTORE DATABASE is terminating abnormally.
    I would like a GUI based way to do this if at all possible.  Thanks
    -Kyle

     JohnMCIC wrote:
    HI Suprotim,
    I am having the same problem. Could you explain in more detail how to import the Oracle .dmp file to SQL 2005. Thank you in advance.
    john
    I don't believe that the earlier responder was saying that SSIS could work with .DMP files. I think he was saying "use SSIS to transfer data from your Oracle database to SQL Server instead of trying to use .DMP files at all."

  • Oracle 10g to sql server 2005 - how to setup

    Hi,
    I have been searching on how to setup a connection from oracle 10g to sql server 2005 and i have to admit i am struggling a bit.
    I have read about Heterogeneous Services and Database Gateway but we really dont want to fork for licence fees so it looks like i have to investigate HS.
    My environment is:
    10gR2 Linux 32 bit
    SQL Server 2005 32bit.
    Would someone be able to provide me with a list of steps to help me get this setup?
    Thanks.
    B

    Hi,
    If you don't want to pay for any licence fees then you will have to use the 11g Database Gateway for ODBC (DG4ODBC) which is included in your RDBMS license.
    You need to use the 11g versions because all previous gateway versions have been desupported for some time. The latest version is 11.2.0.3 which can be downloaded from My Oracle Support as -
    Patch 10404530: 11.2.0.3.0 PATCH SET FOR ORACLE DATABASE SERVER
    and download -
    p10404530_112030_platform_5of7.zip
    - this is the Gateway media pack and has everything needed for a standalone gateway install.
    This version is certified the following RDBMS versions - 10.1.0.5 + RDBMS patch 5965763, 10.2.0.3 + RDBMS patch 5965763, 10.2.0.4, 10.2.0.5, all 11.1 versions, all 11.2 versions.
    You have 2 choices about where you can install it and it would be better to install the gateway into a new and separate ORACLE_HOME from any existing Oracle installs -
    1. On the Linux 32-bit platform where the RDBMS is running. If you install it here you will need to supply a third party ODBC driver. The only free one I am aware of is from FreeTDS but there may be others. There can be problems with the FreeTDS so another one may be preferable but these usually require a license fee.
    See this note in My Oracle Support -
    How to Configure DG4ODBC on Linux x86 32bit or on HP-UX RISC (DG4ODBC 11.1 only) to Connect to Non-Oracle Databases post install (Doc ID 466228.1)
    2. Install DG4ODBC on the Windows platform where SQL*Server is running. If you install on Windows then you will be able to use the Microsoft SQL*Server ODBC driver which should already be installed. See this note on My Oracle Support -
    How to Setup DG4ODBC (Oracle Database Gateway for ODBC) on Windows 32bit (Doc ID 466225.1)
    If you don't have access to My Oracle Support you will need to contact someone in your organisation to access the notes for you or review the gateway documentation -
    http://www.oracle.com/pls/db112/homepage
    Regards,
    Mike

  • Data migration from Oracle to MS SQL using SSIS

    Hi friends,
    I know this question must have been asked by many who are beginners to SSIS like me about migrating data from oracle database to sql server database but i still would like to raise this query again.
    I have table called tbl_employee_oracle in oracle database from where i need to retrive the latest records(eg. latest record of each employee) from the table and populate the result into the sql server database table which is tbl_employee_sqlserver
    using ssis.
    The logic i thought of doing this is as below;
    1. Retrive all employees records from oracle database table.
    2. Dump these records into a temporary table(will have same table structure as in oracle database) in sql server.
    3. Creating a stored procedure in sql server which will contain logic to select the most recent records from this temporary table.
    4. Populate this result set into the final table of sql server.
    Please suggest me if working on this logic is worth and any alternate logic to accomplish this task.

    There are many opitons, but choose among for your scenario
    1. If your employee table is small with less than a few hundreds of record, you want to choose SCD Type 1 if not preserving histoy, incase of preserving history of records choose SCD2,
    2. If you have less than few millions of records you can choose look up to direct unmatched records to insert into Sql Server Destination and direct matched records could be updated using OLEDB Destination or Try Merge Left outer Join
    transform.
    3. If you have several millions of records, you may want to use your above method.
    4. Configuring to use CDC could be last option where there are large volumes of updates and inserts every few min to hours. But I'm not sure if this option can be set in Oracle Source.
    Please mark this post as answer if it resolves your Problem. You may even mark it as helpful. Thanks

  • Using Oracle from MS SQL 2005

    I am having a strange problem while running an SQL statement in MS SQL 2005 that uses a linked Oracle server. I am getting the following error:
    OLE DB provider "OraOLEDB.Oracle" for linked server "OG" returned message "ORA-01403: no data found".
    Msg 7346, Level 16, State 2, Line 1
    Cannot get the data of the row from the OLE DB provider "OraOLEDB.Oracle" for linked server "OG"
    I am getting the error on the following SQL statement (OG is the Oracle server):
    SELECT Inv.AreaNo, Inv.CatType, Inv.CatNo, Inv.ItemNo, Inv.NumAvail, Inv.NumTotal, Inv.Active,
    IH.AID, IH.NumOut, IH.DateOut, IH.WorkerOut, IH.NumIn, IH.DateIn, IH.WorkerIn,
    CC.CatID, CC.CatName, CC.BinItem, CC.Active, OG.LASTNAME, OG.FIRSTNAME, OG.MIDDLENAME
    FROM ItemInventory AS Inv
    LEFT JOIN CatCodes AS CC ON Inv.AreaNo = CC.AreaNo AND Inv.CatType = CC.CatType AND Inv.CatNo = CC.CatNo
    LEFT JOIN ItemHistory AS IH ON Inv.AreaNo = IH.AreaNo AND Inv.CatType = IH.CatType AND Inv.CatNo = IH.CatNo AND
    Inv.ItemNo = IH.ItemNo
    LEFT JOIN OGL..D.LE AS OG ON AID = OG.PK
    WHERE Inv.AreaNo = 0 AND Inv.CatType = 0
    What's strange is that the following SQL statement works fine. The only difference between table ItemHistory (above) and ItemsOut (below) is that ItemHistory adds 3 columns that ItemsOut does not have. Other than that table the SQL statements are the same (as you can see).
    SELECT Inv.AreaNo, Inv.CatType, Inv.CatNo, Inv.ItemNo, Inv.NumAvail, Inv.NumTotal, Inv.Active,
    IO.AID, IO.NumOut, IO.DateOut, IO.WorkerOut, '1' AS NumIn, '1/1/1900' AS DateIn, '1' AS WorkerIn,
    CC.CatID, CC.CatName, CC.BinItem, CC.Active, OG.LASTNAME, OG.FIRSTNAME, OG.MIDDLENAME
    FROM ItemInventory AS Inv
    LEFT JOIN CatCodes AS CC ON Inv.AreaNo = CC.AreaNo AND Inv.CatType = CC.CatType AND Inv.CatNo = CC.CatNo
    LEFT JOIN ItemsOut AS IO ON Inv.AreaNo = IO.AreaNo AND
    Inv.CatType = IO.CatType AND Inv.CatNo = IO.CatNo AND
    Inv.ItemNo = IO.ItemNo
    LEFT JOIN OGL..D.LE AS OG ON AID = OG.PK
    WHERE Inv.AreaNo = 0 AND Inv.CatType = 0
    As a test I tried just running an SQL statement against ItemsHistory and the Oracle table, thinking it might be something with ItemsHistory, but the following command also runs just fine:
    SELECT ItemHistory.*, OG.LASTNAME, OG.FIRSTNAME, OG.MIDDLENAME
    FROM ItemHISTORY
    LEFT JOIN OGL..D.LE AS OG ON AID = OG.PK
    I'm not sure why the one SQL statement is erroring out with ORA-01403. I see no problems with it, as it is the same as the one that works except using a different table, and another SQL statement using the table in the erroring SQL works also. I'm stumped!
    I am using the 'OraOLEDB.Oracle' provider in SQL 2005.
    Thanks for any help you can give on this...

    I've been testing it, and I've found that if I comment out 4 fields from the field list (all from the same table), it runs. As soon as I add any one of the 4 fields back into the select list, I get the Oracle error. I also found that I had to change the Oracle table from a LEFT JOIN to just a JOIN, or else I also get the Oracle error.
    Here is the SQL (same as the previous post) with the 4 fields commented out, and the modified JOIN. Maybe that will give someone an idea, because it has me puzzled...
    SELECT Inv.AreaNo, Inv.CatType, Inv.CatNo, Inv.ItemNo, Inv.NumAvail, Inv.NumTotal, Inv.Active,
    IO.AID, IO.NumOut, IO.DateOut, IO.WorkerOut, IO.NumIn, IO.DateIn, IO.WorkerIn,
    OG.LASTNAME, OG.FIRSTNAME, OG.MIDDLENAME
    --, CC.CatID, CC.CatName, CC.BinItem, CC.Active
    FROM ItemInventory AS Inv
    LEFT JOIN CatCodes AS CC ON Inv.AreaNo = CC.AreaNo AND Inv.CatType = CC.CatType AND Inv.CatNo = CC.CatNo
    LEFT JOIN ItemHistory AS IO ON Inv.AreaNo = IO.AreaNo AND Inv.CatType = IO.CatType AND Inv.CatNo = IO.CatNo AND
    Inv.ItemNo = IO.ItemNo
    JOIN OGL..D.LE AS OG ON AID = OG.PK
    WHERE Inv.AreaNo = 0 AND Inv.CatType = 0

  • Is it possible to install Oracle 9i and SQL server on same machine

    1. Is it possible to install Oracle 9i and SQL server on same machine ?
    2. If yes, what are the problems i may encounter during installation
    3. What should be hardware configuration for installing both databases in same machine like hard disk space, RAM speed etc,

    Hi,
    1. Yes you can do it.
    2. There shouldn't be any problems
    3. Depends on your needs
    Jarek

  • Installing with Oracle or MS-SQL

    Hello,
    Is there a PDF or some page with the necessary setup to install LiveCycle ES Reader Extensions with Oracle and MS-SQL Server?
    Thank you for any info.
    Marcos

    Hi Srikant,
    I have worked on similar stuff, but the scenario was a little different. I worked on creating Web Services using EJBs, but the basic part was that, the web service was supposed to interact with the SQL Server database. So maybe I can help you...
    First thing which is needed is that you have created the JDBC Connector in your Visual Administrator correctly. If you wish to cross check, you can see my answer in the following thread:
    JDBC error
    In this thread itself I have given the code which is the solution to your problem (this is what i believe). I am pasting the code again:
    <b>InitialContext initialContext = new InitialContext();
    DataSource dataSource = (DataSource)initialContext.lookup("jdbc/MyAlias");
    java.sql.Connection connection = dataSource.getConnection();</b>
    You can use this code in the method of your EJB, and then you can easily use this connection object to access your database tables using SQL queries.
    And if by any chance you are looking for a step wise procedure for creating a web service from an EJB, then give me your email address, i will send you the doc.
    Bye
    Ankur
    Do reward points if it helps!!

Maybe you are looking for

  • Hiding exit button ess payslip2

    In ECC5 ESS I've been trying to make the floorpattern exit-button invisible. In the onInit() function of the Component of vcRem2Selection, of the ess~rem DC the message-text and tooltip are already set. In the context of vcRem2Selection there's no pr

  • [SOLVED] dwm manager taskbar font howto

    I'm trying to make my default dwm taskbar font bigger. After I installed dwm the default taskbar font looks small for me. How can I make it bigger? I tried editing config.h file and edited default font to: static const char font[]            = "*-*-f

  • Takes longer charge after 4.2 update

    My pad would charge to 100% pretty quickly before the upgrade. Less than an hour or so . Now it takes three to four hours at least to get back to 100%. After an hour I might be at 50-60% now. Anyone else? ideas?

  • Material Master extension to different Plants.

    I am presently using BAPI_MATERIAL_SAVEDATA to create material master in a particular plant. Is there an easy way to extend these to another plant. or Do i need to use BAPI_MATERIAL_SAVEREPLICA and pass different plant numbers in the MARC table in th

  • Status of System Profiler.app in Lion

    Perhaps because I had moved it elsewhere before upgrading from Snow Leopard to Lion, in addition to the new System Information.app I also have the old System Profiler.app in /Applications/Utilities. And I know that System Profiler.app will not itself