Dynamic SQL select from unknown table until runtime

I need to do a select from a table that is unknown until runtime. Is there any good examples of this. The Store Procedure will take in the table name and return a row.
I am not using inline SQL because there is a lot more complexity involved . What I need to do is understand how to reference this unknown table.
Here is an example of what I have written so far.
PACKAGE pk_LoadNativeDataItems IS
PROCEDURE version;
TYPE RowDataCur IS REF CURSOR;
PROCEDURE pr_LoadNativeDataItems(p_flag IN NUMBER
p_how_many_rows_to_fetch IN NUMBER,
p_row_data OUT RowDataCur);
PROCEDURE pr_LoadNativeDataItems(p_flag IN NUMBER
p_how_many_rows_to_fetch IN NUMBER,
p_table_name IN VARCHAR,
p_row_data OUT RowDataCur) IS
BEGIN
OPEN p_row_data FOR
SELECT * from ||p_table_name||;
END pr_LoadNativeDataItems;
END pk_LoadNativeDataItems;
Thanks for any help
Tony

Here is example for similar question:
Using variables for tables and columns

Similar Messages

  • Select from unknown table [ANSWERED]

    I have a table that indexes physical table names with IDs as follows:
    idxer
    idx. tbl_nm
    1. employee_tbl
    2. cmpny_tbl
    I have tried constructing a query that will get data from the table whose index is provided as follows:
    SELECT *
    FROM (SELECT tbl_nm FROM idxer WHERE idx = 1)
    The problem is since the inner select returns a string (as I imagine it) the outer select just returns that string. What I want is the inner select to be evaluated as a table name.
    Any help will be appreciated.
    Hussam.
    Message was edited by:
    user628579

    To process the results of this query I would recommend the using the INTO clause. Here's an example:
       EXECUTE IMMEDIATE 'SELECT * FROM '|| tbl_nm_var
       INTO vNewVariable;There are some really great resources available on the internet with examples. A Google search for "oracle dynamic sql" will give enough reading material and examples to keep you busy for a few weeks. :-)
    Hope this helps.
    Craig...
    Message was edited by:
    CraigB
    I forgot to mention that if your query returns multiple rows, this method will produce a TOO_MANY_ROWS exception. In which case you could use an OPEN <Record variable> FOR 'Dynamic Statement' LOOP construct. The Google search I cited will give you the methods for processing this type of dynamic query.

  • How to create a dynamic RTF report which creates dynamic columns based on dynamic column selection from a table?

    Hi All,
    Suppose I have table, whose structure changes frequently on daily basis.
    For eg. desc my_table gives you following column name on Day 1
    SQL > desc my_table;
    Output
    Name
    Age
    Phone
    On Day 2, two more columns are added, viz, Address and Salary.
    SQL > desc my_table;
    Output
    Name
    Age
    Phone
    Address
    Salary
    Now I want to create an Dynnamic RTF report which would fetch data from ALL columns from my_table on daily basis. For that I have defined a concurrent program with XML as output type and have attached a data template/data definition to it which takes in XML as input and gives final output of conc program in EXCEL layout. I am able to do this for constant number of columns, but dont know how to do it when the number of columns to be displayed changes dynamically.
    For Day 1 my XML file should be like this.
    <?xml version="1.0" encoding="UTF-8"?>
    <dataTemplate name="XYZ" description="iExpenses Report" Version="1.0">
    <dataQuery>
    <sqlStatement name="Q2">
    <![CDATA[
    SELECT Name
    ,Age
    ,Phone
    FROM my_table
    ]]>
    </sqlStatement>
    </dataQuery>
    <dataStructure>
    <group name="G_my_table" source="Q2">
      <element name="Name" value="Name" />
      <element name="Age" value="Age" />
      <element name="Phone" value="Phone" />
    </group>
    </dataStructure>
    </dataTemplate>
    And my Day 1, EXCEL output from RTF template should be like this.
    Name     Age     Phone
    Swapnill     23     12345
    For Day 2 my XML file should be like this. With 2 new columns selected in SELECT clause.
    <?xml version="1.0" encoding="UTF-8"?>
    <dataTemplate name="XYZ" description="iExpenses Report" Version="1.0">
    <dataQuery>
    <sqlStatement name="Q2">
    <![CDATA[
    SELECT Name
    ,Age
    ,Phone
    ,Address
    ,Salary
    FROM my_table
    ]]>
    </sqlStatement>
    </dataQuery>
    <dataStructure>
    <group name="G_my_table" source="Q2">
      <element name="Name" value="Name" />
      <element name="Age" value="Age" />
      <element name="Phone" value="Phone" />
      <element name="Address" value="Address" />
      <element name="Salary" value="Salary" />
    </group>
    </dataStructure>
    </dataTemplate>
    And my Day 2, EXCEL output from RTF template should be like this.
    Name     Age     Phone     Address     Salary
    Swapnill     23     12345         Madrid     100000
    Now, I dont know below things.
    Make the XML dynamic as in on Day 1 there must be 3 columns in the SELECT statement and on Day 2, 5 columns. I want to create one dynamic XML which should not be required to be changed if new columns are added in my_table. I dont know how to create this query and also create their corresponding elements below.
    Make the RTF template dyanamic as in Day1 there must 3 columns in EXCEL output and on Day 2, 5 columns. I want to create a Dynamic RTF template which would show all the columns selected in Dynamic XML.I dont know how the RTF will create new XML tags and how it will know where to place it in the report. Means, I can create RTF template on Day 1, by loading XML data for 3 columns and placing 3 XML tags in template. But how will it create and place tags for new columns on Day 2?
    Hope, you got my requirement, its a challenging one. Please let me know how I can implement the required solution using RTF dynamically without any manual intervention.
    Regards,
    Swapnil K.
    Message was edited by: SwapnilK

    Hi All,
    I am able to fulfil above requirement. Now I am stuck at below point. Need your help!
    Is there any way to UPDATE the XML file attached to a Data Definition (XML Publisher > Data Definition) using a standard package or procedure call or may be an API from backend? I am creating an XML dynamically and I want to attach it to its Data Definition programmatically using SQL.
    Please let me know if there is any oracle functionality to do this.
    If not, please let me know the standard directories on application/database server where the XML files attached to Data Definitions are stored.
    For eg, /$APPL_TOP/ar/1.0/sql or something.
    Regards,
    Swapnil K.

  • Dynamic parameter selection from infoview not storing the sql password

    We are having the problem of dynamic parameter selection from infoview not storing the sql password as it does for the actual report. We are using Crystal Reports XI Release 2 version 11.5.3.438 (Not sure of SP level, asked in separate thread).
    To be more specific.
    We have created a report that dynamically populates the parameters of the report by pulling the records from the Informix sql database and allowing selection from there.
    In the Central Management Console for the report object we have set as follows:
    Process - Database:
    Use original database logon information from the report - the sql username and pw etc
    Use same database logon as when report is run
    Process - Parameters
    In selecting a default selection there is the option to put in the sql password, however, this does not stick and clears after update.
    As such the end result is that every time this report is run from infoview and a user chooses a parameter (there are 5), crystal goes through some timeout for about a minute or so and then requests the sql password, if a user then selects the next parameter, the same timeout and password dialog appears.
    We need the crystal report to handle to the sql password for fetching the parameters as well as for the database section of running the report, however, the parameters insists on the end user always putting the password in.
    This is 100% replicatable on our system.
    Any way that we can fix this?
    Will an update fix this issue? If so could you please advise which one?
    Thanks

    Hi,
    I am having the exact same problem. Any help?
    And what does "Use same database logon as when report is run" mean? For me that would be that no prompt is needed for getting values in a dynamic parameter...
    Regards
    Magnus

  • PL/SQL: ORA-22992: cannot use LOB locators selected from remote tables

    Dear ALL,
    My O/S is Redhatlinux 5.2 and i had Migrated my Oracle databse to 11g2. But after that while i am retrieving records through dblinks from one of my other Oracle 9.2.0.8 databse it's throwing the error : PL/SQL: ORA-22992: cannot use LOB locators selected from remote tables.* This error i am getting in TOAD as well as SQL Developer.
    Can anybody tell me how to fix this error ? Because am not able to get the records.
    Also am getting another error during retrieving data from some of my tables after migrating i.e the table which having CLOB data type while am accessing to retrieve the records using select query it's throwing the error :
    +(The following error has occurred:+
    A query with LOB's requires OCI8 mode, but OCI7 mode is used.)
    If anyone having any idea kindly share.
    Thanks and Regards
    Biswa

    Hi,
    Ya what u sent that is fine. But already am using one procudure which is accessing LOB data from another databse through DBlink and working fine. But there Both the databse are 9.2.0.8.
    But while am executing the same procedure in oracle 11g where the Dblink accessing the data from Oracle 9i , there am getting this error.
    Kindly tell if u know any resolution.
    Thanks

  • Select from two tables and insert into a third

    I'm trying to do a select from two tables and do an insert into a third table from the two resulting columns.
    I have the following....
    DECLARE
    tempsid number;
    temphostid number;
    BEGIN
    select "DBSID_ID","ID" into tempsid,temphostid from "DBSIDS","SERVERS"
    where "HOST_SID" like '%'||"DBSID_NAME"||'%'
    and "HOST_NAME" not like 'vio%'
    and exists (select "DBSID_NAME" from DBSIDS)
    order by "DBSID_NAME";
    insert into "DBSID_LOOKUP" ("SIDLOOKUP_ID", "SERVERLOOKUP_ID")
    values(tempsid, temphostsid);
    END;
    run;
    I get the error ....
    ORA-06550: line 11, column 18:
    PL/SQL: ORA-00984: column not allowed here
    ORA-06550: line 10, column 1:
    PL/SQL: SQL Statement ignored
    1. DECLARE
    2. tempsid number;
    3. temphostid number;

    okay ... I tried a different way ...
    DECLARE
    a number;
    b number;
    BEGIN
    select "DBSID_ID","ID" into a,b from "DBSIDS","SERVERS"
    where "HOST_SID" like '%'||"DBSID_NAME"||'%'
    and "HOST_NAME" not like 'vio%'
    and exists (select "DBSID_NAME" from DBSIDS)
    order by "DBSID_NAME";
    insert into "DBSID_LOOKUP" (SIDLOOKUP_ID, SERVERLOOKUP_ID) values (a, b);
    END;
    and now it whines about ...
    ORA-01422: exact fetch returns more than requested number of rows

  • Selecting from two tables and confirming from them despites they not relate

    Please I need a query to select from two tables that are not related to each other.
    I also want to confirm data's as in verify wether what the user has entered is in accordance with what is in the tables
    Examples
    the first table is named "Card" and the second table is named "Student_Details"
    Card table contains a column named "Pin_Number".
    The Student_Details table contains fields such as Exam_Number, Name, Age, Sex.
    The user has to Enter the Pin_Number which has to be confirmed in the Card table and Exam_Number which has to be confirmed in the Student_Details table and verify that both data's are correct.
    Please I need the SQL and PL/SQL queries for this problem.
    Thanks

    Hi,
    I think you need two different queries
    You can write a procedure like:
    create or replace procedure p1 (p_pin_number number, p_exam_number)
    is
      r_card_row            card%rowtype;
      r_student_details     student_details%rowtype;
      cursor c1 is
      select *
        from card
       where pin_number = p_pin_number;
      cursor c2 is
      select *
        from student_details
       where exam_number = p_exam_number;
    begin
      open c1;
        loop
          fetch c1 into  r_card_row;
          exit when c1%notfound;
          ....  do whatever you want..... and the samething you can do with other cursor
        end loop;
      close c1;
    end p1;Hope this helps
    Ghulam

  • Selecting from multiple tables, into one internal table

    Hi,
    What is the best & most efficient method of selecting from multiple table (in my case 6,) into one internal table?
    Thanks,
    John
    Points will be rewarded and all responses will be highly appreciated.

    I have simple example :
    First one - Join 5 tables
    data : f1 type i,
              f2 type i,
              f3 type i.
    start-of-selection.
    get run time field f1.
    write the query 4 or 5 tables join.
    get run time field f2.
    f3 = f2 - f1 ( Total time).
    Second one - joins 3 table and use for all entries
    data : f1 type i,
              f2 type i,
              f3 type i.
    start-of-selection.
    get run time field f1.
    write the query 3 tables join and use for all entries
    get run time field f2.
    f3 = f2 - f1. ( Total time )
    Finally you can have time diffrence between the both sql statement.

  • SSMS is not listing table and views objects though the objects are listed when I execute TSql string "SELECT * FROM sys.Tables"

    I have a db, call it xyz.mdb
    It suddenly is that SSMS is not listing the table objects nor the Views.  SELECT * FROM sys.Tables and SELECT * FROM sys.Views work very fine.  But when I click on the tables node, on Objects Explorer, Only the Systems Tables and File Tables folders
    show. 
    Other DBs on same SQL instance do not show same problem.  They are all working very fine.
    I have backed up and restored this db on other computers and the behaviour is the same.  Incidentally right-clicking the db and clicking Properties throws up this error message.
    -------------------------------------------------------------------------Error!
    Cannot show requested dialog.
    Property Size is not available for Database '[Pliny E DB - NOA 2014]'. This property may not exist for this object, or may not be retrievable due to insufficient access rights.  (Microsoft.SqlServer.Smo)
    For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=11.0.3000.0+((SQL11_PCU_Main).121019-1325+)&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.PropertyCannotBeRetrievedExceptionText&EvtID=Size&LinkId=20476
    --------------------------------------------------------------------------------End>
    When I try to Refrresh the Tables node on Object Explorer, I get this other:
    ------------------------------Error!
    SQL Server detected a logical consistency-based I/O error: incorrect checksum (expected: 0x9090d9b7; actual: 0x909001b4). It occurred during a read of page (1:1173) in database ID 21 at offset 0x0000000092a000 in file 'c:\Databases\Clients\NOA\Pliny E DB -
    NOA 2014.mdf'.  Additional messages in the SQL Server error log or system event log may provide more detail. This is a severe error condition that threatens database integrity and must be corrected immediately. Complete a full database consistency check
    (DBCC CHECKDB). This error can be caused by many factors; for more information, see SQL Server Books Online. (Microsoft SQL Server, Error: 824)
    For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft%20SQL%20Server&EvtSrc=MSSQLServer&EvtID=824&LinkId=20476
    ------------------------------End>
    The Help link of course is not valid any more.
    Many thanks
    Vie
    @Abuja
    Vie

    Your database is corrupted and you need to run.
    DBCC CHECKDB
    You already have a backup so do it...
    This link will provide you with more information:
    http://msdn.microsoft.com/en-us/library/ms176064.aspx

  • Select from multiple tables without join statement

    Hey Gurus,
    I would like to make a select from a multiple tables to check if there is any reference to my data. I would like to do it with some elegancy, but I don't know how.
    Is in abap sql possible to do it only with the select statement?
    Or I was also think about a solution that I should fill some data structure with all of the tables which I want to select from and then just loop that data structure and do the select seperately from all of the tables. I just need to check if it founds some results, so no need to store it. If this solution would be fine what data structure should I use?
    Or can tell me what would be the best for this?
    My code for select from one table, which I want to make for multiple tables:
    SELECT SINGLE id_kniznice FROM zbr_t_autori INTO wa_id
           WHERE id_kniznice EQ ls_extract-zview-id_kniznice.
         IF sy-dbcnt > 0.
           MESSAGE i000(zbr_msgc_lib).
           ls_extract-flags-vim_mark = '*'.
           MODIFY extract FROM ls_extract.
    ENDIF.   
    Thank you for any posts.
    Regards,
    Robert

    And there we go again...
    Read this topic:
    For All Entries is NOT better than INNER JOIN in most cases
    And this one:
    inner join vs for all entries
    Also that one:
    Re: LOOP AT vs INNER JOIN
    JOINs are really better than for all entries in most cases. Problem is people tend to ignore basic things like using pks or indexes while making them.

  • KUP-04063: unable to open log file.. (while selecting from External table)

    Hi
    I am trying to craete an external table and then select the data from the table. However I am getting error while trying to select the data from external table.
    SQL>CREATE OR REPLACE DIRECTORY my_dir as 'C:\arun';
    Directory created.
    SQL>GRANT ALL ON DIRECTORY my_dir TO PUBLIC;
    Grant succeeded.
    SQL>DROP TABLE proj_checklists_external;
    Table dropped.
    SQL>CREATE TABLE proj_checklists_external
    2 ( checklist_submission_id NUMBER
    3 ,Lead_reviewer_name VARCHAR2(30)
    4 ,Lead_reviewer_corp_id VARCHAR2(10)
    5 ,creation_date VARCHAR2(10)
    6 ,submitted_dater VARCHAR2(10)
    7 ,approved_date VARCHAR2(10)
    8 ,status VARCHAR2(50)
    9 )
    10 ORGANIZATION EXTERNAL
    11 (
    12 TYPE ORACLE_LOADER
    13 DEFAULT DIRECTORY my_dir
    14 ACCESS PARAMETERS
    15 (
    16 RECORDS DELIMITED BY NEWLINE
    17 FIELDS TERMINATED BY ','
    18 )
    19 LOCATION ('Book1.txt')
    20 )
    21 PARALLEL 5
    22 REJECT LIMIT 200;
    Table created.
    SQL>SELECT * FROM proj_checklists_external;
    SELECT * FROM proj_checklists_external
    ERROR at line 1:
    ORA-29913: error in executing ODCIEXTTABLEOPEN callout
    ORA-29400: data cartridge error
    KUP-04063: unable to open log file PROJ_CHECKLISTS_EXTERNAL_28484.log
    OS error No such file or directory
    ORA-06512: at "SYS.ORACLE_LOADER", line 14
    ORA-06512: at line 1
    I craeted an file PROJ_CHECKLISTS_EXTERNAL_28484.log also in C:\arun and then tried to select but still got same error.
    Any idea how to overcome this error.
    Regards
    Arun

    here you go:
    SQL> CREATE OR REPLACE DIRECTORY GRATIS_LOAD as 'D:\AdvSourceData\Membership\';
    Directory created
    SQL> GRANT ALL ON DIRECTORY GRATIS_LOAD to ADVROLE;
    Grant succeeded
    SQL>
    SQL> DROP TABLE MEMB_BATCH_LOAD_ID;
    Table dropped
    SQL> CREATE TABLE MEMB_BATCH_LOAD_ID (
    2 ID_NUMBER VARCHAR2(10),
    3 STATUS CHAR(1)
    4 )
    5 ORGANIZATION EXTERNAL
    6 ( TYPE ORACLE_LOADER
    7 DEFAULT DIRECTORY GRATIS_LOAD
    8 ACCESS PARAMETERS
    9 ( records delimited by NEWLINE
    10 fields (
    11 ID_NUMBER POSITION (1:10) CHAR,
    12 STATUS POSITION (11:1) CHAR
    13 )
    14 )
    15 LOCATION
    16 ( 'GRATISID.TXT'
    17 )
    18 );
    Table created
    SQL> select * from memb_batch_load_id;
    select * from memb_batch_load_id
    ORA-29913: error in executing ODCIEXTTABLEOPEN callout
    ORA-29400: data cartridge error
    KUP-04063: unable to open log file MEMB_BATCH_LOAD_ID_1388_5552.log
    OS error The system cannot find the file specified.
    ORA-06512: at "SYS.ORACLE_LOADER", line 14
    ORA-06512: at line 1
    SQL>

  • Selecting from two tables

    I have two tables:
    TABLE: users (user_is is primary key):
    ++++++++++++++++++++++++++++++++++++++
    user_id     | username
    1     | fazle
    2     | newaz
    3     | shaerul
    4     | badsha
    5     | mirmohsin
    6     | mdmohsin
    7     | shawkat
    8     | ahsan
    9     | admin
    TABLE: key_movement_history (history_id is primary key, key_handover_user_id and     key_takeover_user_id links to users.user_id):
    ++++++++++++++++++++++++++++++++++++++++++++++++++
    history_id     | handover_date     | key_handover_user_id |     key_takeover_user_id
    1     | 2006-10-18 16:25:07     | 8               |      2
    2     | 2006-10-18 17:03:09          | 2               |      8
    3     | 2006-10-18 17:04:45     |     8               |     1
    4     | 2006-10-18 17:28:35     |     1               |      8
    5     | 2006-10-18 17:31:59          | 8               |      1
    6     | 2006-10-19 19:04:02          | 1               |     8
    What is want is:
    TABLE 3:
    ++++++++
    handover_date     | key_handover_username | key_takeover_username
    2006-10-18 16:25:07     | ahsan     | newaz
    2006-10-18 17:03:09     | newaz          | ahsan
    2006-10-18 17:04:45     | ahsan          | fazle
    2006-10-18 17:28:35     | fazle          | ahsan
    2006-10-18 17:31:59     | ahsan          | fazle
    2006-10-19 19:04:02     | fazle          | ahsan
    Could anyone please tell me the select statement?
    I tried
    SELECT key_movement_histories.handover_date, users.username, users.username FROM key_movement_histories, users WHERE users.user_id = key_movement_histories.key_handover_user_id and users.user_id = key_movement_histories.key_takeover_user_id;
    but this did not work.
    Thanks in advance.
    Message was edited by:
    user538091

    sql>select * from t1;
        USER_ID  USERNAME
        1  Fazle 
        2  Nawaz 
        3  Sherul
    sql>select * from t2;
        HISTORY_ID  DT  HO_ID  TO_ID
        1  06-oct-06  1  2 
        2  16-oct-06  2  3 
        3  26-oct-06  3  1
    sql>select t2.history_id,t2.dt,
           t11.username ho_user,t12.username to_user
        from t1 t11,t1 t12,t2
        where t11.user_id = t2.ho_id
        and t12.user_id = t2.to_id;
        HISTORY_ID  DT  HO_USE  TO_USE 
        1  06-oct-06  Fazle  Nawaz 
        2  16-oct-06  Nawaz  Sherul 
        3  26-oct-06  Sherul  Fazle 
    jeneesh

  • $sql ='SELECT * FROM fideles  WHERE (fideles.NOM ==($_POST [Nom]))';

    hello
    i don'\t know why my syntax is wrong could you help to give me the right syntax.
    thank you for helping
    [email protected]

    i forgot to join my script
    <?php
    mb_http_input("iso-8859-1");
    mb_http_output("iso-8859-1");
    ?>
    <?php require_once('Connections/FIDELES.php'); ?>
    <?php
    if (!function_exists("GetSQLValueString")) {
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
      if (PHP_VERSION < 6) {
        $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
      $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
      switch ($theType) {
        case "text":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;   
        case "long":
        case "int":
          $theValue = ($theValue != "") ? intval($theValue) : "NULL";
          break;
        case "double":
          $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
          break;
        case "date":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;
        case "defined":
          $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
          break;
      return $theValue;
    mysql_select_db($database_FIDELES, $FIDELES);
    $query_Recordset1 = "SELECT * FROM fideles ORDER BY NOM ASC ";
    $Recordset1 = mysql_query($query_Recordset1, $FIDELES) or die(mysql_error());
    $row_Recordset1 = mysql_fetch_assoc($Recordset1);
    $totalRows_Recordset1 = mysql_num_rows($Recordset1);
    echo $Recordset1;
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" >
    <head>
           <title>Formulaire</title>
           <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
                 <link rel="stylesheet" media="screen" type="text/css" title="Miseenforme" href="Miseenforme.css" />
                 <style type="text/css">
                 @import url("ModuleStyleSheets.css");
           </style>
                 <link href="CSS/colors5.css" rel="stylesheet" type="text/css" />
                 <style type="text/css">
                 h1 {
              font-size: xx-large;
           #corps form p {
              font-size: 18px;
              text-align: left;
              font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif;
           #corps form p br {
              font-family: Palatino Linotype, Book Antiqua, Palatino, serif;
              font-size: 24px;
           #corps form p label {
              text-align: left;
           #corps form p label {
              text-align: left;
           #corps form p label {
              text-align: left;
           form p label {
              text-align: left;
           #corps form p {
              color: #FFFFFF;
           </style>
    </head>
       <body>
       <div id="corps">
       <form action="modifier.php" method="POST" enctype="multipart/form-data">
       <p><!-- #BeginDate format:fcAm1 -->Sunday, September 15, 2013<!-- #EndDate -->
       </p>
       <table width="500" border="1" align="center" cellpadding="2" cellspacing="2">
         <tr>
           <th width="500" align="center" bgcolor="#66FFFF" scope="row">FICHE D'INSCRIPTION</th>
         </tr>
       </table>
       <p>
                 <label for="Nom">Nom</label>
                        <input name="Nom" type="text" id="Nom" value="<?php echo ($_POST ['Nom']);   ?>"  size="20" readonly="readonly" /><br/>
                <label for="Prenom">Prenom</label>
                        <input type="text" id="Prenom" name="Prenom" value="<?php echo ($_POST ['Prenom']);  ?>"   size="20" readonly="readonly" /><br/>
         <p>Adresse:
           <label>
             <textarea name="adresse" id="adresse" cols="45" rows="5" value="<?php echo $data['ADRESSE'] ;  ?>" readonly="readonly" /></textarea>
           </label>
            <input name="Submit" type="submit" value="Submit" />
         <input type="reset"/>
           </p>
    </p>
       <?php
        if(isset($_POST['Nom']) &&(isset($_POST['Prenom']) ))
    // lancement de la requete //
    $sql ='SELECT * FROM fideles  WHERE (fideles.NOM =($_POST [Nom]))';
    // on lance la requête (mysql_query) et on impose un message d'erreur si la requête ne se passe pas bien (or die)
    $req = mysql_query($sql) or die('Erreur SQL !<br />'.$sql.'<br />'.mysql_error()); 
    // on recupere le resultat sous forme d'un tableau //
      $data = mysql_fetch_array($req);
    echo $data['ADRESSE'];
      mysql_free_result ($req); 
      mysql_close ();
      return($data); 
      else
       echo "Veuillez saisir le nom et le prenom";
    ?>
              </form>
       <table width="97%" border="1" cellpadding="2" cellspacing="2">
         <tr>
           <td><a href="index.php" rel="publisher">Index</a></td>
           <td><a href="index.php">Accueil</a></td>
           <td><a href="formulaire.php">Creation</a></td>
           <td><a href="formulairemodif.php">Modification</a></td>
           <td><a href="formulairesupress.php">Supression</a></td>
           <td><a href="consultation.php">Consultation</a></td>
           <td><a href="palmdon.php">Palmares des dons</a></td>
         </tr>
       </table>
       <p></div>
    </body>
    </html>
    <?php
    mysql_free_result($Recordset1);
    ?>

  • SQL select * from v$log_history;

    SQL> select * from v$log_history;
    RECID STAMP THREAD# SEQUENCE# FIRST_CHANGE# FIRST_TIM NEXT_CHANGE#
    1 726598206 1 1 190578 08-AUG-10 467652
    2 726663400 1 2 467652 09-AUG-10 719320
    3 726758063 1 3 719320 10-AUG-10 1044278
    (1)From this output how I can know that how often archivelog is getting genarated what should be the actual interval of genaration.
    (2)How can I know the size of redolog group & it's member's size.
    (3)How can I determine that these sizes are perfect with my DB(Because of performance issue).

    You can use this query to see the gap in time between creating archive logs which should give an indication of log switches,
    set linesize 1000
    select name "archive log",
           ftime "first time",
           trunc(ftime- pftime) || ' days ' ||
           trunc( mod( (ftime-pftime)*24, 24 ) ) || ' hours ' ||
           trunc( mod( (ftime-pftime)*24*60, 60 ) )  || ' mins ' ||
           trunc( mod( (ftime-pftime)*24*60*60, 60 ) ) ||' secs ' "Time Gap"
    from
    select name,
            first_time ftime,
            lag(first_time,1) over (order by first_time ) pftime
    from v$archived_log order by first_time
    /The size of the log files are in V$LOG, groups and members in V$LOGFILE.
    You can extract the log switch information from the alert log.
    (there is also the DBA_HIST_LOG table).
    Edited by: stellios3 on Sep 30, 2010 11:27 AM

  • Sql text from statspack tables

    Hi,
    How can I get sql information from statspack tables stats$sql_text, stats$sql_summarry..?
    I tried writting sql but not able to get the proper results, please help.
    select b.hash_value hash_value, a.snap_time snap_time, b.module module, b.fetches fetches, b.executions executions,
    b.rows_processed rows_processed, b.cpu_time cpu_time, b.elapsed_time elapsed_time from stats$snapshot a,stats$sql_summary b
    where a.snap_id=b.snap_id and b.snap_id between 1 and 13
    and I need to get the complete stats$sql_text.sql_text in the same query without using any procedure or function..
    version is 9.2.0.8.
    Thanks
    clin

    I'd also do this the way MOD says.
    But if you are feeling adventurous, you could explore cascading delete. You can specify a primary key with "on delete cascade", which makes referred-to records automatically delete. Google for oracle delete cascade or search your Oracle docs.
    I wouldn't do cascading deletes myself, though. For one, I've ran into enough trouble with many "smart" db features when trying to do db administration.

Maybe you are looking for

  • What are the important views or field in vendors master record

    All, We are converting two different companies into our SAP.  We are at blue printing stage.  I was assigned to gather vendor master data requirements in SAP.  I sent them all the fields that we are currently using in SAP.  I sent them a template of

  • SAP GUI and Win 7 error when attaching a document

    I searched Google multiple times for an answer but didn't find one, so I'd like to bring it up in this forum. I start by saying that mine is a large corporation with centralized application, Windows and security configuration, so I have very little m

  • Requirement with Oracle report builder

    Hi All,, I had a requirement like this...i am very new to Oracle report builder tool and Oracle APPS i need to develop a sample report in this format.......please help me which tables i need to use?? i know how to create user parameters,field columns

  • Lightroom 4 import raw from Canon 70d

    I have a canon 70d and I am trying to import raw images into Lightroom 4.  Is there an easy fix to allow me to do this? thank you

  • Average number of a line

    Hey folks! I have a table with names of people in the left column and things they did to raise money in the headline (e.g. selling chocolate or cake). For each activity someone participates in, the person gets a X. Now i would like to calculate numbe