Dubugging PL/SQL variables  - help !

whilst debugging my PL/SQL in 9.0.3 i am unable to get the values of my "cursor" row values. I can get inspect declared variables but i cannot watch/inspect what data is currently being processed in the cursor ....
with the simple code below I can evalue the var2 variable but the imptxn.column1 value returns nothing !!! This is annoying as i do not want to setup lots of variables.
SELECT *
FROM txnimport;
BEGIN
FOR imptxn IN imptxnc
LOOP
DECLARE
BEGIN
nacccount := 0;
var1 := imptxn.column1;
any ideas ???
phil

Hi Philip,
What version of the database are you debugging with?
When debugging with a 8.1.7 and 9i-release-1 database, you can use the JDeveloper debugger's Watches window to view the value of imptxn.column1.
When debugging with a 9i-release-2 database, you can't. (Sorry.) This has already been entered bug #2482666 with description "UNABLE TO SEE CURSOR INFORMATION WITH 9.2".
If you have an 8.1.7 or 9i-release-1 database available, you might want to try debugging with it. However, the debugging support in these older database is not as complete (in other areas besides this cursor issue) as the debugging support in the 9i-release-2 database.
Sorry,
Liz

Similar Messages

  • Using sql:variable in an insert statement

    I'm writing an insert statement for a table with an XML column.  Most of the XML is static, but I need to replace the value of an element with the value of a T-SQL variable, as shown here:
    CREATE TABLE [dbo].[OrderDetail](
    [OrderID] [int] NULL,
    [OrderDetail] [xml] NULL
    GO
    DECLARE @XMLData XML;
    DECLARE @ItemID INT;
    SET @ItemID = 1000;
    SELECT @XMLData = N'
    <OrderDetail xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    </OrderDetail>
    SET @XMLData.modify('insert <ItemID>[sql:variable("@ItemID")]</ItemID> into (/OrderDetail)[1]')
    INSERT INTO [dbo].[OrderDetail] ([OrderID], [OrderDetail])
    VALUES (@ItemID, @XMLData);
    When I run this, it inserts "[sql:variable("@ItemID")]" instead of the value of @ItemID.  If someone could show me the proper syntax, I would really appreciate it.  Thanks.

    Yes, that worked.  Now I want to change it a little.  I also have an attribute that I need to update with the value of a variable.
    DECLARE @XMLData XML;
    DECLARE @SetID INT;
    DECLARE @SetIDStr VARCHAR(12);
    DECLARE @SetIDXML XML;
    SET @SetID = 9999;
    SET @SetIDStr = CONVERT(VARCHAR(12), @SetID);
    SET @SetIDXML = CONVERT(XML, @SetIDStr);
    SELECT @XMLData = N'
    <OrderDetail xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <ItemID>1000</ItemID>
    <RightOperand ID="15524" Name="ItemName" Value="15524" />
    </OrderDetail>
    SET @XMLData.modify('replace value of (/OrderDetail/RightOperand/@ID)[1] with sql:variable("@SetIDXML")');
    INSERT INTO [dbo].[OrderDetail] ([OrderID], [OrderDetail])
    VALUES (@SetID, @XMLData);
    SELECT * FROM [dbo].[OrderDetail];
    I'm trying to replace "ID="15524"" with the value of @SetID.  This code throws an exception:
    Msg 9342, Level 16, State 1, Line 23
    XQuery [modify()]: An XML instance is only supported as the direct source of an insert using sql:column/sql:variable.
    Thanks again for your help.

  • Sql:variable and XML query performance

    Can someone help with sql:variable() in xml queries?  It seems that when I attempt to reference variables with the sql:variable(...) function in an xpath function (exist or nodes) it comes up with a totally different query plan, possibly ignoring
    my secondary indices like the ones for VALUE, PATH.
    But if I replace sql:variable("@p_ObjectIdentifierForReference") with the literal (ie. "ord/p/ord0616.p") then it uses secondary indices more consistently.
    Below you will see an unsuccessful attempt to get the query to "OPTIMIZE FOR" a specific literal value of @p_ObjectIdentifierForReference.  But this doesn't give work.  It doesn't give me a plan using the secondary index I expect.
    Ideally there would be a way to get the sql:variable(...) function to give the same query plan as a literal. Not sure why that isn't the default behavior.
    DECLARE
    @p_ObjectIdentifierForReference
    varchar(500);
    SET
    @p_ObjectIdentifierForReference
    = 'ord/p/ord0616.p';
    WITH
    XMLNAMESPACES ('uri:schemas-progress-com:XREFD:0004'
    as D)
    SELECT  
    XREF_FileDataReference.XREF_FileData     
    AS XrefFileData,
    InnerRowNode.value('/D:Reference[1]/D:File-num[1]',
    'int') 
    AS FileNumber,
    InnerRowNode.value('/D:Reference[1]/D:Line-num[1]',
    'int') 
    AS LineNumber
    FROM
    (SELECT
    XREF.XREF_FileData.XREF_FileData,
    XREF.XREF_FileData.XREF_FileEntry,
    InnerRow.query('.')
    AS InnerRowNode
     FROM
    XREF.XREF_FileData
    OUTER APPLY
    DataXref.nodes('/D:Cross-reference/D:Source/D:Reference[@Object-identifier = sql:variable("@p_ObjectIdentifierForReference")
    and @Reference-type = "RUN"]')
    as T(InnerRow)                                                           
    WHERE    DataXref.exist('/D:Cross-reference/D:Source/D:Reference[@Object-identifier
    = sql:variable("@p_ObjectIdentifierForReference") and @Reference-type = "RUN"]')
    = 1) 
    AS XREF_FileDataReference
     INNER
    JOIN  XREF.XREF_MemberBuilt  
    ON XREF_MemberBuilt.XREF_FileData  
    = XREF_FileDataReference.XREF_FileData
     INNER
    JOIN  XREF.XREF_FileEntry 
    ON XREF_FileEntry.XREF_FileEntry
    = XREF_FileDataReference.XREF_FileEntry 
    WHERE
    XREF_MemberBuilt.XREF_ProjectBuilt
    = 69
    OPTION(RECOMPILE,
    OPTIMIZE FOR (@p_ObjectIdentifierForReference
    = 'ord/p/ord0616.p')

    I tried to create a "repro" of your query so we can work on it and try and improve it, but I got the best results by just adding text() and [1] to it, eg
    SELECT
    XREF_FileDataReference.XREF_FileData AS XrefFileData,
    InnerRowNode.value('(/D:Reference/D:File-num/text())[1]', 'int') AS FileNumber,
    InnerRowNode.value('(/D:Reference/D:Line-num/text())[1]', 'int') AS LineNumber
    FROM (
    In my main repro, even with a large piece of xml with 100,000 elements, there still wasn't much difference between the queries:
    USE tempdb
    GO
    IF NOT EXISTS ( SELECT * FROM sys.schemas WHERE name = 'XREF' )
    EXEC( 'CREATE SCHEMA XREF' )
    GO
    IF OBJECT_ID('XREF.XREF_FileData') IS NOT NULL DROP TABLE XREF.XREF_FileData
    CREATE TABLE XREF.XREF_FileData
    rowId INT IDENTITY,
    DataXref XML,
    XREF_FileData INT,
    XREF_FileEntry INT,
    CONSTRAINT PK_XREF_FileData PRIMARY KEY ( rowId )
    GO
    IF OBJECT_ID('XREF.XREF_MemberBuilt') IS NOT NULL DROP TABLE XREF.XREF_MemberBuilt
    CREATE TABLE XREF.XREF_MemberBuilt
    XREF_ProjectBuilt INT,
    XREF_FileData INT
    GO
    IF OBJECT_ID('XREF.XREF_FileEntry') IS NOT NULL DROP TABLE XREF.XREF_FileEntry
    CREATE TABLE XREF.XREF_FileEntry
    XREF_FileEntry INT
    GO
    -- Create larger piece of xml for repro
    ;WITH XMLNAMESPACES ( DEFAULT 'uri:schemas-progress-com:XREFD:0004' ), cte AS (
    SELECT TOP 100000 ROW_NUMBER() OVER ( ORDER BY ( SELECT 1 ) ) rn
    FROM master.sys.columns c1
    CROSS JOIN master.sys.columns c2
    CROSS JOIN master.sys.columns c3
    INSERT INTO XREF.XREF_FileData ( DataXref, XREF_FileData, XREF_FileEntry )
    SELECT
    SELECT
    CASE rn WHEN 9999 THEN 'ord/p/ord0616.p' ELSE CAST( rn AS VARCHAR(20) ) END AS "@Object-identifier",
    'RUN' AS "@Reference-type",
    SELECT
    rn AS "File-num",
    rn * 10 AS "Line-num"
    FOR XML PATH(''), TYPE
    ) AS "*"
    FROM cte
    FOR XML PATH('Reference'), ROOT('Source'), TYPE
    ).query('<Cross-reference xmlns="uri:schemas-progress-com:XREFD:0004">{.}</Cross-reference>'), 1, 100
    INSERT INTO XREF.XREF_FileEntry ( XREF_FileEntry )
    VALUES ( 100 )
    INSERT INTO XREF.XREF_MemberBuilt ( XREF_ProjectBuilt, XREF_FileData )
    VALUES ( 69, 1 )
    GO
    --SELECT * FROM XREF.XREF_FileData
    --SELECT * FROM XREF.XREF_FileEntry
    --SELECT * FROM XREF.XREF_MemberBuilt
    --GO
    -- Add primary XML index
    CREATE PRIMARY XML INDEX xidx_XREF_FileData ON XREF.XREF_FileData (DataXref)
    GO
    -- Add value, property and path xml indexes
    CREATE XML INDEX xvalidx_XREF_FileData ON XREF.XREF_FileData (DataXref)
    USING XML INDEX xidx_XREF_FileData FOR VALUE
    CREATE XML INDEX xpthidx_XREF_FileData ON XREF.XREF_FileData (DataXref)
    USING XML INDEX xidx_XREF_FileData FOR PATH
    CREATE XML INDEX xprpidx_XREF_FileData ON XREF.XREF_FileData (DataXref)
    USING XML INDEX xidx_XREF_FileData FOR PROPERTY
    GO
    :exit
    DBCC DROPCLEANBUFFERS
    DBCC FREEPROCCACHE
    GO
    DECLARE @p_ObjectIdentifierForReference varchar(500);
    SET @p_ObjectIdentifierForReference = 'ord/p/ord0616.p';
    ;WITH XMLNAMESPACES ('uri:schemas-progress-com:XREFD:0004' as D)
    SELECT
    XREF_FileDataReference.XREF_FileData AS XrefFileData,
    InnerRowNode.value('/D:Reference[1]/D:File-num[1]', 'int') AS FileNumber,
    InnerRowNode.value('/D:Reference[1]/D:Line-num[1]', 'int') AS LineNumber
    FROM (
    SELECT
    XREF.XREF_FileData.XREF_FileData,
    XREF.XREF_FileData.XREF_FileEntry,
    InnerRow.query('.') AS InnerRowNode
    FROM XREF.XREF_FileData
    OUTER APPLY DataXref.nodes('/D:Cross-reference/D:Source/D:Reference[@Object-identifier = sql:variable("@p_ObjectIdentifierForReference") and @Reference-type = "RUN"]') as T(InnerRow)
    WHERE DataXref.exist('/D:Cross-reference/D:Source/D:Reference[@Object-identifier = sql:variable("@p_ObjectIdentifierForReference") and @Reference-type = "RUN"]') = 1
    ) AS XREF_FileDataReference
    INNER JOIN XREF.XREF_MemberBuilt ON XREF_MemberBuilt.XREF_FileData = XREF_FileDataReference.XREF_FileData
    INNER JOIN XREF.XREF_FileEntry ON XREF_FileEntry.XREF_FileEntry = XREF_FileDataReference.XREF_FileEntry
    WHERE XREF_MemberBuilt.XREF_ProjectBuilt = 69
    OPTION( RECOMPILE, OPTIMIZE FOR (@p_ObjectIdentifierForReference = 'ord/p/ord0616.p') )
    GO
    DBCC DROPCLEANBUFFERS
    DBCC FREEPROCCACHE
    GO
    DECLARE @p_ObjectIdentifierForReference varchar(500);
    SET @p_ObjectIdentifierForReference = 'ord/p/ord0616.p';
    ;WITH XMLNAMESPACES ('uri:schemas-progress-com:XREFD:0004' as D)
    SELECT
    XREF_FileDataReference.XREF_FileData AS XrefFileData,
    InnerRowNode.value('(/D:Reference/D:File-num/text())[1]', 'int') AS FileNumber,
    InnerRowNode.value('(/D:Reference/D:Line-num/text())[1]', 'int') AS LineNumber
    FROM (
    SELECT
    XREF.XREF_FileData.XREF_FileData,
    XREF.XREF_FileData.XREF_FileEntry,
    InnerRow.query('.') AS InnerRowNode
    FROM XREF.XREF_FileData
    OUTER APPLY DataXref.nodes('/D:Cross-reference/D:Source/D:Reference[@Object-identifier = sql:variable("@p_ObjectIdentifierForReference") and @Reference-type = "RUN"]') as T(InnerRow)
    WHERE DataXref.exist('/D:Cross-reference/D:Source/D:Reference[@Object-identifier = sql:variable("@p_ObjectIdentifierForReference") and @Reference-type = "RUN"]') = 1
    ) AS XREF_FileDataReference
    INNER JOIN XREF.XREF_MemberBuilt ON XREF_MemberBuilt.XREF_FileData = XREF_FileDataReference.XREF_FileData
    INNER JOIN XREF.XREF_FileEntry ON XREF_FileEntry.XREF_FileEntry = XREF_FileDataReference.XREF_FileEntry
    WHERE XREF_MemberBuilt.XREF_ProjectBuilt = 69
    OPTION( RECOMPILE, OPTIMIZE FOR (@p_ObjectIdentifierForReference = 'ord/p/ord0616.p') )
    GO
    So I guess I'm saying I cannot reproduce your problem on SQL 2008 R2 or SQL 2012.  Does anything about this repro stand out as different from your situation?
    Looking at your query I would say you might consider the following:
    are you really seeing big differences in query duration?
    pretty much ignore estimated plan costs for xml queries
    consider breaking it up; eg carve off the xml then do the joins?  If poor cardinality estimation is part of the problem this might help
    Understand what PATH, PROPERTY and VALUE are for, then only create the ones you need
    do you really have the range of queries that requires all three?
    this is still a great article on xml indexes:
    http://technet.microsoft.com/en-us/library/ms191497.aspx
    What's performance like with the primary xml index only?
    If performance is that important, consider materialising the columns permanently
    I think the buffer_descriptors stuff is a distraction - mostly your cache is warm right?
    plan forcing could be a last resort
    Selective XML indexes in SQL 2012 onwards are great : )  much less storage required for example but much more specific

  • Passing pl/sql variable to Oarcle  procedure to java program

    Dear
    Sir/madam
    From java its easy to call procedure or function to get pl/sql variables like cursor type or varray type and cast back to that equi type thro' oracle extn package.Is there any way it could be done vice versa.Can i pass Oarcles Pl/SQL datatype like collection Of type Varray/Custom Object or Cursor,Array type to a procedure or function from java program.Is it possible to pass like that.If so could you kindly give a samll eaxample or URL where same type of example could be found
    regards
    kingshu

    Dear
    Sir/madam
    From java its easy to call procedure or function to get pl/sql variables like cursor type or varray type and cast back to that equi type thro' oracle extn package.Is there any way it could be done vice versa.Can i pass Oarcles Pl/SQL datatype like collection Of type Varray/Custom Object or Cursor,Array type to a procedure or function from java program.Is it possible to pass like that.If so could you kindly give a samll eaxample or URL where same type of example could be found
    regards
    kingshu i suggest to read JPublisher doc - it help support or convert PL/SQL types in Java
    http://otn.oracle.com/docs/products/oracle9i/doc_library/release2/java.920/a96658.pdf
    Kuassi

  • Passing pl/sql variable to oracle procedure from java

    Dear
    Sir/madam
    From java its easy to call procedure or function to get pl/sql variables like cursor type or varray type and cast back to that equi type thro' oracle extn package.Is there any way it could be done vice versa.Can i pass Oarcles Pl/SQL datatype like collection Of type Varray/Custom Object or Cursor,Array type to a procedure or function from java program.Is it possible to pass like that.If so could you kindly give a samll eaxample or URL where same type of example could be found
    regards
    kingshuk

    Dear
    Sir/madam
    From java its easy to call procedure or function to get pl/sql variables like cursor type or varray type and cast back to that equi type thro' oracle extn package.Is there any way it could be done vice versa.Can i pass Oarcles Pl/SQL datatype like collection Of type Varray/Custom Object or Cursor,Array type to a procedure or function from java program.Is it possible to pass like that.If so could you kindly give a samll eaxample or URL where same type of example could be found
    regards
    kingshu i suggest to read JPublisher doc - it help support or convert PL/SQL types in Java
    http://otn.oracle.com/docs/products/oracle9i/doc_library/release2/java.920/a96658.pdf
    Kuassi

  • Create a cursor from a PL/SQL variable or an external file

    Dear friends,
    is there a way for me to make Oracle Forms read a cursor from a PL/SQL variable, or an external file? Let's suppose we have the code below:
    DECLARE
    cursor c_values is select * from my_table;
    r_values c_values%ROWTYPE;
    BEGIN
    for r_values in c_values loop
    do_something;
    end loop;
    END;
    In the situation described above, could I create "select * from my_table" from a PL/SQL variable (it could be something like p_cursor = 'select * from my_table'), or an external file - for example, make my form read the contents of c:\my_select.sql , where we see the "select * from my table" text?
    My question comes because I need to export data from select instructions that were dinamically created inside the form - that is, via PL/SQL -, and I don't want to rewrite it, but I'll have to do it if I have no choice. Your help will be greatly appreciated.
    Best regards,
    Franklin
    Edited by: franklinbrasil on 12/03/2009 11:33
    Edited by: franklinbrasil on 12/03/2009 11:35

    Dear friends,
    I am using DBMS_SQL package, which solved my problem. Please let me explain it better, if it's not clear.
    I have some PL/SQL blocks inside my form, which creates SQL queries dinamically, and a dinamically created SQL is stored into a VARCHAR2 variable. These SQL queries are exported for use in Oracle Graphics, but since OG is not being developed by Oracle anymore then I am trying to find a substitute for it.
    So I thought about creating an option for the final user: he/she can choose exporting data into Microsoft Excel, and user does what he/she wants, creating a customized graphic. Exporting into Excel works finely, with no problems at all - I could find a routine by searching on the web.
    My goal was to use the same queries created above to export data dinamically to Microsoft Excel, and I absolutely don't want to rewrite all these dinamically created queries - one which works dinamically, other with no flexibility inside my form. Worse than it, I have many other dinamically created queries, and I obviously don't want to rewrite them all - any maintenance in this form would be terrible, with each SQL instruction written twice.
    Since all dinamically created SQL instructions are stored inside a VARCHAR2 variable, I thought about reusing the same SQL, as explained above - and here we have your suggestions about using a ref cursor, execute immediate, and so on. And (answering Andreas) query structure is always based on the same table, but its structure changes a lot, depending on what the final user chooses in a drop-down list (it's a list of graphics options, where final user chooses one option, and form must mount SQL dinamically, based on user's choice).
    By using your explanations, I could find DBMS_SQL solution here: http://download.oracle.com/docs/cd/B10501_01/appdev.920/a96590/adg09dyn.htm#26799
    . Please notice that I had to change DBMS_SQL.native into 1 for it to work in my form. I'll mark all your answers as helpful because I can use them both for database and form purposes.
    If my message was not clear enough, please tell me and I'll try to make it more clear.
    Best regards,
    Franklin

  • (SQL*PLUS HELP) RUNNING PUPBLD OR HELPINS ASKS FOR SYSTEM_PASS

    제품 : ORACLE SERVER
    작성날짜 : 2002-04-22
    (SQL*PLUS HELP) RUNNING PUPBLD OR HELPINS ASKS FOR SYSTEM_PASS
    ==============================================================
    PURPOSE
    이 내용은 SQL*Plus 상에서 SQL*Plus command의 help를 보기 위한 방법이다.
    Problem Description
    SQL*Plus command의 help를 보기 위해서 helpins를 수행하면
    SYSTEM_PASS is not set이라는 에러 메시지가 발생하는 경우가 있다.
    이 자료는 pupbld 또는 helpins를 수행하기 전에 SYSTEM_PASS 환경변수를
    셋팅하는 방법에 대한 자료이다.
    아래와 같은 에러가 발생하는 경우 조치 방법에 대해 알아본다.
    SYSTEM_PASS not set.
    Set and export SYSTEM_PASS, then restart help (for helpins or
    profile for pupbld) installation.
    Workaround
    none
    Solution Description
    이 스크립트는 system user로 database에 connect되어 수행되어야 한다.
    helpins를 수행하기 위해서는 SYSTEM_PASS 환경변수가 셋팅되어 있어야 한다.
    NOTE
    For security reasons, do not set this variable in your shell
    startup scripts. (i.e. .login or .profile.).
    Set this environment variable at the prompt.
    1. Prompt에서 환경변수를 셋팅하기
    For C shell:
    % setenv SYSTEM_PASS system/<password>
    For Korn or Bourne shells:
    $ SYSTEM_PASS=system/<password> ;export SYSTEM_PASS
    2. Now run "$ORACLE_HOME/bin/pupbld" or "$ORACLE_HOME/bin/helpins".
    % cd $ORACLE_HOME/bin
    % pupbld
    or
    % helpins
    주의사항
    $ORACLE_HOME/bin/pupbld 스크립트와 $ORACLE_HOME/bin/helpins 스크
    립트를 수행하기 위해서는 반드시 SYSTEM_PASS 환경변수를 필요로 한다.
    Reference Document
    <Note:1037075.6>

    check it please whether it is a database version or just you are installing a client. Install Enterprize database on 2k system. I you are running a client software then you are to deinstall it.

  • Final cut x 10.0.5 sqlite error too many sql variables

    Hi,
    We have a 463MB final cut project that can´t load.
    If we see console out, it says:
    Final Cut Pro     CoreData: error: (1) I/O error for database at /Volumes/HD Pro RAID/Final Cut Projects/Teaser/CurrentVersion.fcpproject.  SQLite error code:1, 'too many SQL variables'
    Final Cut Pro    Core Data: annotation: -executeRequest: encountered exception = I/O error for database at /Volumes/HD Pro RAID/Final Cut Projects/Teaser/CurrentVersion.fcpproject.  SQLite error code:1, 'too many SQL variables' with userInfo = {
         NSFilePath = "/Volumes/HD Pro RAID/Final Cut Projects/Teaser/Teaser con Burgos/CurrentVersion.fcpproject";
         NSSQLiteErrorDomain = 1;
    It seems that the project cames to big. I´m not the editor, so i can´t imagine how it could go that way and hao can we open it now.
    Thanks.

    Hi Jon.
    Thanks for your help. I´ve seen a post telling the same thing. I finally let Final cut pro X about 8 hours and it finally opened the project, but i couldn´t make anything with it. Tried to export xml and import it to another project without success. The problem persists. So i also tried to cut some parts from the project and is still the same. For each test we must wait 8 hours and it´s not reasonable time to test things. I just sent the project to apple engineers, so if is there any solution i will post in here.
    Thanks.

  • How to read a whole text file into a pl/sql variable?

    Hi, I need to read an entire text file--which actually contains an email message extracted from a content management system-- into a variable in a pl/sql package, so I can insert some information from the database and then send the email. I want to read the whole text file in one shot, not just one line at a time. Shoud I use Utl_File.Get_Raw or is there another more appropriate way to do this?

    how to read a whole text file into a pl/sql variable?
    your_clob_variable := dbms_xslprocessor.read2clob('YOUR_DIRECTORY','YOUR_FILE');
    ....

  • Populate the current os directory in a SQL variable

    Hello, I need to populate a SQL variable in a script with the current OS directory I am working from. This is a windows environment and I am using oracle version 9.2.0.1. I know if you do SQL>$cd it will execute a cd like you are at the dos prompt. Is there a way to put this into a SQL variable? This is a SQL*Plus script.
    Thank you.

    I have a tech support incident ongoing with ADC about this. People are away for the holidays, but so far I have been able to confirm that PackageMaker itself can't do this, as the name of the current user isn't available, nor do paths to the current Home directory work.
    The only way is to have PackageMaker launch a preinstall shell or Applescript that does the "mv <item1> <item2>" or similar (the argument $1 that gets passed to these preinstall scripts IS the name of the user doing the install, so you can get the path to his home directory).
    The problem THEN becomes, PackageMaker will not build a package that contains only scripts - it HAS to have some "payload" or you will get a build error. So the ultimate kludge would be to have it run the preinstall script, give it a bogus payload (empty file, etc) to install in e.g., /Library or /Applications, then have the postinstall script delete that bogus payload. I have not tried this so I do not know if it would work.
    I am thinking now, with the extremely confusing and apparently contradictory rules that PackageMaker has, that the best way to install software is just to wrap a shell script in an Applescript Application Bundle wrapper (because you can't double-click a shell script without launching Terminal, so to have the user run a shell script you need to wrap it in Automator or AppleScript or a Cocoa app wrapper) and have the shell script do the copying of the files that you need. This still might result in the shell script trying to get some sort of permission (either sudo or that "Override user/group for xxx?" message).
    I have read the rules on permissions for Packages about 1,017 times and they still make absolutely no sense to me, and I understand Unix permissions completely. All they would have to do is give some examples, but they don't.

  • Generic reporting on SQL variables using sqlgls() /Pro*C

    Generic reporting on host/SQL variables using sqlgls()
    I use sqlgls() in Pro*C 8.1.7 to get the last SQL statement that was parsed.
    It returns something like this.
    "select distinct QTY ,CHAPTER into :b0:b1,:b2:b3 from PT ,PU ,UIN U ,EU where (PART=:b4 and PU.PART=:b5) ....."
    I would like to see what the values are for each input variable e.g :b4 and :b5
    Is there any generic way of reporting what these values are rather than explicity writing code for each individual SQL statement?
    Is there a Pro*C method that gets the values of :b4 and :b5??
    We are recording the last SQL statement to a text file but cannot see what the values are that caused the SQL query to fail.
    Please contact me at [email protected]

    My answer is only for 1. problem (about ORA-01458)
    I think that you use declaration for cursor C0 with a varchar
    variable before you ininitialize length (member .len of varchar
    structure) of this variable.
    It's famous that many errors come from uninitialized varchar
    variables in Pro*C.

  • SQL*Plus Help

    Hi! Does anyone know where i can download SQL*Plus Help? I need to get info on select syntax, sql built-in functions, etc..
    Thanks!

    hi
    you can proceed like this :
    go to the OTN
    the click on products.
    null

  • Load a table in a PL/SQL variable

    Hi!
    I'm using Oracle 8i and I'm interested in load a table from my database in a PL/SQL variable.In addition,I'm using Nested Table Type for loading a database table in a variable.When I load the table in the variable, I try doing a SQL query to the variable (is a nested table) but it doesn't work.There is some solution?
    In the following lines there is an example about what I'm trying:
    PACKAGE Types AS
    TYPE cursor_type IS REF CURSOR;
    END Types;
    CREATE TABLE EXAMPLE(
    ID NUMBER(4),
    VAL Number(3)
    CREATE or replace TYPE My_Row_Type AS OBJECT
    ID NUMBER(4),
    NStreet Number(3)
    CREATE OR REPLACE PACKAGE PROVA AS
    TYPE My_Tab_Type IS TABLE OF My_Row_Type;
    PROCEDURE GetEXAMPLE (p_recordset OUT types.cursor_type);
    END PROVA;
    CREATE OR REPLACE PACKAGE BODY PROVA AS
    PROCEDURE GetEXAMPLE (p_recordset OUT types.cursor_type) AS
    v_tab My_Tab_Type := My_Tab_Type();
    BEGIN
    FOR cur_row IN (SELECT * FROM EXAMPLE) LOOP
    v_tab.extend;
    v_tab(v_tab.Last) := My_Row_Type(cur_row.ID,     cur_row.NStreet);
    END LOOP;
    -- Open REF CURSOR for outout.
    OPEN p_recordset FOR
    SELECT *
    FROM Table(Cast(v_tab As My_Tab_Type));
    END GetEXAMPLE ;
    END PROVA;
    When I execute the procedure GetEXAMPLE, Oracle shows me the following error:
    ERROR en línea 1:
    ORA-00600: código de error interno, argumentos: [15419], [severe error during
    PL/SQL execution], [], [], [], [], [], []
    ORA-06544: PL/SQL: error interno, argumentos: [pfrrun.c:pfrbnd1()], [], [], [],
    ORA-06553: PLS-801: error interno [0]

    Create your My_Tab_Type as a SQL Object Type, instead of a PL/SQL Table Type:
    SQL> CREATE TABLE example
      2    (id     NUMBER (4),
      3       nstreet NUMBER (3))
      4  /
    Table created.
    SQL> INSERT INTO example VALUES (1234, 123)
      2  /
    1 row created.
    SQL> INSERT INTO example VALUES (2345, 234)
      2  /
    1 row created.
    SQL> COMMIT
      2  /
    Commit complete.
    SQL> CREATE OR REPLACE TYPE My_Row_Type AS OBJECT
      2    (id     NUMBER (4),
      3       nstreet NUMBER (3));
      4  /
    Type created.
    SQL> CREATE OR REPLACE TYPE My_Tab_Type AS TABLE OF My_Row_Type;
      2  /
    Type created.
    SQL> CREATE OR REPLACE PACKAGE types
      2  AS
      3    TYPE cursor_type IS REF CURSOR;
      4  END types;
      5  /
    Package created.
    SQL> CREATE OR REPLACE PACKAGE prova
      2  AS
      3    PROCEDURE GetExample
      4        (p_recordset OUT types.cursor_type);
      5  END prova;
      6  /
    Package created.
    SQL> SHOW ERRORS
    No errors.
    SQL> CREATE OR REPLACE PACKAGE BODY prova
      2  AS
      3    PROCEDURE GetExample
      4        (p_recordset OUT types.cursor_type)
      5    AS
      6        v_tab My_Tab_Type := My_Tab_Type();
      7    BEGIN
      8        FOR cur_row IN (SELECT * FROM example) LOOP
      9          v_tab.EXTEND;
    10          v_tab(v_tab.LAST) := My_Row_Type(cur_row.id, cur_row.nstreet);
    11        END LOOP;
    12        -- Open REF CURSOR for output.
    13        OPEN p_recordset FOR
    14        SELECT *
    15        FROM TABLE(CAST(v_tab AS My_Tab_Type));
    16    END GetExample;
    17  END prova;
    18  /
    Package body created.
    SQL> SHOW ERRORS
    No errors.
    SQL> VARIABLE g_ref REFCURSOR
    SQL> EXEC prova.GetExample (:g_ref)
    PL/SQL procedure successfully completed.
    SQL> PRINT g_ref
            ID    NSTREET                                                          
          1234        123                                                          
          2345        234                                                          
    2 rows selected.

  • Passing Pl/Sql variables into shell variables.

    I have written a file that ftp information from one pc to another in unix.
    All you have to do is supply a user_name/password and machine name to which ftp program will connect to.
    All connection information like user_id,password, machine name are stored in an oracle table FTP_TBL.
    It has the following fields:
    FTP_TBL
    ================
    USER_ID      NOT NULL VARCHAR2(100);
    USR_PASSWD      NOT NULL VARCHAR2(50);
    TO_MACHINE     NOT NULL VARCHAR2(50);
    I have called a pl/sql script in unix shell.
    This script selects all the connection information from FTP_TBL and populates the pl/sql variables with the
    information.
    Now i want the pl/sql variables like V_TO_MACHINE,V_USR_ID,V_USR_PASSWD to be passed on to unix variables
    To_MACHINE, USR_ID AND USR_PASSWD.
    How can i do this?
    ============================================================================================================
    sqlplus -s <<+++ >> $LOG_FILE
    $USER/$PASSWD
    set serverout on SIZE 1000000
    DECLARE
    V_TO_MACHINE VARCHAR2(100);
    V_USR_ID VARCHAR2(50);
    V_USR_PASSWD VARCHAR2(50);
    BEGIN
         BEGIN
              SELECT TO_MACHINE, USER_ID, USR_PASSWD
              INTO V_TO_MACHINE,V_USR_ID,V_USR_PASSWD
              FROM FTP_TBL;
         EXCEPTION
              when others then
              dbms_output.put_line('ERROR|SQLPLUS|'||ERROR||'|'||sqlcode||'|Failed during selecting configuration information.'||sqlerrm );
         END;
    END;
    +++
    #======================== VARIABLES =====================
    TO_MACHINE=$1
    USR_ID=$2
    USR_PASSWD=$3
    #========================== MAIN ========================
    ftp -vnd $TO_MACHINE << ++ 1>>$STA_LOG_FILE 2>&1
    user $USR_ID $USR_PASSWD
    prompt off
    get $OR_DATA_DIR/ASC.STADATA $HOME_DIR/ASC.STADATA
    bye
    ++
    # testing the exit status of FTP
    egrep "Transfer complete" $STA_LOG_FILE >/dev/null
    if [ $? = 0 ]
    then
    echo >> $STA_LOG_FILE
    echo "FTP Successfully Done" >> $STA_LOG_FILE
    else
    echo >> $STA_LOG_FILE
    echo "FTP UnSuccessfull" >> $STA_LOG_FILE
    exit 1
    fi

    Here an example of how to pass variables to the shell script :
    TEST@db102 SQL> select ename, job, dname from emp,dept
      2  where empno = 7902
      3  and emp.deptno = dept.deptno;
    ENAME      JOB       DNAME
    FORD       ANALYST   RESEARCH
    TEST@db102 SQL> exit
    Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
    With the Partitioning, OLAP and Data Mining options
    [ora102 work db102]$ cat disp_var.sh
    set `sqlplus -s test/test << EOF
    set pages 0
    select ename, job, dname from emp,dept
    where empno = 7902
    and emp.deptno = dept.deptno;
    exit
    EOF`
    echo $1 $2 $3
    [ora102 work db102]$ ./disp_var.sh
    FORD ANALYST RESEARCH
    [ora102 work db102]$                                                  

  • How to install SQL*Plus help facilities and demos.

    Hi, everyone
    It appears error message say "failure to login" during SQL*Plus
    part of the Oracle8 full installation. I knew that system want
    to install SQL*Plus help and demos through logining one of
    dba account(maybe system user account). However, due to
    password's reason, can not log in SQL*Plus, so installer can't
    execute named pupbld.sql script, result in SQL*Plus help and
    demos can not be installed.
    Now, I am intend to install these stuff lonely.
    Could anyone help me? thank a lot.
    William
    null

    Hi,
    The pupbld.sql isn't the correct script to create the help
    facility, it just creates product and user profile tables.
    The help script is at $ORACLE_HOME/sqlplus/admin/help (run as
    system)
    cd $ORACLE_HOME/sqlplus/admin/help
    sqlplus system/<password> @helptbl
    sqlldr system/<password> control=plushelp.ctl
    sqlldr system/<password> control=plshelp.ctl
    sqlldr system/<password> control=sqlhelp.ctl
    sqlplus system/<password> @helpindx
    I think it is necessary to run the pupbld.sql script, without
    this script everyone who logins in oracle with sqlplus will see
    an error message, but... Run the script again:
    $ORACLE_HOME/sqlplus/admin/pupbld.sql
    Best regards,
    Ari
    William (guest) wrote:
    : Hi, everyone
    : It appears error message say "failure to login" during SQL*Plus
    : part of the Oracle8 full installation. I knew that system want
    : to install SQL*Plus help and demos through logining one of
    : dba account(maybe system user account). However, due to
    : password's reason, can not log in SQL*Plus, so installer can't
    : execute named pupbld.sql script, result in SQL*Plus help and
    : demos can not be installed.
    : Now, I am intend to install these stuff lonely.
    : Could anyone help me? thank a lot.
    : William
    null

Maybe you are looking for

  • Background color distortion/for itunes and desktop

    hot pink.. red, and purple. itunes, the top right icons, (display, sound, date/time) are all hot pink as is the photo that is my screen saver are all bright colors. from where? i did calibrate the monitor yesterday, but photos look fine in photoshop,

  • Can i watch iplayer on a mac

    can i watch iplayer on a mac

  • How to get the status of the button?

    i want to know how to get the clicked status of the button? whether it is in clicked state or in unclicked state? For ex: i have the following code... <components:IconButton id="bold_btn" width="22" icon="@Embed('/assets/bold.png')" click="onBoldClic

  • Cfmail not working properly, Log files not updating

    I'm still trying to get this CFmail problem corrected.  The problem is CFmail is only send the mail out sporadically.  In many cases it will send out the mail and still put the message in the undeliverable folder.  My smtp server shows that the conne

  • Cross Company Sales Automatic Vendor Invoice Not Created

    Hi, I have an issue in Cross company Sales Scenario (Inter company Sales), During the Intercompany Invoice we can trigger output RD04 to create Automatic Vendor Invoice in the Ordering Company. I have done the necessary configuration for creating Ido