1. How to keep old data in record no matter how many times I enter some data ?
I did not understand this question!
2. How to reduce number of input arguments, now I need to specify all values (output_size and total := 0) so I can calculate changes.
PLSQL does support default parameter values.
So you can ignore total from actual parameter list when calling this procedure.
3. How can I add more rigid checks in if statement for example (if total_size > 0 && output_size == 0) ?
PLSQL does support AND and OR
Hi
i'm calling a pl/sql procedure which is returning one variable.
i'm trying to assing this value to variable in shell script
the code i wrote is
** in shell script**
var= 'sqlplus user/pass @ret.sql'
echo $var
**
and
variable dum_var number
exec rt_test(:DUM_VAR);
exit;
in... (4 Replies)
Hi All
I would be thankful to you all if you will guide me the steps to call a stored proc. from unix shell script. that stored proc. could be parameterised or parameterless developed in SQL.
Any info. in this topic would help me.....
Thanks in advance.... (1 Reply)
Hi,
Can anyone please let me know where to check if a particular stored procedure exists.
If the procedure exists I want to display some message and if the procedure does not exists i want to exit with error message.
checking from dba_objects doesnt help. suprisingly the procedure i... (3 Replies)
How could I call an Oracle PL/SQL procedure from any shell (bash) and catch returning value from that procedure (out param) or get a returning value if it's a function.
also, I got into trouble when I tried to send a number as a param
#!/bin/bash -e
username=$1
pwd=$2
baza=$3... (0 Replies)
Hi,
Can any one help me how to write a sql procedure in a pro *c file for selecting the data from a database and inserting the rows into a queue in a .pc file.
thanx in advance. (1 Reply)
Hello All,
I am writing the below unix script to email the result of a small pl sql procedure:
#!/bin/bash
ORACLE_HOME=/opt/oracle/orcts/product/9.2.0; export ORACLE_HOME
SQLPLUS=$ORACLE_HOME/bin/sqlplus
sqlplus -s user/pass@Db_instance<<EOF
set echo off
set feedback off
set pages 0... (9 Replies)
Hi,
We have a procedure e.g. prc_synonym created in Oracle 12c Database. I want to do small change in procedure through Unix. I have that changed procedure (prc_synonym) in proc.sql file. Want to recompile that procedure through Unix so that changes should reflect in existing procedure in... (10 Replies)
Discussion started by: Aparna.N
10 Replies
LEARN ABOUT CENTOS
create_foreign_table
CREATE FOREIGN TABLE(7) PostgreSQL 9.2.7 Documentation CREATE FOREIGN TABLE(7)NAME
CREATE_FOREIGN_TABLE - define a new foreign table
SYNOPSIS
CREATE FOREIGN TABLE [ IF NOT EXISTS ] table_name ( [
{ column_name data_type [ OPTIONS ( option 'value' [, ... ] ) ] [ NULL | NOT NULL ] }
[, ... ]
] )
SERVER server_name
[ OPTIONS ( option 'value' [, ... ] ) ]
DESCRIPTION
CREATE FOREIGN TABLE will create a new foreign table in the current database. The table will be owned by the user issuing the command.
If a schema name is given (for example, CREATE FOREIGN TABLE myschema.mytable ...) then the table is created in the specified schema.
Otherwise it is created in the current schema. The name of the foreign table must be distinct from the name of any other foreign table,
table, sequence, index, or view in the same schema.
CREATE FOREIGN TABLE also automatically creates a data type that represents the composite type corresponding to one row of the foreign
table. Therefore, foreign tables cannot have the same name as any existing data type in the same schema.
To be able to create a table, you must have USAGE privilege on all column types.
PARAMETERS
IF NOT EXISTS
Do not throw an error if a relation with the same name already exists. A notice is issued in this case. Note that there is no guarantee
that the existing relation is anything like the one that would have been created.
table_name
The name (optionally schema-qualified) of the table to be created.
column_name
The name of a column to be created in the new table.
data_type
The data type of the column. This can include array specifiers. For more information on the data types supported by PostgreSQL, refer
to Chapter 8, Data Types, in the documentation.
NOT NULL
The column is not allowed to contain null values.
NULL
The column is allowed to contain null values. This is the default.
This clause is only provided for compatibility with non-standard SQL databases. Its use is discouraged in new applications.
server_name
The name of an existing server for the foreign table.
OPTIONS ( option 'value' [, ...] )
Options to be associated with the new foreign table or one of its columns. The allowed option names and values are specific to each
foreign data wrapper and are validated using the foreign-data wrapper's validator function. Duplicate option names are not allowed
(although it's OK for a table option and a column option to have the same name).
EXAMPLES
Create foreign table films with film_server:
CREATE FOREIGN TABLE films (
code char(5) NOT NULL,
title varchar(40) NOT NULL,
did integer NOT NULL,
date_prod date,
kind varchar(10),
len interval hour to minute
)
SERVER film_server;
COMPATIBILITY
The CREATE FOREIGN TABLE command largely conforms to the SQL standard; however, much as with CREATE TABLE, NULL constraints and zero-column
foreign tables are permitted.
SEE ALSO
ALTER FOREIGN TABLE (ALTER_FOREIGN_TABLE(7)), DROP FOREIGN TABLE (DROP_FOREIGN_TABLE(7)), CREATE TABLE (CREATE_TABLE(7)), CREATE SERVER
(CREATE_SERVER(7))
PostgreSQL 9.2.7 2014-02-17 CREATE FOREIGN TABLE(7)