Querying Nested Tables from BO

Hi,
I have a nested table [VA_GT_HC_ASIA_SGP ] in Oracle. The Inner Object in the nested table has got 4 columns, which has to be displayed in the WebI Report.
Hece I created the table as derived table in Universe by the below query.
select a.COL1, b.COL2, b.COL3, b.COL4, b.COL5 from VA_GT_HC_ASIA_SGP a, Table(a.OB_GT_HC_MAINT_INFO) b
But performance is very slow. Please advice if there exists a better way to do this.
Best Regards,
Anu

The Query is:-SELECT A.ID, A.NAME, A.COMB, B.C1,B.C2, B.C3  FROM NT_KFD_RFT_TEST_DATE A, TABLE(OB_KFD_RFT_DATA) B
Nested Table structure Example:-
ID       NAME    COMB   OB_KFD_RFT_DATA
01      TEST     ALL    
The inner table (OB_KFD_RFT_DATA) structure is
C1      C2        C3
23.5   56.7   78.9
00.9   76.9   53.3
12.4   33.4   23.2
Here outer record is 01 TEST ALL, and inner record is the 3 row decimal numbers.
In Universe, I need to create Objects from C1,       C2,      C3 columns.
Currently i'm doing it with derived table (by running above query). Is there any other option to do it?
Thanks,
Anu

Similar Messages

  • Querying Nested Table......

    Hi,
    I am new to this nested table topic, I am facing problem in querying nested table. Actually i had created a table which consists of details regarding Applications and the platforms. As an application can run on more than one platform i had created a nested table for platform.
    CREATE OR REPLACE TYPE TY_PLATFORM AS OBJECT
    (           VC_PLATFORM VARCHAR2(64)          );
    CREATE OR REPLACE TYPE NT_TY_PLATFORM AS TABLE OF TY_PLATFORM;
    I am using this nested table in the main table application:
    CREATE TABLE T_APPLICATION
    ( N_APPLICATION_ID NUMBER(32,6),
         VC_APPLICATION_NAME VARCHAR2(160),
    CL_NT_PLATFORM NT_TY_PLATFORM )
    NESTED TABLE CL_NT_PLATFORM STORE AS CL_NT_PLATFORM_TAB
    The table contains the data like this(Just for example):
    N_APPLICATION_ID VC_APPLICATION_NAME PLATFORM
    1 ABC Unix, Windows
    2 DEF Unix, MVS
    3 GHI Unix, Windows
    4 JKL Unix, Windows, MVS
    I have created the scripts like this...
    INSERT INTO T_APPLICATION(N_APPLICATION_ID, VC_APPLICATION_NAME) VALUES(1,'ABC');
    Like that for all applications...
    UPDATE T_APPLICATION SET CL_NT_PLATFORM=NT_TY_PLATFORM(TY_PLATFORM('Unix'),TY_PLATFORM('Windows')) WHERE N_ACCESS_NUMBER=1;
    Like that for all applications.....
    After creation i had queried
    SQL> select t.n_application_id from t_application t,table(cl_nt_platform)p
    2 where p.vc_platform='Unix' and p.vc_platform='Windows' and p.vc_platform!='MVS';
    no rows selected
    Actually i want the application list which run on unix and windows platform but not MVS
    It want the result like this:
    T.N_APPLICATION_ID
    1
    2
    but it is returning no rows selected.......
    Please help me......
    Thanks in advance.....

    Wrong forum my friend. This forum is for XML DB related issues, and while we use nested tables, we never have to worry about those nasty objects that were generated by XML Schema registration :)...
    I think you need...
    Objects

  • How to return a OCI Table * (nested table) from OCI application to sqlplus

    Hi,
    How to return a OCI Table * (nested table) from OCI application to sqlplus prompt : OCITAble * shows up as empty on the SQLPLUS prompt.
    The ODCIAggregateTerminate member function's OUT parameter is OCITable * returnValue. After completion of this member function it displays data on the sqlplus prompt.
    My problem is that eventhough my OCITable(returnvalue) has elements appended or added to it. But when I return the OCITAble after completion
    of this member function the OCITable shows up as empty collection on the SQLPLUS prompt. But in the OCI code if I iterate through the collection
    I can print out the elements and see their values or data.
    Can any one let me know how I can make the elements or data in the collection available at SQLPLUS prompt after the completion of this member function.
    If my return value or OUT parameter of this member function is OCINumber * returnValue : then I can see the corresponding value assigned in the OCI Code
    and the same value is returned and visible on the SQLPLUS prompt. But when I use the OUT parameter as OCITAble * : then it shows up as empty collection.
    I don't really know why is it happening so.
    member function ODCIAggregateTerminate(
    self IN OUT MinDistanceImpl, returnValue OUT table_out1,
    flags IN number)
    return number
    as language C
    library custagg name "ODCIAggregateTerminate"
    with context
    parameters (
    context,
    self,
    self INDICATOR STRUCT,
    returnValue ,
    returnValue INDICATOR,
    flags,
    flags INDICATOR ,
    RETURN ),
    typedef OCITable table_out1;
    struct ntab_type
    OCINumber empno;
    OCINumber salary;
    OCIString * tst;
    OCIString * te;
    typedef struct ntab_type ntab_type;
    struct ntab_type_ind
    OCIInd _atomic;
    OCIInd empno;
    OCIInd salary;
    OCIInd tst;
    OCIInd te;
    typedef struct ntab_type_ind ntab_type_ind;
    extern "C" OCINumber * ODCIAggregateTerminate(
    OCIExtProcContext *context,
    MinDistanceImpl * self,
    MinDistanceImpl_ind * self_ind,
    table_out1 * returnValue,
    short * returnValue_ind,
    OCINumber * flags,
    short flags_ind)
    ocitypename for collection..
    ocitypename for element
    ociobjectnew for collection
    ociobjectNew's for elements
    ocicollappend of elements to collection
    then iterate thru collection
    and at them collection as those elements and we return that collection
    But is empty : on SQLPLUS prompt :
    Select Mindis(TT) from table1;
    TT(empno, salary, tstart, te)
    Table_Out1()

    > Can anyone pls let me know if there is some way to return an entire table from a function which
    is called from a stored procedure?
    For what purpose?
    Do you realise that this means pulling Megabytes (or even many Gugabytes) of data from disk, into the buffer cache, and then copying that data into PL/SQL memory (using a function) in order to give a stored proc that data?
    This is just plain crazy.. resource wise, performance wise, scalability wise.. this is exactly how NOT to use Oracle.
    Why don't you instead tell us what problem you want to solve. Forget for the moment what you think the solution should be. (and asking us how to get a potentially flawed solution, to work)
    Let's get an accurate problem definition so that we can provide you with suggestions and recommendation on what Oracle features can be used to address that problem.

  • Reg: Querying Nested table.

    Hi,
    I am facing a problem with querying the Nested table.
    I have created a type
    CREATE OR REPLACE TYPE TY_BOOKS OBJECT(           VC_BOOK_NAME VARCHAR2(64)          );
    CREATE OR REPLACE TYPE NT_TY_BOOKS AS TABLE OF TY_BOOKS;
    I have used this nested table in a table Student.
    CREATE TABLE STUDENT
    ( SID NUMBER(10),
    CL_NT_BOOKS NT_TY_BOOKS)
    NESTED TABLE CL_NT_BOOKS STORE AS CL_NT_BOOKS_TAB;
    The problem is one student can have more than one book. So if I need to select the students who have 'Science' books, i wrote this query.
    SELECT S.SID,B.VC_BOOK_NAME FROM STUDENT S, TABLE(CL_NT_BOOKS) B WHERE B.VC_BOOK_NAME='Science';
    suppose in the table
    SID BOOK_NAME
    1000          CL_NT_BOOKS('Science')
    1001          CL_NT_BOOKS('Maths'),CL_NT_BOOKS('Science')
    This query will return only those student-ids who have only "Science" book not those student-ids who have "Maths" & "Science" books.
    RESULT
    1000          Science
    but not 1001....
    Please can any one send me the select query which can select iteratively for books names which contains more than one value.

    Hmm, mysterious. It works for me on my 9.2.0.6 dB...
    SQL> CREATE OR REPLACE TYPE TY_BOOKS AS  OBJECT( VC_BOOK_NAME VARCHAR2(64) );
      2  /
    Type created.
    SQL> CREATE OR REPLACE TYPE NT_TY_BOOKS AS TABLE OF TY_BOOKS;
      2  /
    Type created.
    SQL> CREATE TABLE STUDENT
      2  ( SID NUMBER(10),
      3  CL_NT_BOOKS NT_TY_BOOKS)
      4  NESTED TABLE CL_NT_BOOKS STORE AS CL_NT_BOOKS_TAB;
    Table created.
    SQL> INSERT INTO student VALUES (1000, NT_TY_BOOKS(TY_BOOKS('Science')))
      2  /
    1 row created.
    SQL> INSERT INTO student VALUES (1001, NT_TY_BOOKS(TY_BOOKS('Science'),TY_BOOKS('Maths')))
      2  /
    1 row created.
    SQL>
    SQL> SELECT S.SID,B.VC_BOOK_NAME FROM STUDENT S, TABLE(CL_NT_BOOKS) B
      2  WHERE B.VC_BOOK_NAME='Science'
      3  /
           SID VC_BOOK_NAME
          1000 Science
          1001 Science
    SQL> What I suggest is most likely to have happened is that you have added a space or some other non-printing cahracter into the book name when you inserted row 1001. If this is not the case then you'll have to do it again in SQL*Plus, cut teh output and paste it here, so we can see what's going on.
    Cheers, APC

  • Query Nested table (collection)

    I try to query on a nested table (collection).
    How ever, I get a 600 error.
    Is there any way to reuse the result of query in the store procedure?
    SQL> DECLARE
    2 TYPE T_PER_ID IS TABLE OF PERIOD.PER_ID%TYPE;
    3 V_EXP_PER_ID T_PER_ID;
    4 V_EXP_PER_ID2 T_PER_ID;
    5 BEGIN
    6 SELECT PER_ID BULK COLLECT INTO V_EXP_PER_ID FROM PERIOD;
    7 SELECT * BULK COLLECT INTO V_EXP_PER_ID2 FROM TABLE(V_EXP_PER_ID);
    8 END;
    9 /
    DECLARE
    ERROR at line 1:
    ORA-00600: internal error code, arguments: [15419], [severe error during PL/SQL
    execution], [], [], [], [], [], []
    ORA-06544: PL/SQL: internal error, arguments: [pfrrun.c:pfrbnd1()], [], [], [],
    ORA-06553: PLS-801: internal error [0]

    Oracle Version 8.1.6

  • Querying the tables from CIS

    Hi,
    I need to query the stellent content store( database) and get the values through my CIS application code.Is it possible ? if so how ?
    For ex : if want to check the existence of a folder name , how can i query and check that from CIS Code.

    The Query is:-SELECT A.ID, A.NAME, A.COMB, B.C1,B.C2, B.C3  FROM NT_KFD_RFT_TEST_DATE A, TABLE(OB_KFD_RFT_DATA) B
    Nested Table structure Example:-
    ID       NAME    COMB   OB_KFD_RFT_DATA
    01      TEST     ALL    
    The inner table (OB_KFD_RFT_DATA) structure is
    C1      C2        C3
    23.5   56.7   78.9
    00.9   76.9   53.3
    12.4   33.4   23.2
    Here outer record is 01 TEST ALL, and inner record is the 3 row decimal numbers.
    In Universe, I need to create Objects from C1,       C2,      C3 columns.
    Currently i'm doing it with derived table (by running above query). Is there any other option to do it?
    Thanks,
    Anu

  • Querying Nested Tables with Multiple other Tables

    I am trying to query columns from a table and it's nested table and do a join to another table.
    SELECT IM.*,
    IMP.PROGRAM_ID,
    S.STAGE_NAME
    FROM TB_ITEM_MASTER IM , TABLE(TB_ITEM_MASTER.PROGRAMS) IMP, TB_STAGE S
    WHERE S.STAGE_ID = IM.STAGE_ID
    AND IM.PROGRAM_ID IN(1,2);
    When running this query I receive the error:
    ORA-00904:"TB_ITEM_MASTER"."PROGRAMS": Invalid Identifier
    I actually copied this query straight from an Oracle Documentation, just replaced my table names with theirs. This query will almost be like a template to me as the program_id field in the Nested table is very cruicial to me. I will joining many tables to TB_ITEM_MASTER and using the where clause against program_id. What's the problem here?
    Please advise.
    ps. Did I mention how much I hate working with this Nested table stuff:(

    You must use the alias name, not the table name.
    SQL> create type employee_obj as object (empno number) ;
      2  /
    Type created.
    SQL> create type employees_nt is table of employee_obj ;
      2  /
    Type created.
    SQL> create table departments (deptno number(2), dname varchar2(20), employees employees_nt)
      2  nested table employees store as employees_table
      3  /
    Table created.
    SQL> insert into departments values (1, 'DEPT #1', employees_nt(employee_obj(2), employee_obj(3))) ;
    1 row created.
    SQL> insert into departments values (22, 'DEPT #2', employees_nt(employee_obj(22), employee_obj(33))) ;
    1 row created.
    SQL>
    SQL> SELECT IM.*,
      2  IMP.empno
      3  FROM departments IM , TABLE(IM.employees) IMP
      4  WHERE IM.deptno IN(1,2);
        DEPTNO DNAME
    EMPLOYEES(EMPNO)
         EMPNO
             1 DEPT #1
    EMPLOYEES_NT(EMPLOYEE_OBJ(2), EMPLOYEE_OBJ(3))
             2
             1 DEPT #1
    EMPLOYEES_NT(EMPLOYEE_OBJ(2), EMPLOYEE_OBJ(3))
             3
    2 rows selected.
    SQL>

  • How do you "Instantiate" a Nested Table from within a FUNCTION?

    , I managed to compile and create the FUNCTION.
    But when I invoked it,
    ORA-06531: Reference to uninitialized collection
    ORA-06512: at "DEV.SPGETPARENTSTABLE", line ...
    I think I need to somehow *"Instantiate"* the Nested Table and I didn't:
    CREATE OR REPLACE FUNCTION spGetParentsTable
    ObjectId number,
    ObjectClassifier varchar2
    RETURN types.TmpHiearchyMapTableType
    IS
    TmpHierarchyMap types.TmpHiearchyMapTableType;
    ThisTempId varchar2(32);
    CURSOR spGetParents_cursor IS
    SELECT
    ReferencedId Id,
    ParentId,
    ChildId,
    FROM TMP_HIERARCHYMAP
    WHERE TmpUID = ThisTempId;
    BEGIN
    SELECT sys_guid() INTO ThisTempId FROM dual;
    spRecursiveGetParents(ObjectId, ObjectClassifier, ThisTempId);
    FOR oMap in spGetParents_cursor LOOP
    TmpHierarchyMap.Extend(); **** BUT I haven't "Instantiate" the Nested Table yet ****
    TmpHierarchyMap(TmpHierarchyMap.Count) := TmpHierarchyMapObjType( oMap.Id
    , oMap.ParentId
    , oMap.ChildId
    END LOOP;
    DELETE FROM TMP_HIERARCHYMAP WHERE TmpUID = ThisTempId;
    RETURN TmpHierarchyMap;
    END spGetParentsTable;

    It's annonyingly trivial to fix. In your declaration section try
        TmpHierarchyMap types.TmpHiearchyMapTableType :=  types.TmpHiearchyMapTableType();
        ...Cheers, APC
    blog: http://radiofreetooting.blogspot.com

  • Problems with Whitespace using nested tables from eclipse dtp oracle plugin

    Hi,
    sending from eclipse to oracle xe fails if whitespace is used:
    Example1: Nested table in nested table
    adress_table_typ has another nested table in it
    that works
    CREATE TABLE x (
    i INTEGER PRIMARY KEY,
    adressen adress_table_typ
    ) NESTED TABLE adressen STORE AS adressen_nt (NESTED TABLE tels STORE AS tels_nt);
    inserting a newline fails
    CREATE TABLE x (
    i INTEGER PRIMARY KEY,
    adressen adress_table_typ
    ) NESTED TABLE adressen STORE AS adressen_nt
    (NESTED TABLE tels STORE AS tels_nt);
    Example2:
    Two nested tables
    CREATE TABLE x (
    i INT PRIMARY KEY,
    l_table_typ,
    m_table_typ
    ) NESTED TABLE laptops STORE AS laptop_nt NESTED TABLE interessen STORE AS interessen_nt;
    and then an insert
    INSERT INTO x VALUES (123456,
    l_typ(laptop_typ('123', 'netop'),
    laptop_typ('234', 'thinkpad'),     
    laptop_typ('345', 'iBook')),
    m_typ('a', 'b', 'c')
    which fails. Note that the INSERT works when copy&pasted to sqlplus. It also works if there is
    just one nested table.
    Am I doing somethig wrong or is this a bug in the eclipse data tools plugin?
    Regards
    - Peter
    PS; It is rather difficult to insert whitespace in that forum editor. Any possibility to have ascii?
    For a "whitespace" question rather important...

    A bit of an update on the original post. I was playing around with the plug-in xml file (e.g. eclipse\plugins\org.eclipse.jst.server.generic.oc4j_1.5.100.v20070608\buildfiles\oracle.10.1.3.xml). I changed the following from "deploy" to "redeploy" and it seems to be working once the applicatoin is initial deployed. Of course, I have to change it back to "deploy" if it is the first time the application is being deployed. However; I would still would like to resolve this if there is something out there that fixes this problem. Or if everything points to an enviornment problem, I can continue to play with it.
    <target name="deploy.j2ee.ear" depends="check.skip.ear.deploy" unless="skip.deploy">
    <antcall target="package.module.ear"/>
    <oracle:redeploy
    deployerUri="${deployer.uri}"
    userId="${oc4j.admin.user}"
    password="${oc4j.admin.password}"
    file="${server.publish.dir}/${module.name}.ear"
    deploymentName="${module.name}"
    bindAllWebApps="${oc4j.bind.website}"/>
    </target>

  • Query DB2 tables from oracle using normal view

    This is with regard to querying db2 tables using oracle views. The view is created using dblink. The querying is not an one time activity.querying will be done once in a day. Can i use normal view (will it work ) or should i use materialised view. will i be able to view the added records in db2 table using normal view?
    thanks,
    vinodh

    Vinodh2 wrote:
    This is with regard to querying db2 tables using oracle views. The view is created using dblink. The querying is not an one time activity.querying will be done once in a day. Can i use normal view (will it work ) or should i use materialised view. will i be able to view the added records in db2 table using normal view?How can the SQL select statement via a dblink not work for a view, but the same SQL select statement work for a materialised view?
    Do you think the database link or remote database care whether the select SQL that hits it, comes from a PL/SQL procedure, a view, a materialised view, a job or whatever else? It has no idea what/who is behind that select SQL - and nor does it care.
    As for the benefits of a view vs. a materialised view - that depends on the requirements for needing to use that foreign database's data in the local database.

  • Query builder: tables from Database Link

    Hi APEX people,
    Is there a way to use tables from a (remote) Database Link in the Query Builder?
    In the Query Builder I seem to have only access to locally (schema) stored tables.
    I already tried to define a Synonym for the remote tables I wanted to use, but that didn't work either.
    Thanks in advance.
    Maurice

    Hi,
    First of all, can you select from them ie
    SELECT  *
    FROM my_table@my_linkAlso you can't see them as tables in the schema because they're not tables in the schema.
    Try creating a view like...
    CREATE OR REPLACE FORCE VIEW m_table_vw AS
    SELECT *
    FROM my_table@my_link;You should be able to see the view in the schema in the query builder and use that.
    Cheers
    Ben

  • Query nested table?

    Let's say I have an object type "pair" with elements "name" and "value". I create a nested table type "pairtable" of type "pair". Then I create a view, "view", that has a column "nametable". The values in "nametable" are the result of a function that takes the value in the first column of the view, "id", and builds a nested table of type "pairtable" with the "names" and "values" associated with "id" that are stored in other tables. Clear as mud, yes?
    If I type this into SQL+
    select * from view where id = 100
    I get
    id col2 col3 col4 nametable
    100 A B C pairtable(pair(aname, avalue)),pairtable(pair(bname, bvalue)),...
    What I want is a cursor that contains only the "names" and "values" from a select number of "id"s.
    What is the syntax?
    Database is 8i, client is 9.2.
    (p.s. Eventually I will want to call these name value pairs from .NET as a REF Cursor. For now I will settle for something that works in PL/SQL)

    Ross,
    OLEDB does not support object types or nested table. This restriction is limited by the Microsoft OLEDB specfication.
    This forum is for ODP.NET. You may want to post this question to OLEDB forum.
    Thanks
    Martha

  • Query with Tables from another Database

    Hi.
    I have a problem with a Query that executes a stored procedure that inserts data in a Table from another DataBase. The problem is when I try to execute a Query with the data related of that table using the user parameters of SBO ('[%0]'....'[%3]'). I use the following parameters for reference to the Table:
    "....FROM [-BDName-].[dbo].[-TableName-] T1..... "
    Any suggestions? Thanks a lot....
    (Suggestions in English or Spanish)

    None

  • Synonym required to query custom tables from Oracle Apps database

    When creating an Answers report that queries from a table owned by a custom schema (not APPS), I cannot query the table and get error. Once I add a Synonym for APPS on this table, then OBIEE works normally.
    Since OBIEE is logging in as the APPS user, are Synonyms required for all non-APPS tables/views or is there another feature of the Administrator where it can store the table alias (our typical owner of custom tables is XXFI)?

    OK, well "compare" can mean one of two things: Compare structure or compare contents. Here is a quick script to compare column structures of two tables on one database:
    (select COLUMN_NAME,
    DATA_TYPE,
    DATA_LENGTH,
    DATA_PRECISION,
    DATA_SCALE,
    NULLABLE
    from dba_Tab_columns
    where owner=:OWNR1
    and table_name = :tablename
    minus
    select COLUMN_NAME,
    DATA_TYPE,
    DATA_LENGTH,
    DATA_PRECISION,
    DATA_SCALE,
    NULLABLE
    from dba_Tab_columns
    where owner=:ownr2
    and table_name = :tablename)
    union all
    (select COLUMN_NAME,
    DATA_TYPE,
    DATA_LENGTH,
    DATA_PRECISION,
    DATA_SCALE,
    NULLABLE
    from dba_Tab_columns
    where owner=:ownr2
    and table_name = :tablename
    minus
    select COLUMN_NAME,
    DATA_TYPE,
    DATA_LENGTH,
    DATA_PRECISION,
    DATA_SCALE,
    NULLABLE
    from dba_Tab_columns
    where owner=:ownr1
    and table_name = :tablename)
    If this query returns any rows, then these indicate that there are structural differences between the tables. We do a minus in both directions to ensure that an additional column in either schema will be returned in the query.
    If you are going across dblinks to remote tables then you have to amend the "dba_tab_columns" to "sys.dba_tab_columns@yourdblink"
    If you also want to compare indexes, triggers, etc then do the same sort of thing for the associated dba_ views for those objects.
    And if you want to compare table contents, then often the fastest way is also to check minuses in both directions, if the tables are not too big:
    e.g.
    (select * from schema1.table@dblink1
    minus
    select * from schema2.table@dblink2)
    union all
    (select * from schema2.table@dblink2
    minus
    select * from schema1.table@dblink1)
    local tables, of course, simply omit the "@dblink" issues.
    There are tools to help in such things. TOAD, for example, has a pretty good schema comparison tool, and there are plenty of other options out there. But if you need to script this yourself then the logic I've shown is a good starting point.
    Cheers,
    Mike

  • Query MySQL table from login form.

    Probably a simple question, but I can't seem to get it. Here my
    my table on MySQL
    ID        Username        UFN           ULN             Password
    1         joSmith            John           Smith           encrypted
    2         jaSmith            Jane           Smith           encrypted
    3         jDoe                 John           Doe             encrypted
    When I login using username and password, I want to display the first name and last name for the user and display it on the next page. I can usually echo a _POST, but when it comes to sessions, this doesn't seem to work properly, as the next page doesn't know the variable.

    Sorry here is the code, its generated from the login user wizard from dreamweaver. It doesn't matter what code is on the second page as the session and post variables are "gone", I can't call on it. This code of course will successfully login to the restricted pages without issues.
    <?php require_once('Connections/UserAcc_mySQL.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;
    ?>
    <?php
    // *** Validate request to login to this site.
    if (!isset($_SESSION)) {
      session_start();
    $loginFormAction = $_SERVER['PHP_SELF'];
    if (isset($_GET['accesscheck'])) {
      $_SESSION['PrevUrl'] = $_GET['accesscheck'];
    if (isset($_POST['username'])) {
      $loginUsername=$_POST['username'];
      $password=md5($_POST['password']);
      $UN=$_POST['usern'];
      $MM_fldUserAuthorization = "";
      $MM_redirectLoginSuccess = "loginredirect.php";
      $MM_redirectLoginFailed = "adminlogin.php";
      $MM_redirecttoReferrer = false;
      mysql_select_db($database_UserAcc_mySQL, $UserAcc_mySQL);
      $LoginRS__query=sprintf("SELECT `User`, Password, UFN, ULN FROM username WHERE `User`=%s AND Password=%s",
        GetSQLValueString($loginUsername, "text"), GetSQLValueString($password, "text"));
      $LoginRS = mysql_query($LoginRS__query, $UserAcc_mySQL) or die(mysql_error());
      $loginFoundUser = mysql_num_rows($LoginRS);
      if ($loginFoundUser) {
         $loginStrGroup = "";
        //declare two session variables and assign them
        $_SESSION['MM_Username'] = $loginUsername;
        $_SESSION['MM_UserGroup'] = $loginStrGroup;     
        if (isset($_SESSION['PrevUrl']) && false) {
          $MM_redirectLoginSuccess = $_SESSION['PrevUrl'];
        header("Location: " . $MM_redirectLoginSuccess );
      else {
        header("Location: ". $MM_redirectLoginFailed );
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    <style>
    .Login
    position:absolute;
    vertical-align:middle;
    margin-left: 40%;
    margin-right: 40%;
    top: 153px;
    </style>
    </head>
    <body>
    <div class="Login">
    <form ACTION="<?php echo $loginFormAction; ?>" method="POST" name="LogMeIn">
    <label>Username:</label> <input type="text" name="username" id="username" /><br />
    <label>Password: </label><input type="password" name="password" /><br />
    <input type="hidden" name="user" />
        <input type="submit" value="Login" />
    </form>
    </div>
    </body>
    </html>

Maybe you are looking for

  • My iPhone 5 won't start!

    My Iphone 5 won't start and tells me to connect the phone to ITunes but nothing happens when I do. The phone doesn´t show up in ITunes. What to do?

  • How to get my mail through without opening the mail app...

    Hi I have a tendancy to when ive finished using with my apps on my Mac I always go to top left and press quit itunes or quit mail etc if i do that to mail, obviously when a email comes through i dont get it straight through unless the mail program is

  • Excise Duties in Purchase Order

    Hi Experts, I seek some advice from you regarding Excise Duties flow in the Purchase order. The Excise duties are flowing through the invoice tab of Purchase order.We are maintaining the condition record based on Key Combination (e.g. Plant/Material

  • JDBC: select according to message content

    Hi, Is it possible to select data via the JDBC adapter building the SELECT statement using content in the message rather than using a fixed select statement on the communication channel ? For instance, there may be a time date in the message that sho

  • ICal will not let me import backed up "icbu" Data

    I recently downgraded from iCal Beta as I was unhappy with the push function between my iPad and what was updated via a web browser. In the process, I made a back up for the iCal as icbu file (following file-export-export). After downgrading it to no