what is a procedure/trigger in dbms and how is it created?
921379
Stored Procedure is a self-contained program written in Database procedure and trigger language, and stored as part of a the database metadata.\nOnce you have created a stored procedure, you can invoke it directly from an application, or substitute the procedure for a table or view in a SELECT statement.\nStored procedures can receive input parameters from and return values to applications.\n\nA trigger is a self-contained routine associated with a table or view that automatically performs an action when a row in the table or view is inserted, updated, or deleted.\nA trigger is never called directly. Instead, when an application or user attempts to INSERT, UPDATE, or DELETE a row in a table, any triggers associated with that table and operation are automatically executed, or fired.\n\nStored Procedure and Trigger are different from one database system to another. So always check you Database Documentation to learn their format.\n\nI will glad to help you to write Stored Procedure and Trigger, but i'm affraid that you must work a little harder to convert it to your database procedure and trigger language.
117633
I'm only answering this because I haven't seen anyone else.  I'm not an Oracle DBA, but I have extensive experience in SyBase.\n\n1) Look through your doc for a thing called sqlloader - this is the thing Oracle provides to do the job.  Basically, unloading a table using sqlloader takes the data in your table and writes it in a format that sqlloader can rewrite.\n\n2) If you are really good at PL/SQL, you can write you own unload/reload process (this is what I have to do to move data from one RDBMS to another, like from Oracle to Sybase).  Write a program that generates as output the SQL Insert statements needed to load your data.  In other words, it writes on Insert statement for every row that already exists.
335757
Can you post any of the code you are trying to do? Im not sure I understand completely what you are trying to accomplish. So you have 266 records in a table and you are trying to do an update on any given record? What is the SQL you are trying to run to do it?\n\nAssuming you have an id field for the 266 records, you just need to do something like "update tablename set field1 = 'blah', field2 = 'somethingelse' where id = #ofidfield". I am assuming you have the html form set up so that the submit page has the uddate query that will probably need the ID field # passed in as a form variable or passed on the URL.\n\nSo when you are outputting the detail records, are you looping through the recordset to create the update link that goes to the update page? So that every detail record has a link to update some information and that link has a distinct ID in it? And have you output the ID you are trying to use before the SQL update query is run to make sure you are using the right value? I guess what I am getting at is it the update query itself that isnt working or are you not getting the right value to that query (but it actually works even though not updating the right record).\n\nSo two things to check. Have you verified that the 32 is actually being passed in the URL? Then have you checked the update statement to make sure it is using that URL variable in the where clause so it knows what record to update? Also, are you on classic asp or aspx?
938312
INSERT INTO table_name (field1, field2, ...) VALUES ('value1','value2'...);
892672
It's very easy if you build a stored procedure to get the output like that .\nStored Procedure is created to handle all complex query and the most impossible query, so always find the alternative in Stored Procedure if you ever get stuck with your query.\n\nin stored procedure :\n- make a loop query : 'Select distinct ID1, ID2 from myTable'\n- and in the loop, make query like : 'Select GUID from myTable where ID1=:ID1 and ID2=:ID2 order by GUID rows 1' \n\nthis stored procedure is for Interbase/firebird structure :\nCREATE PROCEDURE WEIRD_QUERY\nReturns\n( \n ID1 integer,\n ID2 integer,\n GUID varchar(30)\n)\nas\nbegin\n  For\n  Select distinct ID1, ID2 from myTable into ID1, ID2 \n    do begin\n       Select GUID from myTable\n       where ID1=:ID1 and ID2=:ID2 order by GUID rows 1\n       into GUID \n       end\n   suspend;\nend;\n\nNotes :\n- Rows 1 is to limit our query result,  in mySql 'rows' is 'Limit' \n- suspend is a loop query\n\ntry to convert my stored procedure structure to your Microsoft Sql Server structure\nor\nyou can keep searching the way to build your query without using stored procedure.\n\nsorry, this is the best i can help.
1088795
Use SQLDMO and SQLDTS both are references for the SQL Server. But they should also work with Oracle. But it's a crazy thing. I just do it on an SQL Server and you get mad by solving all the errors you can get.\n\nHelmut\n\nP.S.: A good source to get a idea about it, download the SQL Samples and look for the Bulk Insert Task
828970
dim db as database\ndim rs as recordset\ndim strSQL as string\ndim strA as string\ndim strB as string\ndim strC as string\n\nset db = currentDB\n\nstrSQL = "Select fieldA, fieldB, fieldC from Table1 where FieldD = fieldvalue"\n\nset rs = db.openrecordset(strSQL, dbOpenDynaSet)\n\nif not rs.EOF then\nstrA = rs!fieldA\nstrB = rs!fieldB\nstrC = rs!fieldC\n\nend if
312052
You could use "select * from table_name where char_field_name like '%'".\n\nBut it would be better to remove the where clause, as this will save up some system resource during the SQL execution.
360932
A stored procedure. Or, if there's no support for stored procedures per se, a function.\n\nGood luck with the rest of your homework!
918322
CREATE TABLE cus_tmp as (SELECT * FROM members WHERE tel_hp LIKE '% - %');\n\nAll you are missing is the ().\n\nEnjoy -
180876
no idea how in your language, but....\n\nin SQL server there is an execute() function that will execute the script, maybe there is one in your language:\n\ndeclare @SQL varchar(2000)\ndeclare @mytable varchar(20)\nset @mytable = "TheTable" \nset @SQL = "Select column from " + @mytable \nexecute (@SQL)\n\nis equivalent to: \nSELECT column from TheTable\n\nthis is sometimes refered to as dynamic SQL since it is not known until runtime
1124246
1) Consider adding another field that records last date when the record was changed or a record version number so that you have a single field to test against.\n\n2) Then (depending on technology - is this Oracle, SQL, Access???) look at what sort of indexing you have set up.  This can dramatically speed up performance.
1104211
In Visual Basic, sub procedures are methods which do not return a value. Each time when the Sub procedure is called the statements within it are executed until the matching End Sub is encountered. Sub Main(), the starting point of the program itself is a sub procedure. When the application starts execution, control is transferred to Main Sub procedure automatically which is called by default.\n\nFor a sample walkthrough of creating a new VB project and main subprocedure, you can take a look at http://www.informit.com/articles/article.asp?p=31962&seqNum=2&rl=1.  \n\nHope this helps.
650047
What does "hit all of the control form fields and report the information back to SQL" mean? \n\nDo you mean, you want a button that will run a given stored procedure on the server, using parameters?\n\nDo you mean, you want to obtain the value of the form fields and use them to build a SQL statement that you then execute on the server?\n\nAlso, are you using SQL server, MySQL, SAP, whatever as a SQL database?\n\nUPDATE:\n\nYou still haven't told me what kind of DB server you are using, so I'll assume is SQL Server.\n\nYou don't need to create a VBA Script to do what you want. You can simply link the relevant SQL tables in your Access project file, then work with them as though they were tables in the Access DB itself.\n\nIn other words, you can build a form based on a linked table, just like you would build a form for a regular Access table; it will insert data for you into the linked table, the same way it would for a regular table.\n\nSee link below for more information.
1100890
you should use an sql connection object from the component toolbar n make a connected architecture.. and then drag n drop an sql command object . in that object's property set type = stored procedure and then proceed. it's as simple as that in visual studio..\nin query builder u'll get the type as : create procedure <> as.... GO.\nthen in ur code for d form write:\nSqlCommand cmd = new SqlCommand (<proc.name>, <connection name>);\ncmd.CommandType=CommandType.StoredProcedure;\ncmd.Parameters.Add( new SqlParameter("@<pname>",<type>,value,<col name>));\ncmd.ExecuteNonQuery();\nhope thiswill work for u?
254436
write a script in sql*plus:\n\nSET echo OFF\nSET verify OFF\nSET feedback OFF\nSET pagesize 0\nSET linesize 180\n\nspool DROP.SQL\n\nSELECT 'drop table &&1' || '.' || table_name || 'CASCADE CONSTRAINTS;'\nFROM ALL_TABLES\nWHERE owner = '&&1';\nspool OFF;\n\nSave this as create_drop.sql, then run with\n\nSQL>@@create_drop USER\n\nwhere USER is the user you want to drop, then run drop.sql\n\nSQL>@@drop\n\nGOOD LUCK
774615
I found this for you : http://www.databasejournal.com/features/mssql/article.php/1756161\n\nHope that helps! Sounds like fun!