The fastest easiest way to get it right.

ddView

NAME

ddView

FUNCTION

If a table has row-level or column-level security, then direct table access is denied to all users, all access must go through views for that table. This routine returns the name of the view that can be used by the currently logged in user.

It is good practice when coding SQL manually to always use this routine and never to manually hardcode table names, unless you can be completely certain your application will never contain row-level and column-level security.

When you use routines like SQLX_Insert and SQLX_Update you can use the base table name, those routines do not require you to pass in a view name. Those routines make the call themselves to get the view name.

INPUTS

array $tabx - Data Dictionary table

RETURN VALUE string - the view name of the table

EXAMPLE

Here is an example of a manual query:

       <?php
       # Employees table has row-level security, so we must
       # find out the name of the view the current user is
       # able to access.
       $view = ddView('employees');
       # Now code the view into an ad-hoc query
       $sql  = "select * from $view where dept='xyz'";
       $emps = SQL_AllRows($sql);
       ?>

User Comments

There are no user comments yet on this page.


Add A Comment

Comments will not appear until after they are moderated. Comments are usually moderated within a few hours on weekdays, but may take longer on weekends and holidays.

Name or nickname: (This will appear with your comment)


Email (this will never be displayed)


Enter your comment here. Use [b] and [/b] for bold, [i] and [/i] for italic, and [pre] and [/pre] for code samples. All literal HTML and PHP that you enter will be escaped out and displayed as you enter it.


Home |  Documentation |  Download |  Credits |  Contact |  Login
Andromeda © Copyright 2004-2010, Licensed under the GPL Version 2