Oracle PL/SQL and Microsoft Access..

Does anyone know of a good tutorial on how to write the correct syntax for Oracle PL/SQL in an Access pass-through query?

Do you want to write PL/SQL via Access, or just pass a SQL string as a query? There are many books on PL/SQL if that is what you need, however, I suspect it is not.
Oracle SQL is pretty standard, except that for versions up to and including 8.x, it only accepts joins listed in the "WHERE" clause. Access itself will accept this syntax for inner joins. Most general SQL books seem to include a section on Oracle and T-sql variations.
SELECT a.field_1, b.field_2
FROM table_1 a, table_2 b
WHERE a.field_x = b.field_y ;
BUT if field_x is a CHAR field containing trailing spaces (CHAR(6) value is 'ABC ') and field_y is a VARCHAR2 field (value is 'ABC'), then the join condition should be:
WHERE TRIM(a.field_x) = b.field_y ;
for outer joins you add "(+)" to the field that may be blank
SELECT a.field_1, b.field_2
FROM table_1 a, table_2 b
WHERE a.field_x = b.field_y(+) ;
(Access) MID([field_1],2,5] becomes (Oracle) SUBSTR(field_1,2,5)
regards

Similar Messages

  • What is the Oracle equivalent of the Microsoft Access FIRST function?

    Using: Oracle 10gR2 RAC on SUSE Linux 9 (10.2.0.3)
    In the process of converting a Microsoft Access database to Oracle, an Access query is using the FIRST function.
    What is the Oracle equivalent of the Microsoft Access FIRST function?
    In the attempt to convert, the Oracle FIRST_VALUE function was used. However, the same results was not achieved.
    Thanks,
    (BLL)
    Query:
    h2. ACCESS:
    SELECT
         TRE.GCUSNO,
         UCASE([DCUSNO]) AS DCUSNO_STD,
         *FIRST(UCASE([DNAME])) AS DNAME_STD*,
         *FIRST(UCASE([DADDR])) AS DADDR_STD*,
         *FIRST(UCASE([DCITY])) AS DCITY_STD*,
         TRE.DSTATE,
         FIRST(TRE.DZIP) AS DZIP,
         TRE.DREGN,
         TRE.DDIST,
         TRE.DSLSMN,
         TRE.DCHAIN,
         TRE.MARKET,
         TRE.MKTPGM,
         TRE.EUMKT
    FROM
         TRE
    GROUP BY
         TRE.GCUSNO,
         UCASE([DCUSNO]),
         TRE.DSTATE,
         TRE.DREGN,
         TRE.DDIST,
         TRE.DSLSMN,
         TRE.DCHAIN,
         TRE.MARKET,
         TRE.MKTPGM,
         TRE.EUMKT;
    h2. ORACLE:
    SELECT DISTINCT
    TRE.GCUSNO,
    UPPER(TRIM(TRE.DCUSNO)) AS DCUSNO_STD,
    UPPER(TRIM(TRE.DNAME)) AS DNAME_STD,
    UPPER(TRIM(TRE.DADDR)) AS DADDR_STD,
         FIRST_VALUE(UPPER(TRIM(TRE.DNAME)) IGNORE NULLS) OVER (ORDER BY TRE.GCUSNO) AS DNAME_STD,
         FIRST_VALUE(UPPER(TRIM(TRE.DADDR)) IGNORE NULLS) OVER (ORDER BY TRE.GCUSNO) AS DADDR_STD,
         FIRST_VALUE(UPPER(TRIM(TRE.DCITY)) IGNORE NULLS) OVER (ORDER BY TRE.GCUSNO) AS DCITY_STD,
    TRE.DSTATE,
    TRE.DZIP,
    FIRST_VALUE(UPPER(TRIM(TRE.DZIP)) IGNORE NULLS) OVER (ORDER BY TRE.DZIP ASC) AS DZIP,
    TRE.DREGN,
    TRE.DDIST,
    TRE.DSLSMN,
    TRE.DCHAIN,
    TRE.MARKET,
    TRE.MKTPGM,
    TRE.EUMKT
    FROM CRM.TREUP100R TRE
    GROUP BY
    TRE.GCUSNO,
    UPPER(TRIM(TRE.DCUSNO)),
    TRE.DNAME,
    TRE.DADDR,
    TRE.DCITY,
    TRE.DSTATE,
    TRE.DZIP,
    TRE.DREGN,
    TRE.DDIST,
    TRE.DSLSMN,
    TRE.DCHAIN,
    TRE.MARKET,
    TRE.MKTPGM,
    TRE.EUMKT;

    A slight correction to odie's post. I think you want min not max to replicate the Access first function, but see below to be sure. So:
    min(upper(trim(tre.dname))) keep (dense_rank first order by tre.gcusno) as dname_std
    user10860953 wrote:How does one ignore null values?The min and max functions will ignore nulls automatically, so if there is a null value in tre.dname, it will not be be returned, unless all of the values are null. For example:
    SQL> WITH t AS (
      2     SELECT 65 id, 'ABCD' col FROM dual UNION ALL
      3     SELECT 37, 'DEFG' FROM dual UNION ALL
      4     SELECT 65, 'DEFG' FROM dual UNION ALL
      5     SELECT 65, null FROM dual UNION ALL
      6     SELECT 70, null FROM dual UNION ALL
      7     SELECT 70, null FROM dual UNION ALL
      8     SELECT 37, 'ABC' from dual)
      9  SELECT id,
    10         MIN(col) keep (DENSE_RANK FIRST ORDER BY id) min_dname_std,
    11         MAX(col) keep (DENSE_RANK FIRST ORDER BY id) max_dname_std
    12  FROM t
    13  GROUP BY id;
            ID MIN_ MAX_
            37 ABC  DEFG
            65 ABCD DEFG
            70John

  • Oracle Database 11g Administrator or Oracle PL/SQL and Forms Developer?

    Hi,
    I am thinking about doing an Oracle certification course- Oracle Database 11g Administrator or Oracle PL/SQL and Forms Developer.
    Oracle Database 11g OCP and OCM certification requires 3 mandatory training courses to be completed that costs between $1900 and $3250/each. Oracle PL/SQL certication doesn't require any mandatory training course.
    Which one of these would be a good choice? Please advise.
    Thank you,
    Tracy

    Regardless of which path you want to take, in order to get the OCP certification in either the DBA or PL/SQL developer track, you must first obtain the respective OCA certification for that track. I'm assuming that since you are still undecided in which path to take that you haven't started working on either yet. If you look at the pages for the OCA DBA and OCA PL/SQL Developer certs and what is required for each, you'll see that the first block of tests for either certification (the SQL based exams) has the same options (1Z0-007, 1Z0-047, 1Z0-051) and passing one of those SQL based exams gives credit towards obtaining both OCA certifications. That might be a good place to start.
    Doing one of these tests first might give you some extra time to decide which track you want to pursue. But as Justin said, it really depends on what you do (or plan on doing) in your career as to which path might be more beneficial for you.
    As for the OCM level stuff, I wouldn't even think about it until you get the OCP. One step at a time... Same with OCP before OCA. That being said, my suggestions are just that, suggestions. You're free to take any exams/courses in any order, but you won't be able to obtain the certs until you have completed the requirements for each.

  • Oracle 8i SQL and PL/SQL plus

    hi everybody, i am trying from two weeks to install oracle 8i SQL and PL/SQL plus on my PC on both Windows 2000 & XP and I installed every java runtime environment I found "the old and the new" but the SETUP insists on not working though it worked on the instructor's PC smoothly without problems.

    If you are getting any errors, you should tell us. Also, you should let us know what version you are trying to install.
    A very common problem at the moment is with Pentium 4 processors. If you have a Pentium 4, search the forums to find the answer.
    Alison

  • Coneection between Oracle to SQL and SQL to Oracle

    Dear All,
    I have oracle 11g R2 (32 bit) on windows 32 bit.
    I have sql express edition 2008 (32 bit) on windows 32 bit.
    More information about my system is :-
    I have install oracle database and sql database on same machine (there is no client).
    I want to fetch data from oracle to sql and sql to oracel. I have tried Using ODAC 32 bit but with no luck.
    steps i have performed:-
    1) Install odac for windows for oracle 11g R2 version (successful).
    2) Tried to create odbc connection using odbc driver (successful).
    3) Tried to create link server in sql (successful).
    4) Tried to connect to oracle using link server (failed).
    It seems i made some small mistake.
    I request you to please help me if you have perform this activity.
    Thanks,
    Chanchal Wankhade.

    Chanchal Wankhade wrote:
    Hello,
    Please suggest.
    =================================
    Patience, Grasshopper
    You posted this follow-up a mere 85 minutes after your previous post. 
    This forum is not a chat line, and it is not paid support. 
    No one is responsible for monitoring it and giving a quick response. 
    Furthermore, it is a global forum.  The person with the information you seek may very well live 20 time zones away from you and was going to bed just as you posted. He will not even see your post for several more hours. 
    Your original post went up in the middle of the night for half the world.
    No one with the information you seek is deliberately withholding it until you sound sufficiently desperate.

  • Questions about the future directions of InfoPath and Microsoft Access

    Because I have been confused about the future directions of InfoPath and Access, I wrote a short blog post, which I have pasted below.  My question is, can Microsoft provide some more guidance on Access vs InfoPath?  If Access is indeed the
    the future direction, can you please provide some pointers to resources that can help us transition.
    A Short Review of MS Access,  SharePoint ,InfoPath (2013)
    After the November 2012 SharePoint Conference in Las Vegas (#spc12) there were a number of blog posts and people saying that Access 2013 was great and would be replacing InfoPath.
    Marc Anderson and
    Ruven
    Gotz have short posts summarizing #SPC12 and touch on the subject of InfoPath and Access.  I also spoke with several individuals shortly after #SPC12 and they were excited about Access 2013.
    Since I rely heavily on InfoPath for much of what I do, I wanted to kick the tires and see what everyone was talking about.  First, a few notes about SharePoint 2013 and Office 2013.
    Microsoft should rename Access:  If you have tried to
    bing the word Access, then you know that the search results are overwhelming,  because the word "access" is used for so many other purposes.
    Use the RTM version of Office 2013! I was performing  my investigations by leveraging the Office 365 Beta and the Office Applications that come with it.  Not much was working!  After I uninstalled the Beta
    version of Office 2013 and Installed the RTM version everything seemed to work. 
    Windows 7 and IE 9.0: The drag & drop that is being touted as
    "manna from heaven" seems to work well with Firefox, Safari, Chrome, and IE 10, but it does
    not work with IE 9!
    Non Microsoft browsers are still second class citizens (except for the drag & drop):  Microsoft has finally done away with the Active X's for datasheet view (that is brilliant!)  One can now see the newly
    minted datasheet view in many browsers.  But I still find that one needs to be in IE to do a number of key manual opeartions.  For example pasting numerous rows of data from a spreadsheet into the new sheet view works only in IE.
    Access 2013
    Microsoft Access is touted as a non developer tool.  I know a number of people who are on the business side and love Access.  These people will like the renewed energy that Microsoft has applied to Access.   One should note that conceptually
    this functionality existed  in SharePoint 2010.  Here is what I see that is new:
    +The new version works better:Although I haven't tested it fully, it seems that many more features that work on the Desktop version of Access, now work in the published Web Application which is hosted by SharePoint 2013.
    +The new version has fairly robust browser based forms: End users can now fill in data using forms that are rendered in the browser.
    +The published version that resides in SharePoint now uses its own SQL server tables.  So the engine appears to be SQL Server, not a modified version of Access built for a server.  This stands to be quite robust, but I imagine
    that some quirks will surface due to new model.
    The limitations are:
    - Access is pretty much its own application and does not integrate with SharePoint building blocks.  For example, an Access table is not easy to integrate with a SharePoint workflow.  Further, although  Access forms now are visible
    in a browser, they are not nearly as rich as InfoPath forms.  InfoPath forms cannot easily integrate with the Access tables.  In order to integrate SharePoint features and Access, one needs to tie SharePoint list(s) to Access as data sources. 
    This overcomplicates the model and one may very well run into synchronization issues.
    In short, although I believe there will be some people who will be happy with newly minted Access, I do not think that Access will be able to replace InfoPath and Workflow technologies.  I do agree that Microsoft does not seem to have put much energy into
    InfoPath.  If they leave a vacuum in this space, then others may very well take over, for instance Nintex Forms.

    Although I agree with the comments made by Ruven and Marc after the conference please note that those blog posts are their own personal opinions and that they don't work for Microsoft.  A lot of people have asked Microsoft to clarify the future of InfoPath
    and the response up until now has been a deafening silence.  In my opinion speculations about Access replacing InfoPath are premature.
    I should also point out that most of your comments about Access 2013 above are actually about Access Services in SharePoint Server 2013.  Access Services are NOT Access they are a shared service offering in SharePoint that convert and publish Access
    databases and forms.  As you point out once an Access database is published through Access services it is converted to SQL Server and no longer resides in Access.  Of course I don't work for Microsoft either so these are all just my personal opinion. 
    Having said that I doubt you will get the confirmation/response that you are hoping for from any official Microsoft channel.
    Paul Stork SharePoint Server
    MVP Principal Solutions Architect: BlueChip Consulting Group
    Blog: http://dontpapanic.com/blog
    Twitter: Follow @pstork
    Please remember to mark your question as "answered" if this solves your problem.

  • SQL and MS Access

    I have a Microsoft access database which holds information about several different people for each person there are several records each for a different week using week numbers (from 1 first week january to 52). I need to extract the last record for each person the trouble is that the last record for each person is from a different week and therefore has a different week number. i need to extract all the latest record for all the people in a single statement i cannot find a way is it possible in access.

    In your last topic about this problem
    http://forum.java.sun.com/thread.jsp?forum=48&thread=213166
    you were told to use ORDER BY and GROUP BY and WHERE.
    But WHERE is a selection refering to the entire table. So only the records of the very last week (of all records) are selected.
    I think the solution lies in using the HAVING clause instead of WHERE: this is a selection condition for each group, e.g.
    HAVING week = ( select MAX( week ) FROM table )
    Sorry, I have no time to work it out.
    If you might use a SQL book or document for understanding HAVING and try it by yourself.
    I hope this is possible for Access then.

  • Crystal reports server and microsoft access db

    Hi
    I have created a Crystal Report using Crystal Reports XI. In terms of a datasource I simply used a unc path to the actual mdb file.
    I can open the report local on the PC in CR XI and the report runs no problem however I have deployed to our Crystal Reports server XI so that users can use it.
    The problem is that when I try to run the report from the Info view console it keeps asking me for a user id and password. I have logged into the CMC admin console and looked at the properites of the report and the process/database tab however not matter what I configure in there it either asks for the username and password or says invlaid object when I try to view the report.
    I have created other reports which have used an SQL database as the data source and published them to the CR Server and they work no problem so I am guessing I need to change something for using an Access DB as the dataource. Not usr eif that change is in Crystal Reports XI or Crystal Reports Server?
    Can anyone help?
    Many thanks

    Try this
    Symptom
    Access files present on the network drives.
    Create a report based on files on the network drives.
    Reproducing the Issue
    Create a Crystal Report using Access and Excel files on the network drive as Data Source.
    Crystal Reports XI Release 1, Release 2.
    Operating System: Windows XP SP2
    Database: Microsoft Access / Excel.
    Resolution
    On the Windows XP system go to Start -> Settings -> Control Panel.
    Double Click on Administrative Tools.
    Double Click on Data Sources (ODBC).
    Click on the System DSN tab and then Click on Add.
    Select a driver for which you want to set up a data source.
    For Access Files select 'Driver do Microsoft Access (*.mdb)' as driver type and then click on Finish.
    For Excel Files select 'Driver do Microsoft Excel (*.xls)' as driver type and then click on Finish.
    Enter the Data Source Name and under the Database option click on Select.
    Then click on the Network button, Map Network Drive window will appear.
    Select the Drive and Folder where you have the Access and Excel Files on the network and then click on Finish button.
    Select the appropriate Directory where the file is located and double click on the folder and select the Excel or Access files depending on the driver you have selected and click on OK button.
    After the DSN is created click on OK button.
    Open the Crystal Report application.
    Click on create New Report.
    Under the Available Data Sources expand the Create New Connection then expand ODBC (RDO) and select the newly created Data Source Name and then click on Finish.
    Select the appropriate tables and create a report as per the requirement.
    Keywords
    Excel Access Crystal Reports Network Drive
    Regards,
    Raghavendra

  • Oracle Pl/Sql and Oracle Application Express for Beginners

    Good day,
    Have a prodigy that is strongly interested in oracle application express.Haven know that he will only do we in APEX if he is good in pl/sql and have some skills in html and javascripts.
    For such person,what are the books that i can recommend for him,that will guide and assist him?Will be highly grateful if anybody can assist.

    Sc0tt wrote:
    I think it also falsely gives the impression that one does not need to understand the database at all because Apex can do everything for you...This is why I echo Munky when he says that you need a solid understanding of data models and the database before attempting to build an application.
    I absolutely concur with this view. When I first started using ApEx, I was basically given a user guide and told to get on with it :-) Subsequently, for the first 6 months or so, I built probably fairly lousy (but functional) apps until I got a better grasp of Oracle architecture.
    That being said, SQL is an absolute must if you are going to work on a database. PL/SQL really should be learned as well because your application will be limited without it. CSS and Javascript and nice to have's, but they can be learned as you go. Since all of the api's are built in pl/sql, it would really hinder what you could do if you didn't know it.One resource I have found very useful is the good old 'Ant' book a.k.a. Oracle PL/SQL Programming by Feuerstein, et al. I have a well-thumbed 4th edition sitting on my desk at the moment - weirdly for a text book, rather a joy to read.
    I personally found Jay-Lew's "Cost-based Oracle Fundamentals" a somewhat bitterer pill to swallow - tough on the way down but good for one's constitution!

  • Working with InDesign and Microsoft Access Databases

    I was wondering if there’s anyway to synchronize Adobe InDesign with Microsoft Access in a way that when changes are made to the INDD file they would automatically be updated in the database.  Does Anyone have any ideas on this?  Is there a third party plugin that would accomplish this or would I need to export xml out of InDesign?

    InCopy would be indeed the best solution for you. InCopy is the little brother of InDesign, But both need to be in the same version to work together flawless.
    InCopy is much cheaper and simpler than InDesign as it is missing layout capacity, but both of you need to understand both applications.
    Generally, if 2 persons are working on the same document they should have the same versions between 2 InDesigns or between InDesign and InCopy, any workflow where IDML is needed should be avoided.
    Why are there so many corrections in your present workflow? If you make your Word Document correct and set it up with styles without any manual format overrides, no hyphenation, no several continuous returns it should reduce the number of corrections on the first place.

  • Database connectivity toolset and microsoft access

    Bonjour,
    je suis débutante labview et j'aurais besoin d'aide...
    voici mon pb:
    j'ai créé une table sous microsoft access et j'aimerais lire les données à partir de labview en utilisant "database connectivity toolset". les vi utilisés sontpen connection, select data et close connection.
    le vi "open connection" demande le 'connection information': j'ai donc donné le chemin ou se trouve mon fichier .udl
    ce fichier udl est configuré comme cela:
    fournisseur: microsoft jet et connexion: le chemin ou se trouve le fichier access.
    mais ca ne marche pas! j'ai une erreur apres le vi select data, qui me dit 'erreur syntax'
    je ne sais pas si j'utilise les bons vi....
    merci pour une réponse rapide.

    Bonjour,
    Tout d'abord, vous devez vérifiez si la création du fichier UDL est correcte. Ci-dessous une note d'application décrivant étape par étape cette procédure:
    * Creating a Microsoft Data Link file (.UDL) for Connecting to Microsoft Access in LabVIEW
    http://digital.ni.com/public.nsf/websearch/1D5EB4DCBD13106486256B9D005E11B0?OpenDocument
    Ensuite, testez l'exemple standard "Connection example.vi" fourni avec le toolkit Database Connectivity.
    Dans LabVIEW, allez dans le Menu Aide >> Recherche d'exemples ... puis sélectionnez Toolkits & Modules >> Connection aux bases de données >> Connection example.
    Si la connection échoue, l'exemple doit renvoyer une erreur avec un code et un descriptif. Ces informations sont indispensables pour débuter un débuggage (l
    es codes d'erreurs classiques sont référencés sur le web et des notes d'applications sont fournies pour les corriger).
    Cordialement.
    Matthieu Gourssies
    National Instruments France.

  • How to integrate Oracle Internet Directory and Microsoft Active Directory

    hai friends,
    I need to know how to integrate the OID with AD. the changes in both either one of the directory should reflect on both the directories.
    how can this be done in Oracle Directory Integration and Provisioning(DIP).
    Thank's in advance.

    Hi,
    The below links should get you started -
    http://www.oracle.com/technology/obe/obe_as_10g/im/index.html
    http://www.oracle.com/technology/obe/obe_as_10g/im/ads_export/export.htm
    http://www.oracle.com/technology/obe/obe_as_10g/im/ads_import/import.htm
    http://docs.huihoo.com/oracle/docs/B25553_01/collab.1012/b25490/ch_active_directory.htm
    And...Try using DipTester.

  • Oracle to SQL and BulkCopy

    Hi Guys,
    I have a VB.Net application that queries an Oracle database and then uses the sqlbulkcopy to move it to a Sql table. It works fine without column mapping. As soon as I try to map the columns it fails. Basically says that columns do not match.
    This works ...
    Using cmd As New OracleCommand(dSource.SQLStatement, dSource.OracleConnection)
    cmd.CommandTimeout = 60
    If cmd.CommandText.Contains("@ERProjectCode") Then cmd.Parameters.AddWithValue("@ERProjectCode", Job.Project)
    cmd.Connection.Open()
    Using dr As OracleDataReader = cmd.ExecuteReader()
    Using s As New SqlBulkCopy(destConn, SqlBulkCopyOptions.Default, bcpTransaction)
    s.DestinationTableName = Job.ApplicationDestinationTable
    s.WriteToServer(dr)
    s.Close()
    End Using
    End Using
    cmd.Connection.Close()
    End Using
    This Fails ....
    Using cmd As New OracleCommand(dSource.SQLStatement, dSource.OracleConnection)
    cmd.CommandTimeout = 60
    If cmd.CommandText.Contains("@ERProjectCode") Then cmd.Parameters.AddWithValue("@ERProjectCode", Job.Project)
    cmd.Connection.Open()
    Using dr As OracleDataReader = cmd.ExecuteReader()
    Using s As New SqlBulkCopy(destConn, SqlBulkCopyOptions.Default, bcpTransaction)
    '*****COLUMNS MAPPING *****
    For i As Integer = 0 To dr.FieldCount - 1
    s.ColumnMappings.Add(dr.GetName(i), dr.GetName(i))
    Next i
    s.DestinationTableName = Job.ApplicationDestinationTable
    s.WriteToServer(dr)
    s.Close()
    End Using
    End Using
    cmd.Connection.Close()
    End Using
    I have tried casting in the Oracle Query file but nothing seems to work.
    I have run out of ideas and welcome any suggestions.
    Thank You !!!

    Chanchal Wankhade wrote:
    Hello,
    Please suggest.
    =================================
    Patience, Grasshopper
    You posted this follow-up a mere 85 minutes after your previous post. 
    This forum is not a chat line, and it is not paid support. 
    No one is responsible for monitoring it and giving a quick response. 
    Furthermore, it is a global forum.  The person with the information you seek may very well live 20 time zones away from you and was going to bed just as you posted. He will not even see your post for several more hours. 
    Your original post went up in the middle of the night for half the world.
    No one with the information you seek is deliberately withholding it until you sound sufficiently desperate.

  • Help with Oracle PL/SQL and Objects...

    Hi,
    I wonder if you can help me, I am having some trouble dealing with Oracle objects in PL/SQL. I can declare them, populate them and read from them without any issues.
    But I am having some problems with trying to copy records in to other records of the same type, and also with updating existing records. I've made a mock up piece of code below to explain what I mean, it may have a few mistakes as I've written it in notepad but should be reasonably clear.
    First I have created a record type, which contains attributes relating to a person.....
    CREATE OR REPLACE
    TYPE PERSON_RECORD_TYPE AS object (
                        Person_ID          NUMBER(3),
                        Person_Name     VARCHAR(20),
                        Person_Age          NUMBER(2),
                        static function new return PERSON_RECORD_TYPE );
    CREATE OR REPLACE
    TYPE BODY PERSON_RECORD_TYPE as
    static function new return PERSON_RECORD_TYPE is
    BEGIN
    return PERSON_RECORD_TYPE (
         NULL,
                             NULL,
                             NULL,
                             NULL,
                             NULL
    END;
    END;
    Then I have created a table type, which is a table of the person record type......
    CREATE OR REPLACE
    type PERSON_TABLE_TYPE as table of PERSON_RECORD_TYPE;
    Finally I have created a procedure which recieves an instance of the person table type and reads through it using a cursor.....
    PROCEDURE ADMIN_PERSON (incoming_person     IN     PERSON_TABLE_TYPE)
    IS
    -- This is a local record declared as the same type as the incoming object
    local_person PERSON_TABLE_TYPE;
    -- Cursor to select all from the incoming object
    CURSOR select_person
    IS
    SELECT      *
    FROM      TABLE ( cast (incoming_person AS PERSON_TABLE_TYPE));
    BEGIN
    -- Loop to process cursor results
    FOR select_person_rec IN select_person
         LOOP
              /* Up to this point works fine...*/
              -- If I want to store the current cursor record in a local record of the same type, I can do this....
              local_person.person_id          := select_person_rec.person_id;
              local_person.person_name      := select_person_rec.person_name;
              local_person.person_age          := select_person_rec.person_age;
    -- QUESTION 1
              -- The above works fine, but in my real example there are a lot more fields          
              -- Why cant I set the local record to the value of the cursor record like this below..     
              local_person := select_person_rec;
    -- The above line gives a pl/sql error - expression is of wrong type, (as far as I can see the records are of the same type?)
    -- QUESTION 2
              --Also how do you update an existing record within the original object, I have tried the following but it does not work
              UPDATE incoming_person
              SET          age = (age + 1)
              WHERE     incoming_person.person_id = '123';
    -- The error here is that the table does not exist
         END LOOP;
    END;
    So I hope that you can see from this, I have two problems. The first is that I can store the current cursor record in a local record if I assign each attribute one at a time, but my real example has a large number of attributes. So why can't I just assign the entire cursor record to the local cursor record?
    I get a PL/SQL error "Expression is of wrong type" when I try to do this.
    The second question is with regards to the update statement, obviously this doesn't work, it expects a table name here instead. So can anyone show me how I should update existing person records in the incoming table type to the procedure?
    I hope this makes sense, but I don't think I have explained it very well!!
    Any help will be gratefully recieved!!
    Thanks

    I understand why you are having trouble - my own brain started to hurt looking at your questions :)
    First off, database types are not records. They can act like records but are "objects" with different characterstics.
    You can create a record in PL/SQL but the "type" is of RECORD. You created an OBJECT as BODY_PERSON_RECORD_TYPE.
    I don't use database types unless I really need them, such as for working with pipelined functions.
    -- QUESTION 1
    -- The above works fine, but in my real example there are a lot more fields
    -- Why cant I set the local record to the value of the cursor record like this below..
    local_person := select_person_rec; local_person is set to the (misnamed) BODY_PERSON_RECORD_TYPE, while SELECT_PERSON_REC is anchored to the cursor and is a RECORD of SELECT_PERSON%ROWTYPE with a field for each column selected in the query. Different types, not compatible.
    You should be able to manually assign the object items one by one as object.attribute := record.field one field at a time.
    -- QUESTION 2
    --Also how do you update an existing record within the original object, I have tried the following but it does not workCheck the on-line documentation for the syntax. You'll probably have to reference the actual value through the table; this is one reason why I don't work with nested tables - the syntax to do things like updates is much more complex.

  • Problem with Oracle external procedures and Microsoft Active Directory

    Hi,
    Our server was recently updated to use Microsoft Active Directory. However, we noticed that all external procedure calls keeps on failing with ORA-28575: unable to open RPC connection external procedure agent. Everything was working fine before we migrated to Active Directory which is why we can say that the listener is configured correctly.
    Any idea on how we can make extproc calls with Active Directory?
    thanks.

    Michael,
    Oracle Forms does support Single Sign-On (SSO). Take a look at Oracle Containers for J2EE Security Guide: OC4J Java Single Sing-On. Also take a look at the Oracle Forms 10g Sample Code and scroll to the SSO demo under the Forms Services Demo section. There are also, numerous other documents available via Google. ;-)
    Craig B-)
    If someone's response is helpful or correct, please mark it accordingly.

Maybe you are looking for

  • Table of contents using cfdocument

    Good day, I've been trying to create a table of contents using cfdocument. I've been unsuccessful in extracting the page number out of the document. I know they are reserved for that scope, but i've tried copying the value into an application variabl

  • My MacBook Pro Unrecognised DVD Stuck in drive

    Tried all easy options to remove DVD   Drive  makes a sound on boot up then stops.

  • Asynchronous call with soap adapter?

    Hi All I Scenario status update in CRm using Webservice using SOAP adapetr. when i am testing in ALTOVA SPy when i send response it successfully updates status , it also send back message <SOAP:Envelope xmlns:SOAP="http://schemas.xmlsoap.org/soap/env

  • Pop-up window - slideshow

    Hi! Is there any way that the slideshows created by iWeb can be displayed in the main browser window and not pop up in a new one? Sincerely, Tom - Norway

  • Escaping sql quotes manually. (replace function)

    I can't get a simple replace to work and am surprised at myself. How do I replace every occurrence of either a 'single or "double quote with a backslash+quote (\' or \")? (I need it for mysql escaping of selects. Before you jump that prepared stateme