Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

mssql_init(3) [php man page]

MSSQL_INIT(3)															     MSSQL_INIT(3)

mssql_init - Initializes a stored procedure or a remote stored procedure

SYNOPSIS
resource mssql_init (string $sp_name, [resource $link_identifier]) DESCRIPTION
Initializes a stored procedure or a remote stored procedure. PARAMETERS
o $sp_name - Stored procedure name, like ownew.sp_name or otherdb.owner.sp_name. o $link_identifier - A MS SQL link identifier, returned by mssql_connect(3). RETURN VALUES
Returns a resource identifier "statement", used in subsequent calls to mssql_bind(3) and mssql_execute(3), or FALSE on errors. EXAMPLES
Example #1 mssql_init(3) example <?php // Connect to MSSQL and select the database $link = mssql_connect('KALLESPCSQLEXPRESS', 'sa', 'phpfi'); mssql_select_db('php', $link); // Create a new statement $stmt = mssql_init('StatementTest', $link); // Bind values here // Once values are binded we execute our statement // using mssql_execute: mssql_execute($stmt); // And we can free it like so: mssql_free_statement($stmt); ?> SEE ALSO
mssql_bind(3), mssql_execute(3), mssql_free_statement(3). PHP Documentation Group MSSQL_INIT(3)

Check Out this Related Man Page

MSSQL_BIND(3)															     MSSQL_BIND(3)

mssql_bind - Adds a parameter to a stored procedure or a remote stored procedure

SYNOPSIS
bool mssql_bind (resource $stmt, string $param_name, mixed &$var, int $type, [bool $is_output = false], [bool $is_null = false], [int $maxlen = -1]) DESCRIPTION
Binds a parameter to a stored procedure or a remote stored procedure. PARAMETERS
o $stmt - Statement resource, obtained with mssql_init(3). o $param_name - The parameter name, as a string. Note You have to include the @ character, like in the T-SQL syntax. See the explanation included in mssql_execute(3). o $var - The PHP variable you'll bind the MSSQL parameter to. It is passed by reference, to retrieve OUTPUT and RETVAL values after the procedure execution. o $type - One of: SQLTEXT, SQLVARCHAR, SQLCHAR, SQLINT1, SQLINT2, SQLINT4, SQLBIT, SQLFLT4, SQLFLT8, SQLFLTN. o $is_output - Whether the value is an OUTPUT parameter or not. If it's an OUTPUT parameter and you don't mention it, it will be treated as a normal input parameter and no error will be thrown. o $is_null - Whether the parameter is NULL or not. Passing the NULL value as $var will not do the job. o $maxlen - Used with char/varchar values. You have to indicate the length of the data so if the parameter is a varchar(50), the type must be SQLVARCHAR and this value 50. RETURN VALUES
Returns TRUE on success or FALSE on failure. EXAMPLES
Example #1 mssql_bind(3) example <?php // Connect to MSSQL and select the database mssql_connect('KALLESPCSQLEXPRESS', 'sa', 'phpfi'); mssql_select_db('php'); // Create a new stored prodecure $stmt = mssql_init('NewUserRecord'); // Bind the field names mssql_bind($stmt, '@username', 'Kalle', SQLVARCHAR, false, false, 60); mssql_bind($stmt, '@name', 'Kalle', SQLVARCHAR, false, false, 60); mssql_bind($stmt, '@age', 19, SQLINT1, false, false, 3); // Execute mssql_execute($stmt); // Free statement mssql_free_statement($stmt); ?> SEE ALSO
mssql_execute(3), mssql_free_statement(3), mssql_init(3). PHP Documentation Group MSSQL_BIND(3)
Man Page

15 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Oracle stored procedure.

I am using sqlplus. I have the stored procedure name. How can i print the stored procedure content? (2 Replies)
Discussion started by: kamil
2 Replies

2. What is on Your Mind?

Stored Procedures

(2 Replies)
Discussion started by: thumsup9
2 Replies

3. UNIX for Dummies Questions & Answers

error connecting to sqlplus

Hi, I wrote a shell script to call oracle procedure. But when i am trying to connet sqlplus with the fallowing statement It is giving me error " callproce.sh : sqlplus: not found". What could be the problem. sqlplus -s $CONNECT_STRING >$LOGFILE <<!! thank u all papachi (2 Replies)
Discussion started by: papachi
2 Replies

4. Shell Programming and Scripting

Shell arrays in oracle stored procedure

Is it possible to pass unix shell arrays in Oracle stored procedure? Is yes, how? Thanks (6 Replies)
Discussion started by: superprogrammer
6 Replies

5. Shell Programming and Scripting

Stored Procedure on NT/SQLServer

Hi: How will I execute a Stored Procedure that sits on NT/SQLServer. Any help would be appreciated. Thanks (3 Replies)
Discussion started by: mayohan
3 Replies

6. Programming

How to call sqlloader from stored procedure!!! Advise

Hi , I have a dellimited .dat file and a sqlloader. I want to call the sqlloader from a oracle stored procedure. The procedure should return the result of sqlloader's execution. (3 Replies)
Discussion started by: Haque123
3 Replies

7. UNIX for Dummies Questions & Answers

for statement

removed the link due to some issues and i got the information i needed (4 Replies)
Discussion started by: Amit Sura
4 Replies

8. Programming

Help with pl/sql stored procedure

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)
Discussion started by: justchill
3 Replies

9. UNIX for Dummies Questions & Answers

Calling stored procedure from unix

Hi, My stored procedure returns a value. How to retrieve the value and display in unix. Stored procedure CREATE OR REPLACE PROCEDURE gohan(num INT) IS BEGIN DBMS_OUTPUT.PUT_LINE('My lucky number is ' || num); END; Unix Scripting i used sqlplus -s... (7 Replies)
Discussion started by: gohan3376
7 Replies

10. Shell Programming and Scripting

how to pass the values to unix shell from the oracle stored procedure.

Hi i am calling a stored procedure from unix shell like this call test_proc('0002','20100218'); the stored procedure was giving output like this dbms_output.put_line(' processed earlier'); i want to see the output in the unix shell where i called. Thanks barani (6 Replies)
Discussion started by: barani75
6 Replies

11. Shell Programming and Scripting

how to call oracle stored procedure from unix shell

Hi i want to call a oracle stored procedure from unix (using bash shell). consider this is my oracle stored procedure with parameter create procedure testproc(name IN varchar, age IN Number, id OUT Number ) AS begin id=1; dbms_output.put.line('successfull validation') end;... (6 Replies)
Discussion started by: barani75
6 Replies

12. Shell Programming and Scripting

Error in calling store procedure using SQLPLUS in unix

Hi, I am facing the following error in calling the stored procedure from SQLPLUS in unix environment. SQL> set serveroutput on SQL> var store number; SQL> exec test_proc(:store, 200); BEGIN TEST_PROC(:store, 200); END; * ERROR at line 1: ORA-01858: a non-numeric character was found... (8 Replies)
Discussion started by: pradeep7986
8 Replies

13. Shell Programming and Scripting

Execute stored procedure through script in sybase database and store the output in a .csv file

Hi, I have a sybase stored procedure which takes two input parameters (start_date and end_date) and when it get executed, it gives few records as an output. I want to write a unix script (ksh) which login to the sybase database, then execute this stored procedure (takes the input parameter as... (8 Replies)
Discussion started by: amit.mathur08
8 Replies

14. Shell Programming and Scripting

How to create and call mysql stored procedure in perl?

Hi, I want to create MySQL stored procedure and call the stored procedure using perl. I tried like this: use DBI; my $dbh = DBI->connect ("DBI:mysql:test", "root", "ibab", { RaiseError => 1, PrintError => 0}); $create_procedure =... (5 Replies)
Discussion started by: vanitham
5 Replies

15. Shell Programming and Scripting

awk statement to eliminate the duplicates

consider the below output cat tablextract2.sql CREATE PROCEDURE after72DeleteTgr(id int) BEGIN END $$ Delimiter ; CREATE PROCEDURE after72DeleteTgr(id int) BEGIN END $$ Delimiter ; # # proc_name1="after72DeleteTgr" # # echo "`awk '{if($3~v){a=1}}a;/elimiter\|DELIMITER/{exit}'... (17 Replies)
Discussion started by: vivek d r
17 Replies