Geting  a data from others schemas

Well I have the a problem I'm working in the schema Base and I need to know if an element exist in another schema , this schema is variable .
I have make this code , but is not ok
FUNCTION E_VEH (
BD VARCHAR2, V_VE NUMBER )
RETURN BOOLEAN
IS
NUMERO INTEGER;
V_SENTENCIA VARCHAR2(500);
BEGIN
V_SENTENCIA:=' SELECT COUNT() INTO NUMERO FROM :A.VEH
WHERE ID_VEH = :B' ;
EXECUTE IMMEDIATE V_SENTENCIA USING BD,V_VE;
RETURN (NUMERO > 0);
END;

Now I'm using the into stament but I'm getting the following error:
11:44:38 Target session: ORA-01006: la variable ligada no existe
This is my code :
FUNCTION EX_VEH (
BD VARCHAR2, D_VE NUMBER )
RETURN BOOLEAN
IS
NUMERO INTEGER;
V_SENTENCIA VARCHAR2(500);
BEGIN
V_SENTENCIA:=' SELECT COUNT(ID_VE) FROM :A.VEH WHERE ID_VEH = :B' ;
EXECUTE IMMEDIATE V_SENTENCIA INTO NUMERO USING BD,V_ID_VEH;
RETURN (NUMERO > 0);
END;

Similar Messages

  • Merging data from 2 schemas with same object structure into one schema

    Hi
    I want to merge data from 2 schemas in different environments ( say test1 and test 2) into 1 schema ( say Test_final) for testing. Both these schemas are having same structure, the data can be same or different.
    What I did is that I took an export of schema on Test1 and then import it into Test_final. Now I need to merge/append data from Test2 into Test_final.
    I can not merge the data with import due to primary key constraints and also import doesnt support this feature, so I tried SQL*Loader to "append" the data by using sequence to generate Primary key.
    But my worries are that since new primary keys are generated so foreign keys will become invalidated and the data will not be consistent.
    Is there any other way to do this task..
    Regards
    Raman

    This approach might be better...
    create table test_final
    as
    select *
    from schema1.test1
    insert into test_final
    select t2.* from schema2.test1 ,  test_final tf
    where t2.pk != tf.pk
    /...assuming duplicate primary keys mean duplicate records. If that assumption is not the case then you have a more complex data migration exercise on your hands and you need to figure out some rules to determine which version of the data takes precedence.
    Cheers, APC

  • How to view the datas from one schema  to another

    Hi,
    I am working in Oracle9i and solaris 5.8.
    I create a new schema but no datas.
    i need to read the datas from another schema having datas through the newly created schema.
    pls explain me with query

    OK use following procedure to grant select access on all tables of another schema.
    CREATE OR REPLACE PROCEDURE GRANT_SELECT AS
    CURSOR ut_cur IS
    SELECT table_name
    FROM user_tables;
    RetVal NUMBER;
    sCursor INT;
    sqlstr VARCHAR2(250);
    BEGIN
    FOR ut_rec IN user_tabs_cur;
    LOOP
    sqlstr := 'GRANT SELECT ON '|| ut_rec.table_name
    || ' TO jwc7675';
    sCursor := dbms_sql.open_cursor;
    dbms_sql.parse(sCursor,sqlstr, dbms_sql.native);
    RetVal := dbms_sql.execute(sCursor);
    dbms_sql.close_cursor(sCursor);
    END LOOP;
    END grant_select;
    Regards,
    Sandy

  • Inserting the data into other schema..

    Hi,
    Can any body help me to write the pl/sql code to insert the data into other schema
    eg: A and B two schemas are there
    In B there is a table with the name EM_Rep. When i was writting the pl sql code to insert the data into B.EM_Rep from A Schema it is throughing an error like
    PL/SQL: ORA-00942: table or view does not exist
    Note: I have given the grant like
    connected to user b
    sqL> grant insert on EM_Rep to A;
    PROCEDURE INS_EM()
    AS
    BEGIN
    insert into B.EM_Rep values('999999','test');
    END;
    its throughing an error like table doesnot exist....
    can any body tell ..how to write ...
    Thanks,

    It worked for me
    SQL> grant connect, resource to a identified by a;
    Grant succeeded.
    SQL> grant connect, resource to b identified by b;
    Grant succeeded.
    SQL> connect b/b
    Connected.
    SQL> create table em_rep (col1 varchar2(10), col2 varchar2(10));
    Table created.
    SQL> grant insert on em_rep to a;
    Grant succeeded.
    SQL> connect a/a
    Connected.
    SQL> create or replace
      2  PROCEDURE INS_EM
      3  AS
      4  BEGIN
      5  insert into B.EM_Rep values('999999','test');
      6  END;
      7  /
    Procedure created.
    SQL> exec ins_em;
    PL/SQL procedure successfully completed.
    SQL> commit;
    Commit complete.
    SQL> connect b/b
    Connected.
    SQL> select * from em_rep;
    COL1       COL2
    999999     test
    SQL>

  • Filling dynamic internal table with data from other internal table

    Hi Friends,
    My problem is that i have already built a dynamic internal table
    (class int_table->create) but now i want to fill it with data from other internal table.
    The dynamic table column name and the field value of the data filled internal table are same, but how to access that column name, since i cant hard code it anyway.
    Like if my werks field value is '8001'. I want to place it under the column 8001 of dynamic table, Can anybody help me in this regard?
    Awarding points is not a problem for even giving a slight hint.
    Best Regards

    Hi
    See this
    Dynamic internal table is internal table that we create on the fly with flexible column numbers.
    For sample code, please look at this code tutorial. Hopefully it can help you
    Check this link:
    http://www.****************/Tutorials/ABAP/DynamicInternaltable/DynamicInternalTable.htm
    Sample code:
    DATA: l_cnt(2) TYPE n,
    l_cnt1(3) TYPE n,
    l_nam(12),
    l_con(18) TYPE c,
    l_con1(18) TYPE c,
    lf_mat TYPE matnr.
    SORT it_bom_expl BY bom_comp bom_mat level.
    CLEAR: l_cnt1, <fs_dyn_wa>.
    Looping the component internal table
    LOOP AT it_bom_expl INTO gf_it_bom_expl.
    CLEAR: l_cnt1.
    AT NEW bom_comp.
    CLEAR: l_cnt, <fs_dyn_wa>, lf_mat.
    For every new bom component the material data is moved to
    temp material table which will be used for assigning the levels
    checking the count
    it_mat_temp[] = it_mat[].
    Component data is been assigned to the field symbol which is checked
    against the field of dynamic internal table and the value of the
    component number is been passed to the dynamic internal table field
    value.
    ASSIGN COMPONENT c_comp_list OF STRUCTURE <fs_dyn_wa> TO
    <fs_check>.
    <fs_check> = gf_it_bom_expl-bom_comp.
    ENDAT.
    AT NEW bom_mat.
    CLEAR l_con.
    ENDAT.
    lf_mat = gf_it_bom_expl-bom_mat.
    Looping the temp internal table and looping the dynamic internal table
    *by reading line by line into workarea, the materialxxn is been assigned
    to field symbol which will be checked and used.
    LOOP AT it_mat_temp.
    l_nam = c_mat.
    l_cnt1 = l_cnt1 + 1.
    CONCATENATE l_nam l_cnt1 INTO l_nam.
    LOOP AT <fs_dyn_table2> ASSIGNING <fs_dyn_wa2>.
    ASSIGN COMPONENT l_nam OF STRUCTURE <fs_dyn_wa2> TO <fs_xy>.
    ENDLOOP.
    IF <fs_xy> = lf_mat.
    CLEAR lf_mat.
    l_con1 = l_con.
    ENDIF.
    Checking whether the material exists for a component and if so it is
    been assigned to the field symbol which is checked against the field
    of dynamic internal table and the level of the component number
    against material is been passed to the dynamic internal table field
    value.
    IF <fs_xy> = gf_it_bom_expl-bom_mat.
    ASSIGN COMPONENT l_nam OF STRUCTURE <fs_dyn_wa> TO <fs_check>.
    CLEAR l_con.
    MOVE gf_it_bom_expl-level TO l_con.
    CONCATENATE c_val_l l_con INTO l_con.
    CONDENSE l_con NO-GAPS.
    IF l_con1 NE space.
    CONCATENATE l_con1 l_con INTO l_con SEPARATED BY c_comma.
    CLEAR l_con1.
    l_cnt = l_cnt - 1.
    ENDIF.
    <fs_check> = l_con.
    l_cnt = l_cnt + 1.
    ENDIF.
    ENDLOOP.
    AT END OF bom_comp.
    At end of every new bom component the count is moved to the field
    symbol which is checked against the field of dynamic internal table
    and the count is been passed to the dynamic internal table field
    value.
    ASSIGN COMPONENT c_count OF STRUCTURE <fs_dyn_wa> TO <fs_check>.
    <fs_check> = l_cnt.
    INSERT <fs_dyn_wa> INTO TABLE <fs_dyn_table>.
    ENDAT.
    ENDLOOP.
    Reward if useful
    Anji

  • Accessing data from other SAP system

    Hi experts
    I need to access data from one SAP system from other.  My requirement is , perform applications (programs) in some SAP system, but using/accessing  data from other SAP system .
    For example, when we press F4 we get the match code (search help) for the field ;  that window is alredy created by SAP and it shows the data for that field . Of course the application (ike any other program/application) read the data from the SAP system is being executing ;  well i need execute that match code but show (taking) the data from other SAP system;  i not refer to other MANDT in same system but other SAP system.
    The communication between SAP1 system and SAP2 system is already created from BASIS.
    My doubt is how can i  execute that standard application (search help) but 'invoke' to standard application this take data from other system ?
    I guess i can create Z search help wich call a Z Function (RFC) to get the data required from the other system ;
    or maybe enhance the standar search help to call that Z RFC ;  but standard application search help is already created and this access the data in several ways or places of code , and this has severals sub-windows and search features ; and i just need execute exactly same search help but accesing data from the other SAP system ; so my doubt is, is there some way to indicate to SAP the applications always (wherever) these applications acces the data do it but from other SAP system, 
    like if we 'redirect' the Data Base to other SAP system. 
    SAP1 applications are being executing  -
    >   but all data (records) are taking from SAP2
    Maybe the first suggestion is simply why do not we execute applications in SAP2 instead SAP1 , that's because the version package in SAP2 system (where we have the data) does not support some (non SAP) applications we need to use.
    Excuse the long thread.  Does somebody can help, any idea ?
    Best Regards
    Frank

    Hi Frank,
    Below are my thoughts, these are only conceptual and haven't had an opportunity to try these possibilities, also not sure if this is the right thing.
    1) Create an entry in DBCON using TCode: DBCO for the Database of system SAP2. Now in the application of SAP1 use the "SET CONNECTION" construct as the very first statement, so that consecutive SQL statements will point at the DB of SAP2.
    2) I have read somewhere that the Work Processes are connected to the Default database and i am not sure if you can change this setting, but if you can and provided you have have multiple application servers in your SAP1 landscape, then pick one of the application servers and change the settings on the WP to point at the DB of SAP2, you have the end users login to this particualr app server.
    3) If there are multiple app servers in SAP1 landscape, then choose one of the app servers and change the default database setting to point at DB of SAP2.
    Regards,
    Chen

  • "Error occurs when loading transaction data from other model" - BW loading into BPC

    Hi Experts,
    I'm having a problem with my data loading from BW, using the standard Load InfoProvider Selections data manager package.
    If I run for a period without data it succeeds (with warning) but if there is data to be extracted I get the following error:
    Task name CONVERT:
    No 1 Round:
    Error occurs when loading transaction data from other model
    model: AIACONS. Package status: ERROR
    As it runs ok when there isn't data it appears there is something preventing the movements of data out of the cube itself, rather then a validation issue.
    Has anyone encountered similar or have any ideas as to the problem?
    Best,
    Chris

    Hi Vadim,
    It's not specific to the transformation file as I have tried with others for the same BW cube and get the same result.
    We get a warning when we try and validate the transformation file:
    "Error occurs when loading transaction data from other model".
    This only appears in the validation pop up and doesn't throw up any warnings about the transformation file itself.  The validation log says:
    Validate  and Process Transformation File Log
    Log creation time
    3/7/2014 16:09
    The result of validation of the
      conversion file
    SUCCESS
    The result of validation of the
      conversion file with the data file
    FAIL
    Validation Result
    Validation Option
    ValidateRecords = NO
    Message
    Error occurs when loading transaction data from other model
    Reject List
    I can't find any errors anywhere else.
    Best,
    Chris

  • Error occurs when loading transaction data from other model

    Hello Experts, I am trying to validate my transformation file and I can see peculiar behaviour of the transformation file. Even though the transformation file is not complete/  complete with all the mappings, i am getting the same error as above.
         I can see options, mapping and conversion sections are validating successfully and throwing the above error.
    Incomplete Transformation File
    *OPTIONS
    FORMAT = DELIMITED
    HEADER = YES
    DELIMITER = ,
    AMOUNTDECIMALPOINT = .
    SKIP = 0
    SKIPIF =
    VALIDATERECORDS=YES
    CREDITPOSITIVE=YES
    MAXREJECTCOUNT= 10
    ROUNDAMOUNT=
    *MAPPING
    CUSTOMER = *NEWCOL (NO_CUST)
    Validating the transformation files
    Validating options...
    Validation of options was successful.
    Validating mappings...
    Validation of mappings was successful.
    Validating conversions...
    Validation of the conversion was successful
    Creating the transformation xml file. Please wait...
    Transformation xml file has been saved successfully.
    Begin validate transformation file with data file...
    [Start test transformation file]
    Validate has successfully completed
    ValidateRecords = YES
    Error occurs when loading transaction data from other model
    Validation with data file failed
                           I am getting the same error with complete transformation file also. Please let me know where I am doing the mistake or is it a system error?
    Thanking you
    Praveen

    Hi,
    By
    *MAPPING
    CUSTOMER = *NEWCOL (NO_CUST)
    you want CUSTOMER to receive a fixed string "NO_CUST"?
    If so use,
    *MAPPING
    CUSTOMER = *STR (NO_CUST)

  • Error occurs when loading transaction data from other cube

    Hi Gurus,
    I'm currently working on a Transformation File for loading Transactional Data from BW to BPC but a error message is displayed "Error occurs when loading transaction data from other cube". I have already checked permissions for my user, double checked my transformation file and the dimensions, made all conversion files needed and the message has not changed.
    Can anybody help me to solve this problem?!
    Thanks a lot & Best Regards,
    HH

    Hi,
    Here, the Transformation File & Conversion File. I have already tested both with another different InfoCube and they work but no for the one needed.
    *OPTIONS
    FORMAT = DELIMITED
    HEADER = YES
    DELIMITER = ,
    AMOUNTDECIMALPOINT = .
    SKIP = 0
    SKIPIF =
    VALIDATERECORDS=YES
    CREDITPOSITIVE=YES
    MAXREJECTCOUNT=
    ROUNDAMOUNT=
    *MAPPING
    Category=*NEWCOL(ACTUAL)
    P_0BASE_UOM=0BASE_UOM
    P_0BUS_AREA=0BUS_AREA
    P_0COSTCENTER=0COSTCENTER
    P_0FUNDS_CTR=*NEWCOL(null)
    P_0GL_ACCOUNT=0ACCOUNT
    P_0LOC_CURRCY=*NEWCOL(MXN)
    P_0MATL_TYPE=*NEWCOL(null)
    P_0VENDOR=0VENDOR
    P_DataSrc=*NEWCOL(UPLOAD)
    P_ZMATERIAL1=0MATERIAL
    P_ZMATERIAL2=*NEWCOL(null)
    P_ZMATL_CLASS=*NEWCOL(null)
    P_ZMATL_TESP=*NEWCOL(null)
    P_ZRATIO=*NEWCOL(KF_inpmdInt)
    Time=0CALMONTH
    SIGNEDDATA=0TOTALSTCK
    *CONVERSION
    Time=Time_conv.xls
    EXTERNAL     INTERNAL
    201101          2011.JAN
    201102          2011.FEB
    201103          2011.MAR
    201104          2011.APR
    201105          2011.MAY
    201106          2011.JUN
    201107          2011.JUL
    201108          2011.AUG
    201109          2011.SEP
    201110          2011.OCT
    201111          2011.NOV
    201112          2011.DEC
    Thank you for taking at glance to the files.
    Best Regards,
    HH

  • Is there a way to access object from other schema?

    1. Is there a way to access object from other schema
    Without using synonym/public synonym without prefixing schema owner?
    2. If you do not see any object in all_objects by same name owned by connected user or public, can there still be objects hidden from this view? for instance synonyms created by SYSTEM
    TIA for help

    Well, you missed something somewhere. If there is no
    ALTER SESSION SET CURRENT_SCHEMA=whoeverthen there must be either public synonym for the object as this shows:
    SQL> CREATE USER a identified by a;
    User created.
    SQL> GRANT CREATE SESSION to a;
    Grant succeeded.
    SQL> CREATE USER b identified by b;
    User created.
    SQL> GRANT CREATE SESSION, CREATE PROCEDURE, CREATE PUBLIC SYNONYM to b;
    Grant succeeded.
    SQL> connect b/b
    Connected.
    SQL> CREATE PACKAGE test AS
      2     PROCEDURE testit;
      3  END;
      4  /
    Package created.
    SQL> CREATE PACKAGE BODY test AS
      2  PROCEDURE testit IS
      3  BEGIN
      4     NULL;
      5  END;
      6  END;
      7  /
    Package body created.
    SQL> connect a/a
    Connected.
    SQL> desc b.test
    ERROR:
    ORA-04043: object b.test does not exist
    SQL> connect b/b
    Connected.
    SQL> GRANT EXECUTE ON test TO a;
    Grant succeeded.
    SQL> connect a/a
    Connected.
    SQL> desc b.test;
    PROCEDURE TESTIT
    SQL> desc test;
    ERROR:
    ORA-04043: object test does not exist
    SQL> connect b/b
    Connected.
    SQL> CREATE PUBLIC SYNONYM test FOR TEST;
    Synonym created.
    SQL> connect a/a
    Connected.
    SQL> desc test
    PROCEDURE TESTITAnother possibility without public synonyms is that crv had granted the other user privileges on some object, and the other user creates a private synonym for that. When crv granted privileges on a different object with the same name, the private synonym became valid again. Something like:
    SQL> connect /
    Connected.
    SQL> drop public synonym test;
    Synonym dropped.
    SQL> GRANT CREATE SYNONYM TO a;
    Grant succeeded.
    SQL> connect a/a
    Connected.
    SQL> desc test;
    ERROR:
    ORA-04043: object test does not exist
    SQL> desc b.test
    PROCEDURE TESTIT
    SQL> CREATE SYNONYM test FOR b.test;
    Synonym created.
    SQL> desc test;
    PROCEDURE TESTIT
    SQL> connect b/b
    Connected.
    SQL> REVOKE EXECUTE ON test FROM a;
    Revoke succeeded.
    SQL> connect a/a
    Connected.
    SQL> desc test;
    ERROR:
    ORA-04043: object "B"."TEST" does not exist
    SQL> desc b.test
    ERROR:
    ORA-04043: object b.test does not exist
    SQL> connect b/b
    Connected.
    SQL> DROP PACKAGE test;
    Package dropped.
    SQL> CREATE FUNCTION test (p_num IN NUMBER) RETURN NUMBER AS
      2  BEGIN
      3     RETURN p_num * 10;
      4  END;
      5  /
    Function created.
    SQL> GRANT EXECUTE ON test TO a;
    Grant succeeded.
    SQL> connect a/a
    Connected.
    SQL> desc test;
    FUNCTION test RETURNS NUMBER
    Argument Name                  Type                    In/Out Default?
    P_NUM                          NUMBER                  INSo, I would go looking for the synonyms.
    TTFN
    John

  • How to retrieve data from other websites?

    Hi all,
    Don't know if anyone can point me in the right direction.
    How can I retrieve or fetch data from other website&rsquo;s (*Database*) ?
    I&rsquo;m trying to build a web application that would retrieve and fetch data from other website&rsquo;s (Database) like the www.comparethemarket.com.
    The data I&rsquo;m trying to fetch it is in database, in my opinion I think I have to make a http web request then send parameters, then get the result. I could not find any tutorials
    on the web,
    Thank you.

    Fahad_24 wrote:
    Hi all,
    Don't know if anyone can point me in the right direction.
    How can I retrieve or fetch data from other website&rsquo;s (*Database*) ?
    I&rsquo;m trying to build a web application that would retrieve and fetch data from other website&rsquo;s (Database) like the www.comparethemarket.com.
    The data I&rsquo;m trying to fetch it is in database, in my opinion I think I have to make a http web request then send parameters, then get the result. I could not find any tutorials
    on the web,
    Thank you.Unless the website provides an interface to their data, you are most likely not even allowed to do this. There is only one way to find out: contact them and ask about it or look around their website if their is a manual that describes how to do it. If there is such an interface, it will usually be some kind of web service (such as a SOAP interface).

  • Import from other schemas other than default

    Hi,
    I defined a source metadata location to an Oracle database. The user used to connect to the DB itself has no objects. I need to import tables and views from other schemas in the source Oracle database. It that possible using the same user that was used in creating the metadata source location? Or, does one need specific one-to-one connection established as separate source metadata locations in order to import tables and views from other schemas?
    In other words, is one user/password to a database sufficient to import tables and views from other schemas?
    Thanks!

    I'm not sure you can import directly into the Android version of Firefox due to security limitation on the device. If you can get your Opera bookmarks into Firefox on the desktop, you can use Firefox Sync to move them to your mobile.
    Does this thread help? [https://support.mozilla.org/en-US/questions/923976 how can I sync bookmarks between my opera mobile browser and my new Firefox for android browser ? | Firefox Support Forum | Firefox Help]

  • Does the imac allow me to load data from other brands

    Does the Apple imac desktop allow me to load data from other brand name mobile units?

    Check out dropbox.
    https://www.dropbox.com/mobile
    https://www.dropbox.com
    Check if mobile device supports OS X.
    RObert

  • EXPORT/IMPORT TABLE DATA FROM ONE SCHEMA TO ANOTHER ONE (S.O.S)

    Hi,
    I urgently need your help:(, I have two different instances, in each of them there are two schemas, A and B; which tables are the same, but I need to transfer JUST the table data from A's tables to B's tables, how can I do so??
    Thanks in advance,
    Isabel

    The total number of tables is 989:(And how many do you want ? If 988, and if you're on a 10g db, you can use exclude parameter from expdp/impdp?
    Nicolas.

  • How to select data from another schema in Oracle-Sqldeveloper?

    Hi,
    I open two schemas, assumed schema1 and schema2, in SQL-Developer. In the SQL-Edit Area of schema1 I want to select data from schema2. So I did followings:
    select * from schema2.table1;
    But I got error message: 00942. 00000 -  "table or view does not exist"
    What could be the problem?

    Correct place for your question is SQL Developer (Not for general SQL/PLSQL questions)
    Oh my bad.. Check previous post.. Its privilege issue.
    Message was edited by: Karthick_Arp

Maybe you are looking for