07-28-2006
hi
i tried your query. when i execute that i am getting an error like this "SQL plus cant be found" is there a way not to mention the user name and pwd in the script. thanks
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I cannot figure out how to run a SQL script, or just a sqlplus query, from a shell script (bash or ksh). Basically, I need to su - oracle from root and run a query, then test the exit status. (3 Replies)
Discussion started by: 98_1LE
3 Replies
2. Shell Programming and Scripting
Hi ALL,
I need an help in connecting to oracle database, executing a select query and printing it on the screen. Can any one please write a simple code or psuedo code and let me know.
select query returns multiple values( say select name from emp)
Thanks in advance
LM (1 Reply)
Discussion started by: lijju.mathew
1 Replies
3. Shell Programming and Scripting
Hello,
I have a sh script excuting a sql query through sqlplus. I am having trouble making my date equal to the date of the server time in the sql script. How can i call the server date from my query?
Thanks (2 Replies)
Discussion started by: kingluke
2 Replies
4. Shell Programming and Scripting
query sql using shell script, is it possible?
my friend told me to do a file.sql and link to my shell script, but can i query sql using shell script?
thanks in advance! (2 Replies)
Discussion started by: kingpeejay
2 Replies
5. UNIX for Dummies Questions & Answers
I want to perform few post-session success tasks like update a status to 'true' in one of the sql database table, update date values to current system date in one of the configuration table in sql. How do i achieve this in a post session command?syntax with example will be helpful. (3 Replies)
Discussion started by: nathanvaithi
3 Replies
6. Shell Programming and Scripting
Hi,
I need to call a shell script present on solaris server from within a PL / SQL block.
Kindly suggest..
Thanks
Sudhir (1 Reply)
Discussion started by: sudhird
1 Replies
7. Shell Programming and Scripting
Hi all,
My reqirenet goes like this.
Need to execute one select statement within the script and send a mail to the users with the number of records fecthed from the query.
Please help..
Thanks. (3 Replies)
Discussion started by: Achiever
3 Replies
8. UNIX for Dummies Questions & Answers
Hi,
I have one SQL file prepared in UNIX and one script that is executing that.
In SQL i have Update and create queries.
I want to introduce conditions in SQL file (in UNIX) that if either of the create or update query failes whole transaction should be rollback.
I just have 1 create... (2 Replies)
Discussion started by: abhii
2 Replies
9. Red Hat
hey , i am using this code to store value of a sql query and and then use
it in other query but after some time , but it is not working. please help
#!/bin/bash
val_1=$( sqlplus -s rte/rted2@rel76d2 << EOF
setting heading off
select max(stat_id) from cvt_stats;
exit
EOF
)
nohup... (5 Replies)
Discussion started by: ramsavi
5 Replies
10. UNIX for Beginners Questions & Answers
Hello~
I have a requirement to write a shell script which will connect to the oracle database and run a select count(*) query on a table.
The script should succeed only when the count returns a number greater than zero. If the count returns zero, the script should fail.
Can someone please... (3 Replies)
Discussion started by: Naren.N
3 Replies
LEARN ABOUT PHP
sql-acceptable-by-4d
SQL-ACCEPTABLE-BY-4D(3) 1 SQL-ACCEPTABLE-BY-4D(3)
SQL acceptable by 4D - PDO and SQL 4D
4D implements strictly the ANSI 89 standard, and have it enforced. It is highly recommended to read the 4D SQL documentation to learn
about the available commands. The URL of the manual is : http://doc.4d.com/. Below is a list of 4D SQL characteristics: it is not exhaus-
tive, but may serve as an introduction.
Characteristics of 4D SQL
+-------------------------------------+--------------------------------------+---+
| Characteristics | | |
| | | |
| | Alternative | |
| | | |
| | Note | |
| | | |
+-------------------------------------+--------------------------------------+---+
| INTEGER | | |
| | | |
| | Modify the SQL to use INT. | |
| | | |
| | INT is the supported integer type in | |
| | 4Dv12.0. | |
| | | |
| CHAR | | |
| | | |
| | Use VARCHAR instead. | |
| | | |
| | Unsupported in 4Dv12.0 | |
| | | |
| UNION | | |
| | | |
| | Unsupported. Make separate queries. | |
| | | |
| | Unsupported in 4Dv12.0 | |
| | | |
| SELECT 1 + 1; | | |
| | | |
| | SELECT 1 + 1 FROM _USER_SCHEMAS; | |
| | | |
| | FROM is required | |
| | | |
| FLOAT | | |
| | | |
| | Cast the FLOAT value into a FLOAT or | |
| | STRING, with an SQL 4D function | |
| | (CAST, ROUND, TRUNC or TRUNCATE) | |
| | | |
| | Unsupported in current versions of | |
| | the PDO_4D driver | |
| | | |
| Strong typing | | |
| | | |
| | Take care your SQL query, or your | |
| | PHP code provides data with the | |
| | expected type | |
| | | |
| | One must provide the right type | |
| | that 4D expect. One can't insert '1' | |
| | (as a string) in an INTEGER column. | |
| | | |
|PDO.execute(row)(3) : only works if | | |
|all the table's column are of type | | |
|TEXT or VARCHAR | | |
| | | |
| | Use the prepared statements, and use | |
| | the right types. | |
| | | |
| | The PDO extension cast all values | |
| | through execute() as string, and | |
| | expect the SQL database to parse the | |
| | values. | |
| | | |
| SELECT NULL FROM TABLE | | |
| | | |
| | Do not use NULL constants. Extract | |
| | them from the table | |
| | | |
| | It is not allowed to use the NULL | |
| | constant in the select list | |
| | | |
| SELECT * FROM TABLE WHERE 1 | | |
| | | |
| | Use WHERE 1 = 1 | |
| | | |
| | A constant can't be used in a WHERE | |
| | clause | |
| | | |
| SHOW TABLES | | |
| | | |
| | Use system tables | |
| | | |
| | The list of tables, schemas, index, | |
| | etc. are in these system tables : | |
| | _USER_TABLES, _USER_COLUMNS, | |
| | _USER_INDEXES, _USER_CONSTRAINTS, | |
| | _USER_IND_COLUMNS, _USER_CONS_COL- | |
| | UMNS, and _USER_SCHEMAS. | |
| | | |
| SQL structure delimiter | | |
| | | |
| | Use the following function to pro- | |
| | tect SQL elements: function | |
| | sqlEscapeElement(elem) { return '[' | |
| | . str_replace(']',']]', $elem) . | |
| | ']'; } | |
| | | |
| | To escape SQL elements names | |
| | (tables, fields, users, groups, | |
| | schema, primary key, etc.), the | |
| | whole identifier must be between | |
| | square brackets, and the closing | |
| | brackets ']' must be doubled. | |
| | | |
+-------------------------------------+--------------------------------------+---+
PHP Documentation Group SQL-ACCEPTABLE-BY-4D(3)