Hi there, iam trying to use Firebird with this procedure:
Parameters:
NAAM VARCHAR(120)
VWDID INTEGER
QUOTE DECIMAL (9,3)
QUOTEDATE TIMESTAMP
QUOTETYPE VARCHAR(20) -
BEGIN
-
/* Procedure text */
-
DECLARE TYPE_ID int
-
/* Checken of de quote al bekend is */
-
IF(COUNT(QUOTE_VWDID) FROM TBL_QUOTE WHERE QUOTE_VWDID = VWDID) < 1
-
BEGIN
-
/* Hij is nog niet bekend */
-
INSERT INTO TBL_QUOTE (QUOTE_VWDID, QUOTE_NAAM) VALUES (VWDID, NAAM);
-
END
-
/* Checken of de quotetype al bestaat */
-
IF(COUNT(QUOTE_TYPE_NAAM) FROM TBL_QUOTE_TYPE WHERE QUOTE_TYPE_NAAM = NAAM) < 1
-
BEGIN
-
/* Quote type is nog niet bekend */
-
INSERT INTO TBL_QUOTE_TYPE (QUOTE_TYPE_NAAM) VALUES (QUOTETYPE);
-
END
-
/* Zetten van de type_id */
-
SET TYPE_ID = SELECT QUOTE_TYPE_ID FROM TBL_QUOTE_TYPE WHERE QUOTE_TYPE_NAAM = NAAM;
-
-
INSERT INTO TBL_QUOTE_LOG (QUOTE_LOG_TIMESTAMP, QUOTE_LOG_QUOTE, QUOTE_VWDID, QUOTE_TYPE_ID)
-
VALUES (QUOTEDATE, QUOTE, VWIDID, TYPE_ID);
-
END
-
I have no idea how to get this stored procedure to work with Firebird
Any help is much appriciated! =)
1 2287
I have managed to work a bit on the procedure, i currently have this error:
Engine Error (code = 335544569):
Dynamic SQL Error.
SQL error code = -206.
Subselect illegal in this context.
SQL Error (code = -206):
Any Idea? thx =) -
SET TERM ^ ;
-
-
ALTER PROCEDURE PRC_QUOTE_LOG_ADD (
-
NAAM VARCHAR(120),
-
VWDID INTEGER,
-
QUOTE DECIMAL(9,3),
-
QUOTEDATE TIMESTAMP,
-
QUOTETYPE VARCHAR(20))
-
AS
-
DECLARE VARIABLE TYPE_ID INTEGER;
-
BEGIN
-
/* Procedure text */
-
/* Checken of de quote al bekend is */
-
IF((SELECT COUNT(QUOTE_VWDID) FROM TBL_QUOTE WHERE QUOTE_VWDID = VWDID) < 1)
-
THEN
-
BEGIN
-
/* Hij is nog niet bekend */
-
INSERT INTO TBL_QUOTE (QUOTE_VWDID, QUOTE_NAAM) VALUES (VWDID, NAAM);
-
END
-
/* Checken of de quotetype al bestaat */
-
IF((SELECT COUNT(QUOTE_TYPE_NAAM) FROM TBL_QUOTE_TYPE WHERE QUOTE_TYPE_NAAM = NAAM) < 1)
-
THEN
-
BEGIN
-
/* Quote type is nog niet bekend */
-
INSERT INTO TBL_QUOTE_TYPE (QUOTE_TYPE_NAAM) VALUES (QUOTETYPE);
-
END
-
-
/* Zetten van de type_id */
-
TYPEID = (SELECT QUOTE_TYPE_ID FROM TBL_QUOTE_TYPE WHERE QUOTE_TYPE_NAAM = NAAM);
-
-
INSERT INTO TBL_QUOTE_LOG (QUOTE_LOG_TIMESTAMP, QUOTE_LOG_QUOTE, QUOTE_VWDID, QUOTE_TYPE_ID)
-
VALUES (QUOTEDATE, QUOTE, VWIDID, TYPE_ID);
-
END;^
-
-
SET TERM ; ^
-
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: berthelot samuel |
last post by:
Hi everyone,
I am currently trying to write a report based on a View of SQL Server.
Basically, I have 3 tables : Hardware, SoftwareInstalled and Software
with SoftwareInstalled that keeps track of all the software installed
on each piece of hardware by referencing the primary keys of each
table.
So now, I have a request that retrieve information from those 3 tables
giving a list of all the hardware with their details + the software...
|
by: Bill Kellaway |
last post by:
Hi there - this should be fairly simple for someone. Basically I
can't figure out how to pass the parameters from ASP to a Stored
Procedure on SQL.
Here's my code:
I just need to help in learning how to pass these varibables from ASP
to the SP.
|
by: Ken |
last post by:
Hello,
I have a webform that gets a record from SQL Server by using a stored
procedure.
The stored procedure uses 3 parameters in which after the record is found,
stored procedure #2 runs to update one of the columns called Status from
"incomplete" to "Pending"
Status is one of the parameters for stored procedure #1.
This all works fine, My problem is after the person is finished with the
record they then push the next button to get...
|
by: Kumar |
last post by:
Hi
I am trying to recreate a database under the following environments :
From: Solaris with DB2UDB version 7.2 with FP 9
To: Linux with DB2UDB version 7.2 with FP 9
It will be of really a great help if any one help me in step-by-step
guidelines to migrate SPs written in Java & C languages. I have
successfully recreated SQL procedures.
|
by: Dino L. |
last post by:
How can I run stored procedure (MSSQL) ?
| |
by: Siv |
last post by:
Hi,
I have a stored procedure that I want to execute and then wait in a loop
showing a timer whilst it completes and then carry on once I get
notification that it has completed. The main reason for this being to stop
the user thinking the application has frozen when in fact it is just waiting
for a long SP to complete. Another reason for doing it like this is that I
also have had a problem in the past where the SP takes longer than the...
|
by: peaceburn |
last post by:
Hi,
I'm gonna pull my hair in the coming days with these DB2 stored
procedures.
So the issue, let's assume a simple stored procedure like this :
CREATE PROCEDURE MYSCHEMA.PROCEDURE1 ( )
DYNAMIC RESULT SETS 1
------------------------------------------------------------------------
|
by: Darth Ferret |
last post by:
This thing is about to drive me crazy. I have about 50 queries in the AS400
that I need to put on a menu. Once I conquer this I have a bunch more rpg
reports that I need to pass a date to. In the AS400 I have a stored
procedure (SPRUNQRY) that runs the RUNQRY command with the name of the query
as a parameter. In the AS400 I would type "RUNQRY SUNTR401A" on a command
line to run this query. My connection is opening, and I can run some...
|
by: Riaaaa |
last post by:
Pls check my code for the stored procedure which i created for the companydetails including
companyid P.K. Not Null int(4),
companyname Not Null varchar (20),
address varchar(30)
where companyid is the primary key and it should be autogenerate.
|
by: SOI_0152 |
last post by:
Hi all!
Happy New Year 2008. Il hope it will bring you love and happyness
I'm new on this forum.
I wrote a stored procedure on mainframe using DB2 7.1.1 and IBM language c.
Everything works fine.
Now we decided to move from mainframe IMS-DB2 to Windows 2003 server-DB2 UDB
for LUW 9.5.
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
| |
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |