Adding named constraints from another schema using stored procedures

I need some help. I am trying to create a constraint like Primary key on a table in schema say 'a' from schema 'b'. in Oracle 10g. Schema b has all permissions of create, alter table, create index and other permissions required.
I can create this constraint from schema b using SQL command 'alter table add constraint...' but not from inside a procedure. I am using 'Execute Immediate' statement to alter table to add constraint. While trying from a procdure, it throws the error as 'insufficeint previleges'.
Kindly advise.

it is due to roles.
if schema b has for example role DBA it is not sufficient. You should
GRANT ALTER ANY TABLE TO B;maybe also CREATE ANY INDEX. not sure...
regards
Laurent

Similar Messages

  • Constraints From another schema

    Hi Guys,
    I have a table referral_contacts which has a column customer_id.This col is coming from a synonym whose base table is in another schema.
    So the current requirement is to establish the referential constratint from that table .I think there is no way to add constraint from a synonym whose base table is in another schema.Is there any method to achieve this without crating the same table .
    Any suggestions,coments are highly appreciated.
    Thanks,
    Prafulla

    Hi Prafulla
    It will be very tough for maintenance in long term if you create cross-reference constraints across schemas. That won't be a good design unless the same application owns both schemas. If each schema is used by different application and that only the second schema is populated with data realtime which is needed by the other application then you can create a new table and refresh it from the other schema in real time as well. You can check Materialized views (fast refresh, incremental refresh, using rowid, etc) for this purpose or you can also look at various other options (using trigger on the second schema to populate the new table in your schema and keep this in sync with that).
    Just for your information, Materialized views is a feature of EE. Tell us more about your environment

  • Retrive a new sequence value from a table using Stored Procedure

    Dear experts
    i have written the following stored procedure, but i want this to return itemid to the environment. Please help as i am absolutely new to oracle.
    create or replace procedure "SP_ITEMS"
    (vitem IN VARCHAR2,
    vqty IN NUMBER,
    vrate IN NUMBER)
    is
    begin
    INSERT INTO ITEMS (item,qty,rate)
    VALUES (vitem,vqty,vrate);
    end;
    Thanks
    With regards
    Manish Sawjiani

    If you want a column to be automatically populated with a sequence, then you need to create a sequence, and create a trigger to populate the column with the sequence. You can use the returning clause in a select statement to return the value of the inserted sequence. You can do this with just sql or you can put it in a procedure. I have demonstrated both below. This is a general sql and pl/sql problem, not something specific to the Express Edition, so please post future such questions in the sql and pl/sql discussion group instead.
    SCOTT@10gXE> CREATE TABLE items
      2    (itemid NUMBER,
      3       item   VARCHAR2 (50),
      4       qty    NUMBER (10, 3),
      5       rate   NUMBER (10, 3))
      6  /
    Table created.
    SCOTT@10gXE> CREATE SEQUENCE item_sequence
      2  /
    Sequence created.
    SCOTT@10gXE> CREATE OR REPLACE TRIGGER items_bir
      2    BEFORE INSERT ON items
      3    FOR EACH ROW
      4  BEGIN
      5    SELECT item_sequence.NEXTVAL
      6    INTO   :NEW.itemid
      7    FROM   DUAL;
      8  END items_bir;
      9  /
    Trigger created.
    SCOTT@10gXE> SHOW ERRORS
    No errors.
    SCOTT@10gXE> VARIABLE g_itemid NUMBER
    SCOTT@10gXE> INSERT INTO items (item, qty, rate)
      2  VALUES ('item1', 2, 3)
      3  RETURNING itemid INTO :g_itemid
      4  /
    1 row created.
    SCOTT@10gXE> PRINT g_itemid
      G_ITEMID
             1
    SCOTT@10gXE> CREATE OR REPLACE PROCEDURE sp_items
      2    (p_item      IN  VARCHAR2,
      3       p_qty      IN  NUMBER,
      4       p_rate      IN  NUMBER,
      5       p_itemid OUT NUMBER)
      6  AS
      7  BEGIN
      8    INSERT INTO ITEMS (item, qty, rate)
      9    VALUES (p_item, p_qty, p_rate)
    10    RETURNING itemid INTO p_itemid;
    11  END sp_items;
    12  /
    Procedure created.
    SCOTT@10gXE> SHOW ERRORS
    No errors.
    SCOTT@10gXE> EXECUTE sp_items ('item2', 3, 4, :g_itemid)
    PL/SQL procedure successfully completed.
    SCOTT@10gXE> PRINT g_itemid
      G_ITEMID
             2
    SCOTT@10gXE> SELECT * FROM items
      2  /
        ITEMID ITEM                                                      QTY       RATE
             1 item1                                                       2          3
             2 item2                                                       3          4
    2 rows selected.
    SCOTT@10gXE>

  • Possibility of Coping constraints from another schema

    Hi,
    If i drop all constraints of a table in TEST; then is it possible to create constraints on that table from same(with same name and structure) table in PRODUCTION.
    Thanks,
    Vidya

    real quick, may be of help
    SQL> ed
    Wrote file afiedt.buf
      1   SELECT 'alter table  '||f.TABLE_NAME||' add ( constraint '|| FOREIGN.constraint_name
      2          ||'  FOREIGN KEY ('||f.COLUMN_NAME ||')  REFERENCES '|| p.TABLE_NAME||'( '||p.COLUMN_NAME||
      3   FROM user_constraints PRIMARY, user_constraints FOREIGN,user_cons_columns  p, user_cons_column
      4   WHERE PRIMARY.constraint_type = 'P'
      5      AND FOREIGN.constraint_type = 'R'
      6      AND PRIMARY.owner = FOREIGN.r_owner
      7      AND PRIMARY.constraint_name = FOREIGN.r_constraint_name
      8   AND PRIMARY.table_name = p.table_name
      9       AND PRIMARY.constraint_name = p.constraint_name
    10* AND FOREIGN.constraint_name = f.constraint_name
    11  /
    'ALTERTABLE'||F.TABLE_NAME||'ADD(CONSTRAINT'||FOREIGN.CONSTRAINT_NAME||'FOREIGNKEY('||F.COLUMN_NAME|
    alter table  EMP add ( constraint FK_DEPTNO  FOREIGN KEY (DNO)  REFERENCES DEPT( DEPTNO));

  • How can i access all the objects of one schema from another schema

    Dear All,
    How can i access all the objects(Tables,Views,Triggers,Procedures,Functions,Packages etc..) and do the modifications of one schema from another schema (Without using synonyms concept).
    Thanks in advance,
    Mahi

    First of all, synonyms only help you easy reference the object. It doesn't have any implication of object privilege.
    As long as you have proper privilege on target object. You can access it with or without synonyms.
    Assuming you have proper privilege of objects, you can use following command to assume schema owner.
    ALTER SESSION SET CURRENT_SCHEMA = Schema_owner

  • SSIS 2012 ETL is failing only at one server (No BIDS) but running successfully from BIDS on different sever . In this ETL, I have used Stored Procedure in OLEDB Source.

    Hi Guys,
    SSIS 2012 ETL is failing only at one server (No BIDS) but running successfully from BIDS on different sever . In this ETL, I have used Stored Procedure in OLEDB Source.
    Note: I have couple of ETLs developed in 2005 using same logic and upgraded to 2012, working perfectly.
    I am getting Error Message:
    SSIS
    Error Code
    DTS_E_OLEDBERROR. 
    An OLE DB
    error has occurred.
    Error code: 0x80004005.
    An
    OLE DB
    record is available. 
    Source: "Microsoft OLE DB Provider for SQL Server" 
    Hresult: 0x80004005 
    Description: "Error converting data type varchar to datetime.".
    Unable
    to retrieve
    column information
    from the data
    source. Make
    sure your target
    table in
    the database is
    available.
    "OLE DB Source"
    failed validation
    and returned
    validation status
    "VS_ISBROKEN".
    I tried below word around and found It is working perfectly.
    I loaded data into a table (dbo.TEMP) using Stored procedure and then I used this dbo.TEMP table in OLEDB source and then found no issue.
    MY SP Details: (This SP I am calling in OLEDB source of ETL) and when I run it from one server IT is working fine and when I run from ETL dedicated Server getting error:   Guys Help me out.
    USE
    [TEST_DB]
    GO
    SET
    ANSI_NULLS ON
    GO
    SET
    QUOTED_IDENTIFIER ON
    GO
    ALTER
    PROCEDURE  [DBO].[SP_TEST]
    --EXEC [DBO].[SP_TEST] '2014-09-30','2014-10-01'
    @FROMDATETIME
    DATETIME,
    @TODATETIME
    DATETIME
    AS
    SET
    NOCOUNT ON
    BEGIN
    DECLARE
    @FROMDATEKEY INT,
    @TODATEKEY INT,
    SET
    @FROMDATEKEY=
    CONVERT(VARCHAR(10),@FROMDATETIME,112)
    SET
    @TODATEKEY=
    CONVERT(VARCHAR(10),@TODATETIME,112)
    IF 1 = 1
    BEGIN
    SELECT
    CAST(NULL
    AS DATETIME) 
    AS TXN_DATE
    , CAST(NULL
    AS DATETIME
    ) AS PROCESS_DATE     
    , CAST(NULL
    AS money)
    AS  S1_AMT
    , CAST(NULL
    AS money)
    AS  S2_AMOUNT
    , CAST(NULL
    AS money)
    AS  S2_INVALID_AMOUNT
    , CAST(NULL
    AS money)
    AS  INVALID_MOVED_IN_VALID_S2_AMOUNT
    , CAST(NULL
    AS VARCHAR(20))
    AS SYSTEM_ID
    , CAST(NULL
    AS money)
    AS  S3_AMT
    END
    SELECT
    TXN_DATE
    ,PROCESS_DATE
    ,S1_AMT
    ,S2_AMOUNT
    ,S2_INVALID_AMOUNT
    ,INVALID_MOVED_IN_VALID_S2_AMOUNT
    ,SYSTEM_ID
    S3_AMT
    FROM
    DBO.TABLE_1
    WHERE TNX_DATE_KEY
    BETWEEN @FROMDATEKEY
    and @TODATEKEY
    UNION
    ALL
    SELECT
    TXN_DATE
    ,PROCESS_DATE
    ,S1_AMT
    ,S2_AMOUNT
    ,S2_INVALID_AMOUNT
    ,INVALID_MOVED_IN_VALID_S2_AMOUNT
    ,SYSTEM_ID
    S3_AMT
    FROM
    DBO.TABLE_2
    WHERE TNX_DATE_KEY
    BETWEEN @FROMDATEKEY
    and @TODATEKEY
    UNION
    ALL
    SELECT
    TXN_DATE
    ,PROCESS_DATE
    ,S1_AMT
    ,S2_AMOUNT
    ,S2_INVALID_AMOUNT
    ,INVALID_MOVED_IN_VALID_S2_AMOUNT
    ,SYSTEM_ID
    S3_AMT
    FROM
    DBO.TABLE_3
    WHERE TNX_DATE_KEY
    BETWEEN @FROMDATEKEY
    and @TODATEKEY
    END
    Data Source Mode: SQL Command for Variable
    "EXEC [DBO].[SP_TEST]  '"+ (DT_WSTR, 24) @[User::V_EXTRACT_FROM_DT]  +"','"+ (DT_WSTR, 24) @[User::V_EXTRACT_TO_DT]  +"'"
    Where variable @[User::V_EXTRACT_FROM_DT] and @[User::V_EXTRACT_TO_DT] is defined as DATETIME 
    Thanks Shiven:) If Answer is Helpful, Please Vote

    Hi,
    Yes you are right. At one sever where I was getting error, DateTime was in USA format and Where It was running successfully was in AUS format.
    I changed from USA to AUS and I did another changes:
    Data Source Mode: SQL
    Command
    EXEC  [DBO].[SP_TEST] 
    @FROMDATETIME = ?,
    @TODATETIME = ?
    and It is working fine.
    Thanks Shiven:) If Answer is Helpful, Please Vote

  • Is it possible to export tables from diffrent schema using expdp?

    Hi,
    We can export tables from different schema using exp. Ex: exp user/pass file=sample.dmp log=sample.log tables=scott.dept,system.sales ...But
    Is it possible in expdp?
    Thanks in advance ..
    Thanks,

    Hi,
    you have to use "schemas=user1,user2 include=table:"in('table1,table2')" use parfileexpdp scott/tiger@db10g schemas=SCOTT include=TABLE:"IN ('EMP', 'DEPT')" directory=TEST_DIR dumpfile=SCOTT.dmp logfile=expdpSCOTT.log{quote}
    I am not able to perform it using parfile also.Using parfile it shows "UDE-00010: multiple job modes requested, schema and tables."
    When trying the below, i get error
    {code}
    bash-3.00$ expdp directory=EXP_DUMP dumpfile=test.dmp logfile=test.log SCHEMAS=(\'MM\',\'MMM\') include=TABLE:\"IN\(\'EA_EET_TMP\',\'WS_DT\'\)\"
    Export: Release 10.2.0.4.0 - 64bit Production on Friday, 15 October, 2010 18:34:32
    Copyright (c) 2003, 2007, Oracle. All rights reserved.
    Username: / as sysdba
    Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    Starting "SYS"."SYS_EXPORT_SCHEMA_01": /******** AS SYSDBA directory=EXP_DUMP dumpfile=test.dmp logfile=test.log SCHEMAS=('MM','MMM') include=TABLE:"IN('EA_EET_TMP','WS_DT')"
    Estimate in progress using BLOCKS method...
    Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
    Total estimation using BLOCKS method: 0 KB
    Processing object type SCHEMA_EXPORT/TABLE/TABLE
    Processing object type SCHEMA_EXPORT/TABLE/INDEX/INDEX
    Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/CONSTRAINT
    Processing object type SCHEMA_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
    Processing object type SCHEMA_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
    . . exported "MM"."EA_EET_TMP" 0 KB 0 rows
    ORA-39165: Schema MMM was not found.
    Master table "SYS"."SYS_EXPORT_SCHEMA_01" successfully loaded/unloaded
    Dump file set for SYS.SYS_EXPORT_SCHEMA_01 is:
    /export/home/nucleus/dump/test.dmp
    Job "SYS"."SYS_EXPORT_SCHEMA_01" completed with 1 error(s) at 18:35:19
    {code}
    When checking expdp help=y shows :-
    {code}TABLES Identifies a list of tables to export - one schema only.{code}
    As per few testing,tables from different schemas are not possible to export using expdp in a single command.
    Anand

  • How to extract all keys (PK, FK) and constraints from the schema?

    hi,
    How to extract all keys (PK, FK) and constraints from the schema?Thanks!

    I have no idea about any tool which only extract the DDL of constraints.
    In oracle 9i or above you can use DBMS_METADATA to extract DDL of a table which also shows contraints defination.
    You can take the tables export without data and use databee tool to extract the DDL.
    www.databee.com

  • Selection from Another schema by default without schema name qualifier.

    Hi
    Oracle10g release 2, LinuxOS
    i want my schema (User_1) to always select,insert, update, delete the objects from another schema (User_2) without passing full schema qualifier every time whenever i don't pass any schema name explicitly.
    i.e. if i pass the following guerry
    select * from table_a;
    the table of user User_2.table_a (User_2.table_a) will be queried by default instead of table (User_1.table_a)
    and the same implementation is also required in Functions , procedures, sequences etc.
    Wishes

    Three relatively easy options
    1) Create private synonyms in User_1's schema for each object in User_2's schema, i.e.
    CREATE SYNONYM table_a
       FOR user_2.table_a2) Create public synonyms for each object in User_2's schema. This will make it possible for all users to query user_2's objects without specifying the schema name
    CREATE PUBLIC SYNONYM table_a
       FOR user_2.table_a3) Change the current schema for the session (potentially in a login trigger)
    ALTER SESSION SET current_schema = USER_2There are other options that are a bit more complicated like using enterprise users with shared schemas. But most people are perfectly happy with one of these three.
    Justin

  • Selecting from another schema

    If I want to select table from another schema, I have to type
    select * from [username].table_name.
    What can I do inorder not to write shema name all the time.
    for instance:
    instead of writing
    select * from [username].table_name.
    select * from table_name.

    create synonym for the object in other schema:
    create synonym <syn-name> for schema.tablename;
    then use syn-name in place of schema.tablename in ur query
    like
    select * from syn-name;

  • SQL Report From Another  Schema

    Is there anyway to select a table from another schema?I have a default schema for my application but i want each user to use their own schema.
    I'm looking for something like #OWNER#.table_name but replacing #OWNER# with the name of another schema in the workspace.
    Kind Regards,
    BgUrsea
    APEX 4.0 10g XE

    Hello BgUrsea,
    you could achieve this by granting the needed privileges (e.g. select, insert, update, delete) on each table in the #OWNER#-schema to your applications parsing schema.
    If you can't use a direct mapping (e.g., you can't assign the schema name of a user as usernames for his application user), you probably need a mapping table in your parsing schema. Define an application item (e.g. "F_OWNER") and create a application computation that executes "On New Instance" and does something like
    SELECT schema
      FROM mapping_table
    WHERE owner=v('APP_USER');If you aren't sure you always have a mapping, you might think about an application process that not only computes the value but also handles the action to be performed in case there is no mapping for a user.
    But I suppose it could be easier to have a copy of you application for each user and assign the appropriate schema to each copy. That way, you don't need the mapping, you don't need to care about always using the #OWNER# when developing your application, and of course, no user can (not even accidently) access another users (or your default) schema.
    -Udo

  • I'm trying to clone a internal hard drive from another mac using a usb connection.

    I'm trying to clone a internal hard drive from another mac using a usb connection to an external drive so that I don't lose the file before reinstalling the software but I keep on getting a message:
    "Restore Failure
    Source volume is read-write and cannot be unmounted, so it can't be block copied."
    Any advice on how to make a copy of this internal drive?
    Thanks!
    ....also the internal hard drive i am trying to copying run on a mac os x 10.5 and i'm reinstalling the software because the computer is not starting and only shows a grey folder with a question marks inside.

    I've had my Maxtor external OneTouch 250GB for about 18 months now and it hasn't skipped a beat. I have hear of people having their Maxtor drive just up and die but you will probably find that goes for all manufacturers.
    By the way, Maxtor is, amongst others, an OEM supplier to Apple.

  • Best way To get data from another application using NDDE lbrary

    My vb.net application gets data from another application using NDDE Library. I got stocks prices (open,high,low,close,volume,change......(about 15 records for each stock)) (about 200 stocks) . I don't know if there is a problem in my code.
    This is my code:
    l : is the list of stocks.
    This Sub connects to server and requests the data :
    Public Shared Sub GetQuotes()
    Try
    client1 = New DdeClient(server, topic)
    client1.Connect()
    For i As Integer = 0 To l.Count - 1
    client1.StartAdvise("QO." & l(i).t & ".TAD$last", 1, True, 60000)
    client1.StartAdvise("QO." & l(i).t & ".TAD$open", 1, True, 60000)
    client1.StartAdvise("QO." & l(i).t & ".TAD$high", 1, True, 60000)
    client1.StartAdvise("QO." & l(i).t & ".TAD$low", 1, True, 60000)
    client1.StartAdvise("QO." & l(i).t & ".TAD$pclose", 1, True, 60000)
    client1.StartAdvise("QO." & l(i).t & ".TAD$volume", 1, True, 60000)
    client1.StartAdvise("QO." & l(i).t & ".TAD$date", 1, True, 60000)
    client1.StartAdvise("QO." & l(i).t & ".TAD$time", 1, True, 60000)
    Next
    Catch ex As Exception
    MsgBox(ex.Message)
    End Try
    End Sub
    and then I get the data from Client_advise sub (called each time a value changed )and fill the list. What I know is that client advise gets only one record for single stock each time is called..
    Example: for stock AAPL. 1st time enters client_Advise I get open price for AAPL, 2nd time I get high price for AAPL,3rd time I get low price..... and I update the value in the List (l)
    This the client_Advise Sub:
    Private Shared Sub client1_Advise(ByVal sender As Object, ByVal e As NDde.Client.DdeAdviseEventArgs) Handles client1.Advise
    For q As Integer = 0 To l.Count - 1
    If l(q).t = w(1) Then
    Dim item() As String = e.Item.Split("$")
    If l(q).Open = "#" Then
    l(q).Open = "0"
    End If
    If l(q).hi = "#" Then
    l(q).hi = "0"
    End If
    If l(q).lo = "#" Then
    l(q).lo = "0"
    End If
    If l(q).Close = "" Or l(q).Close = "#" Then
    l(q).Close = "0"
    End If
    If l(q).pclose = "#" Then
    l(q).pclose = "0"
    End If
    If item(1) = "open" Then
    l(q).Open = Format(Val(e.Text), "0.00")
    ElseIf item(1) = "last" Then
    l(q).Close = Format(Val(e.Text), "0.00")
    ElseIf item(1) = "high" Then
    l(q).hi = Format(Val(e.Text), "0.00")
    ElseIf item(1) = "volume" Then
    l(q).Volume = Val(e.Text)
    ElseIf item(1) = "low" Then
    l(q).lo = Format(Val(e.Text), "0.00")
    ElseIf item(1) = "pclose" Then
    l(q).pclose = Format(Val(e.Text), "0.00")
    If l(q).pclose <> "" And l(q).pclose <> "#" And l(q).Close <> "" And l(q).Close <> "#" Then
    l(q).c = Format(l(q).Close - l(q).pclose, "0.00")
    l(q).cp = Format(((l(q).Close - l(q).pclose) / l(q).pclose) * 100, "0.00")
    End If
    l(q).flag1 = 2
    ElseIf item(1) = "date" Then
    l(q).Date1 = e.Text
    ElseIf item(1) = "time" Then
    l(q).Time = e.Text
    End If
    Exit For
    End If
    Next
    End Sub
    Am I doing something wrong which inreases CPU usage to 80 or 90 % ?
    Thanks in advance.

    Hi MikeHammadi,
    According to your description, you'd like to get data from another app using NDDE library.
    When using the NDDE library, the CPU usage is high. As the NDDE library is third-party library, it is not supported here. I suggest you checking if the problem is caused by the NDDE library.
    If you'd like to get data from another app. I suggest you could save the data in the dataBase, and then read it in another application if necessary.
    If you have any other concern regarding this issue, please feel free to let me know.
    Best regards,
    Youjun Tang
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How to run ssis 2012 package deployed on SSISDB using stored procedures from [SSISDB].[catalog] by regular AD accounts ?

    Hello, I need to run ssis package by stored proc(pass parameters inside and get result using stored procedures [SSISDB].[catalog].[create_execution]) etc. Do not suggest me to use SQL Agent here as this is not the case. or by pass this using configuration
    for SSIS, I need to know what permission I'm missing if those stored proc run by AD account, with rights described from BOL and I'm having "The current security
    context cannot be reverted. Please switch to the original database where 'Execute As' was called and try it again." If I schedule stored proc to run by Agent and specify parameters - will work, from remote PC - does not.  I have sysdamin
    rights on the server where SSIS and stored proc which is call it exists.   I was digging around and have ugly solution to make it working, I want to use elegant solution using those stored proc from [SSISDB].[catalog] ...
    Any help especially from Microsoft guys here...?
    Vladimir

    >>>>If I schedule stored proc to run by Agent and specify parameters - will work,
    from remote PC - does not. 
    Vova
    If you schedule the job it will be running under SQL Server Agent account security....  What error
    do you get when you run the SP from remote PC?
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • FETCHING VALUES IN MULTI RECORD BLOCK FROM ANOTHER TABLE USING SELECT STATEMENT.

    Hi,
    I have one multi record block in which i want to fetch values
    (more then one record) from another table using select statement
    IN KEY NEXT ITEM.I am getting following error.
    ORA-01422: exact fetch returns more than requested number of rows
    Thanks in advance.

    In your case I see no reason to use non-database block and to try to populate it from a trigger with a query, instead of using the default forms functionality where you can associate the block and the fields with table, create where clause using bind variables and simply use execute_query() build-in to populate the block. The power of the forms is to use their build-in functionality to interact with the database.
    Also, you can base your block on a query, not on a table and you dynamically change this query using set_block_property() build-in. You can use any dynamic queries (based on different data sources) and you simply need to control the column's data type, the number of the columns and their aliases. Something like creating inline views as a block data source.
    However, you can replace the explicit cursor with implicit one like
    go_block('non_db_block_name');
    first_record();
    FOR v_tab IN (SELECT *
    FROM tab
    WHERE col_name = :variable)
    LOOP
    :non_db_block_name.field1 := v_tab.col1;
    :non_db_block_name.field2 := v_tab.col2;
    next_record();
    END LOOP;

Maybe you are looking for

  • SECess in ARE1 not getting populated at Item level

    Hi, I am creating ARE1 based on outgoing excise invoice. In my outgoing excise invoice all excise duties are getting populated at Header level & also at item level. but in my ARE 1 document SECess is coming at header level only & not at item level, o

  • Problem with enter key in the quiz templates

    hi, I need some i am using quiz templates and my problem is when i make the swf file and test the quiz it works good , but when i press the enter key , the quiz doesn't work and repeat and go to the first screen , i don't know if i have to block the

  • FOIs not appearing in MapViewer with Internet Explorer

    I am using MapViewer 10133p5 and having some trouble placing FOIs in Internet Explorer (that is to say, the code that seems to be working fine in Firefox fails in IE). I have reduced my HTML to what I think are the bare essentials and pasted its cont

  • Anyone else have uneven lid when macbook is closed???

    when i close my macbook the is raised a tad more on the right side than the left.....it is raised maybe a millimeter more than the left side....anyone else have this probelm and know how to fix it??

  • Does Closed Captioning display differently from one Player/TV to another?

    Hi Everyone, We just completed our first project at our facility that involved Closed Captioning from an .SCC file produced by CPC and when we preview a DVD Test of the project, the captions are not displaying as expected. We received a VHS preview c